syzbot


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

Status: closed as invalid on 2019/02/28 02:14
Subsystems: kernel
[Documentation on labels]
Reported-by: syzbot+fc036355de0dd1b312b1@syzkaller.appspotmail.com
First crash: 2024d, last: 2023d
Discussions (1)
Title Replies (including bot) Last reply
KASAN: slab-out-of-bounds Read in mqueue_get_tree 0 (1) 2018/09/12 13:09

Sample crash report:
random: sshd: uninitialized urandom read (32 bytes read)
random: sshd: uninitialized urandom read (32 bytes read)
random: sshd: uninitialized urandom read (32 bytes read)
random: sshd: uninitialized urandom read (32 bytes read)
==================================================================
BUG: KASAN: slab-out-of-bounds in mqueue_get_tree+0x2a2/0x2e0 ipc/mqueue.c:362
Read of size 8 at addr ffff8801d8c569e8 by task syz-executor636/5564

CPU: 1 PID: 5564 Comm: syz-executor636 Not tainted 4.19.0-rc3-next-20180912+ #72
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x1d3/0x2c4 lib/dump_stack.c:113
 print_address_description.cold.8+0x9/0x1ff mm/kasan/report.c:256
 kasan_report_error mm/kasan/report.c:354 [inline]
 kasan_report.cold.9+0x242/0x309 mm/kasan/report.c:412
 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:433
 mqueue_get_tree+0x2a2/0x2e0 ipc/mqueue.c:362
 vfs_get_tree+0x1cb/0x5c0 fs/super.c:1787
 mq_create_mount+0xe3/0x190 ipc/mqueue.c:415
 mq_init_ns+0x15a/0x210 ipc/mqueue.c:1621
 create_ipc_ns ipc/namespace.c:58 [inline]
 copy_ipcs+0x3d2/0x580 ipc/namespace.c:84
 create_new_namespaces+0x376/0x900 kernel/nsproxy.c:87
 unshare_nsproxy_namespaces+0xc3/0x1f0 kernel/nsproxy.c:206
 ksys_unshare+0x79c/0x10b0 kernel/fork.c:2535
 __do_sys_unshare kernel/fork.c:2603 [inline]
 __se_sys_unshare kernel/fork.c:2601 [inline]
 __x64_sys_unshare+0x31/0x40 kernel/fork.c:2601
 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x44ab57
Code: 00 00 00 b8 63 00 00 00 0f 05 48 3d 01 f0 ff ff 0f 83 4d d8 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 b8 10 01 00 00 0f 05 <48> 3d 01 f0 ff ff 0f 83 2d d8 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007fffe95bfda8 EFLAGS: 00000217 ORIG_RAX: 0000000000000110
RAX: ffffffffffffffda RBX: 00007fffe95bfdd0 RCX: 000000000044ab57
RDX: 0000000000000000 RSI: 00007fffe95bfdc0 RDI: 0000000008000000
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000001b1d940
R10: 0000000000000000 R11: 0000000000000217 R12: 0000000000408810
R13: 00000000004088a0 R14: 0000000000000000 R15: 0000000000000000

Allocated by task 5564:
 save_stack+0x43/0xd0 mm/kasan/kasan.c:448
 set_track mm/kasan/kasan.c:460 [inline]
 kasan_kmalloc+0xc7/0xe0 mm/kasan/kasan.c:553
 kmem_cache_alloc_trace+0x152/0x750 mm/slab.c:3620
 kmalloc include/linux/slab.h:513 [inline]
 create_ipc_ns ipc/namespace.c:45 [inline]
 copy_ipcs+0x1c6/0x580 ipc/namespace.c:84
 create_new_namespaces+0x376/0x900 kernel/nsproxy.c:87
 unshare_nsproxy_namespaces+0xc3/0x1f0 kernel/nsproxy.c:206
 ksys_unshare+0x79c/0x10b0 kernel/fork.c:2535
 __do_sys_unshare kernel/fork.c:2603 [inline]
 __se_sys_unshare kernel/fork.c:2601 [inline]
 __x64_sys_unshare+0x31/0x40 kernel/fork.c:2601
 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 0:
(stack is not available)

The buggy address belongs to the object at ffff8801d8c562c0
 which belongs to the cache kmalloc-2048 of size 2048
The buggy address is located 1832 bytes inside of
 2048-byte region [ffff8801d8c562c0, ffff8801d8c56ac0)
The buggy address belongs to the page:
page:ffffea0007631580 count:1 mapcount:0 mapping:ffff8801da800c40 index:0x0 compound_mapcount: 0
flags: 0x2fffc0000008100(slab|head)
raw: 02fffc0000008100 ffffea0007632008 ffff8801da801948 ffff8801da800c40
raw: 0000000000000000 ffff8801d8c562c0 0000000100000003 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8801d8c56880: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff8801d8c56900: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff8801d8c56980: 00 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc
                                                          ^
 ffff8801d8c56a00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff8801d8c56a80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================

Crashes (10):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/09/12 21:03 linux-next 7c1b097f27bf 71907daf .config console log report syz C ci-upstream-linux-next-kasan-gce-root
2018/09/12 20:14 linux-next 7c1b097f27bf 71907daf .config console log report syz C ci-upstream-linux-next-kasan-gce-root
2018/09/12 11:19 linux-next 7c1b097f27bf 3c88136c .config console log report syz C ci-upstream-linux-next-kasan-gce-root
2018/09/12 22:49 linux-next 7c1b097f27bf 71907daf .config console log report syz ci-upstream-linux-next-kasan-gce-root
2018/09/13 05:08 linux-next 7c1b097f27bf 71907daf .config console log report ci-upstream-linux-next-kasan-gce-root
2018/09/13 04:52 linux-next 7c1b097f27bf 71907daf .config console log report ci-upstream-linux-next-kasan-gce-root
2018/09/12 18:33 linux-next 7c1b097f27bf 71907daf .config console log report ci-upstream-linux-next-kasan-gce-root
2018/09/12 15:56 linux-next 7c1b097f27bf 71907daf .config console log report ci-upstream-linux-next-kasan-gce-root
2018/09/12 05:14 linux-next 7c1b097f27bf 3c88136c .config console log report ci-upstream-linux-next-kasan-gce-root
2018/09/12 05:10 linux-next 7c1b097f27bf 3c88136c .config console log report ci-upstream-linux-next-kasan-gce-root
* Struck through repros no longer work on HEAD.