syzbot


KASAN: slab-out-of-bounds Read in bpf_clone_redirect

Status: public: reported C repro on 2019/04/12 00:01
Reported-by: syzbot+7adf4460f83e0717d66b@syzkaller.appspotmail.com
First crash: 2088d, last: 1699d
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.14 KASAN: slab-out-of-bounds Read in bpf_clone_redirect C done 11 1663d 1826d 1/1 fixed on 2020/01/28 16:29
upstream KASAN: slab-out-of-bounds Read in bpf_clone_redirect bpf net 1 921d 917d 0/27 auto-closed as invalid on 2022/04/09 13:12

Sample crash report:
audit: type=1400 audit(1540861977.088:8): avc:  denied  { prog_load } for  pid=1795 comm="syz-executor778" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=bpf permissive=1
==================================================================
BUG: KASAN: slab-out-of-bounds in ____bpf_clone_redirect net/core/filter.c:1767 [inline]
BUG: KASAN: slab-out-of-bounds in bpf_clone_redirect+0x29a/0x2b0 net/core/filter.c:1758
Read of size 8 at addr ffff8801c4cb8250 by task syz-executor778/1795

CPU: 0 PID: 1795 Comm: syz-executor778 Not tainted 4.14.78+ #26
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0xb9/0x11b lib/dump_stack.c:53
 print_address_description+0x60/0x22b mm/kasan/report.c:252
 kasan_report_error mm/kasan/report.c:351 [inline]
 kasan_report.cold.6+0x11b/0x2dd mm/kasan/report.c:409
 ____bpf_clone_redirect net/core/filter.c:1767 [inline]
 bpf_clone_redirect+0x29a/0x2b0 net/core/filter.c:1758
 ___bpf_prog_run+0x248e/0x5c70 kernel/bpf/core.c:1012

Allocated by task 1795:
 save_stack mm/kasan/kasan.c:447 [inline]
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_kmalloc.part.1+0x4f/0xd0 mm/kasan/kasan.c:551
 slab_post_alloc_hook mm/slab.h:442 [inline]
 slab_alloc_node mm/slub.c:2723 [inline]
 slab_alloc mm/slub.c:2731 [inline]
 kmem_cache_alloc+0xe4/0x2b0 mm/slub.c:2736
 kmem_cache_alloc_node include/linux/slab.h:361 [inline]
 __alloc_skb+0xd8/0x550 net/core/skbuff.c:193
 alloc_skb include/linux/skbuff.h:980 [inline]
 nlmsg_new include/net/netlink.h:511 [inline]
 audit_buffer_alloc kernel/audit.c:1626 [inline]
 audit_log_start+0x3dd/0x6f0 kernel/audit.c:1740
 common_lsm_audit+0xe8/0x1d00 security/lsm_audit.c:450
 slow_avc_audit+0x14a/0x1d0 security/selinux/avc.c:771
 avc_audit security/selinux/include/avc.h:141 [inline]
 avc_has_perm+0x2f2/0x390 security/selinux/avc.c:1146
 selinux_bpf+0xb4/0x100 security/selinux/hooks.c:6285
 security_bpf+0x7c/0xb0 security/security.c:1714
 SYSC_bpf kernel/bpf/syscall.c:1564 [inline]
 SyS_bpf+0x153/0x3640 kernel/bpf/syscall.c:1547
 do_syscall_64+0x19b/0x4b0 arch/x86/entry/common.c:289
 entry_SYSCALL_64_after_hwframe+0x42/0xb7

Freed by task 0:
(stack is not available)

The buggy address belongs to the object at ffff8801c4cb8140
 which belongs to the cache skbuff_head_cache of size 224
The buggy address is located 48 bytes to the right of
 224-byte region [ffff8801c4cb8140, ffff8801c4cb8220)
The buggy address belongs to the page:
page:ffffea0007132e00 count:1 mapcount:0 mapping:          (null) index:0x0
flags: 0x4000000000000100(slab)
raw: 4000000000000100 0000000000000000 0000000000000000 00000001800c000c
raw: dead000000000100 dead000000000200 ffff8801dab70200 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8801c4cb8100: fc fc fc fc fc fc fc fc 00 00 00 00 00 00 00 00
 ffff8801c4cb8180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff8801c4cb8200: 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc
                                                 ^
 ffff8801c4cb8280: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff8801c4cb8300: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc
==================================================================

Crashes (5):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/10/30 01:17 android-4.14 4ed22187defd 2f1090da .config console log report syz C ci-android-414-kasan-gce-root
2019/11/23 13:28 android-4.14 437a2a739c5f 598ca6c8 .config console log report ci-android-414-kasan-gce-root
2019/11/16 08:12 android-4.14 460dc7c31cef cdac920b .config console log report ci-android-414-kasan-gce-root
2019/10/12 18:49 android-4.14 1d75f58e4e19 426631dd .config console log report ci-android-414-kasan-gce-root
2018/10/30 00:46 android-4.14 4ed22187defd 2f1090da .config console log report ci-android-414-kasan-gce-root
* Struck through repros no longer work on HEAD.