syzbot


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

Status: public: reported syz repro on 2019/04/13 00:01
Reported-by: syzbot+f6c3917a094a4d64fde2@syzkaller.appspotmail.com
First crash: 2194d, last: 2194d
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.14 KASAN: slab-out-of-bounds Read in bpf_skb_change_tail C done 2 1784d 1930d 1/1 fixed on 2020/02/05 13:33

Sample crash report:
random: cc1: uninitialized urandom read (8 bytes read)
audit: type=1400 audit(1542601418.614:9): avc:  denied  { map } for  pid=1786 comm="syz-execprog" path="/root/syzkaller-shm812481192" dev="sda1" ino=16483 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:file_t:s0 tclass=file permissive=1
audit: type=1400 audit(1542601424.184:10): avc:  denied  { prog_load } for  pid=4156 comm="syz-executor2" 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_skb_change_tail net/core/filter.c:2370 [inline]
BUG: KASAN: slab-out-of-bounds in bpf_skb_change_tail+0xa2c/0xb90 net/core/filter.c:2367
Read of size 8 at addr ffff8801c7c57e10 by task syz-executor2/4162

CPU: 0 PID: 4162 Comm: syz-executor2 Not tainted 4.14.81+ #6
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_skb_change_tail net/core/filter.c:2370 [inline]
 bpf_skb_change_tail+0xa2c/0xb90 net/core/filter.c:2367
 ___bpf_prog_run+0x248e/0x5c70 kernel/bpf/core.c:1012

Allocated by task 350:
 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
 getname_flags+0xc4/0x540 fs/namei.c:138
 getname fs/namei.c:209 [inline]
 do_unlinkat+0xc9/0x650 fs/namei.c:4070
 do_syscall_64+0x19b/0x4b0 arch/x86/entry/common.c:289
 entry_SYSCALL_64_after_hwframe+0x42/0xb7

Freed by task 350:
 save_stack mm/kasan/kasan.c:447 [inline]
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_slab_free+0xac/0x190 mm/kasan/kasan.c:524
 slab_free_hook mm/slub.c:1389 [inline]
 slab_free_freelist_hook mm/slub.c:1410 [inline]
 slab_free mm/slub.c:2966 [inline]
 kmem_cache_free+0x12d/0x350 mm/slub.c:2988
 putname+0xcf/0x100 fs/namei.c:259
 do_unlinkat+0x16c/0x650 fs/namei.c:4113
 do_syscall_64+0x19b/0x4b0 arch/x86/entry/common.c:289
 entry_SYSCALL_64_after_hwframe+0x42/0xb7

The buggy address belongs to the object at ffff8801c7c56600
 which belongs to the cache names_cache of size 4096
The buggy address is located 2064 bytes to the right of
 4096-byte region [ffff8801c7c56600, ffff8801c7c57600)
The buggy address belongs to the page:
page:ffffea00071f1400 count:1 mapcount:0 mapping:          (null) index:0x0 compound_mapcount: 0
flags: 0x4000000000008100(slab|head)
raw: 4000000000008100 0000000000000000 0000000000000000 0000000100070007
raw: dead000000000100 dead000000000200 ffff8801da97e000 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8801c7c57d00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff8801c7c57d80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff8801c7c57e00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
                         ^
 ffff8801c7c57e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff8801c7c57f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/11/19 04:31 android-4.14 4e76528bd48d adf636a8 .config console log report syz ci-android-414-kasan-gce-root
* Struck through repros no longer work on HEAD.