syzbot


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

Status: public: reported C repro on 2019/04/14 00:00
Reported-by: syzbot+44ca32428f414b8796a6@syzkaller.appspotmail.com
First crash: 2342d, last: 2311d
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: slab-out-of-bounds Read in xfrm_hash_rebuild net C 18 2304d 2371d 4/26 fixed on 2018/02/01 10:32

Sample crash report:
==================================================================
BUG: KASAN: slab-out-of-bounds in xfrm_hash_rebuild+0xa08/0xad0 net/xfrm/xfrm_policy.c:652
Read of size 2 at addr ffff8801c8c4c0cc by task kworker/0:1/25

CPU: 0 PID: 25 Comm: kworker/0:1 Not tainted 4.9.75-g5f5e5d4 #7
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: events xfrm_hash_rebuild
 ffff8801d9977b10 ffffffff81d93049 ffffea0007231200 ffff8801c8c4c0cc
 0000000000000000 ffff8801c8c4c0cc 0000000000000002 ffff8801d9977b48
 ffffffff8153ca53 ffff8801c8c4c0cc 0000000000000002 0000000000000000
Call Trace:
 [<ffffffff81d93049>] __dump_stack lib/dump_stack.c:15 [inline]
 [<ffffffff81d93049>] dump_stack+0xc1/0x128 lib/dump_stack.c:51
 [<ffffffff8153ca53>] print_address_description+0x73/0x280 mm/kasan/report.c:252
 [<ffffffff8153cf75>] kasan_report_error mm/kasan/report.c:351 [inline]
 [<ffffffff8153cf75>] kasan_report+0x275/0x360 mm/kasan/report.c:408
 [<ffffffff8153d094>] __asan_report_load2_noabort+0x14/0x20 mm/kasan/report.c:427
 [<ffffffff833b7bd8>] xfrm_hash_rebuild+0xa08/0xad0 net/xfrm/xfrm_policy.c:652
 [<ffffffff811886d0>] process_one_work+0x7e0/0x1610 kernel/workqueue.c:2091
 [<ffffffff811895e0>] worker_thread+0xe0/0x10d0 kernel/workqueue.c:2225
 [<ffffffff811995dd>] kthread+0x26d/0x300 kernel/kthread.c:211
 [<ffffffff838b0db6>] ret_from_fork+0x46/0x60 arch/x86/entry/entry_64.S:460

Allocated by task 3338:
 save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:57
 save_stack+0x43/0xd0 mm/kasan/kasan.c:505
 set_track mm/kasan/kasan.c:517 [inline]
 kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:609
 __kmalloc+0x11d/0x310 mm/slub.c:3741
 kmalloc include/linux/slab.h:495 [inline]
 sk_prot_alloc+0x101/0x2a0 net/core/sock.c:1338
 sk_alloc+0x3a/0x3a0 net/core/sock.c:1394
 pfkey_create+0x1da/0x8d0 net/key/af_key.c:158
 __sock_create+0x3ab/0x640 net/socket.c:1182
 sock_create net/socket.c:1222 [inline]
 SYSC_socket net/socket.c:1252 [inline]
 SyS_socket+0xf0/0x1b0 net/socket.c:1232
 entry_SYSCALL_64_fastpath+0x23/0xe2

Freed by task 0:
(stack is not available)

The buggy address belongs to the object at ffff8801c8c4bb80
 which belongs to the cache kmalloc-2048 of size 2048
The buggy address is located 1356 bytes inside of
 2048-byte region [ffff8801c8c4bb80, ffff8801c8c4c380)
The buggy address belongs to the page:
page:ffffea0007231200 count:1 mapcount:0 mapping:          (null) index:0x0 compound_mapcount: 0
flags: 0x8000000000004080(slab|head)
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8801c8c4bf80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff8801c8c4c000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff8801c8c4c080: 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc
                                              ^
 ffff8801c8c4c100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff8801c8c4c180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/01/07 05:33 https://android.googlesource.com/kernel/common android-4.9 5f5e5d4041e3 19c05fff .config console log report syz C ci-android-49-kasan-gce
2017/12/21 14:09 https://android.googlesource.com/kernel/common android-4.9 250637879165 eaadba98 .config console log report syz C ci-android-49-kasan-gce
2017/12/07 12:57 https://android.googlesource.com/kernel/common android-4.9 f26d3c76d376 5d643f8e .config console log report syz ci-android-49-kasan-gce
2017/12/07 12:40 https://android.googlesource.com/kernel/common android-4.9 f26d3c76d376 5d643f8e .config console log report ci-android-49-kasan-gce
* Struck through repros no longer work on HEAD.