syzbot


WARNING: kmalloc bug in memdup_user (2)

Status: fixed on 2018/05/14 10:29
Subsystems: rdma
[Documentation on labels]
Reported-by: syzbot+0fa49f80bc596808c4b8@syzkaller.appspotmail.com
Fix commit: 5f3e3b85cc0a RDMA/ucma: Correct option size check using optlen
First crash: 2271d, last: 2271d
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream WARNING: kmalloc bug in memdup_user (3) bpf C 137 2219d 2220d 8/28 fixed on 2018/07/09 18:05
upstream WARNING: kmalloc bug in memdup_user rdma C 441 2274d 2290d 4/28 fixed on 2018/03/23 18:14

Sample crash report:
WARNING: CPU: 0 PID: 7681 at mm/slab_common.c:1012 kmalloc_slab+0x5d/0x70 mm/slab_common.c:1012
Kernel panic - not syncing: panic_on_warn set ...

CPU: 0 PID: 7681 Comm: syz-executor1 Not tainted 4.16.0-rc7+ #2
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x194/0x24d lib/dump_stack.c:53
 panic+0x1e4/0x41c kernel/panic.c:183
 __warn+0x1dc/0x200 kernel/panic.c:547
 report_bug+0x1f4/0x2b0 lib/bug.c:186
 fixup_bug.part.11+0x37/0x80 arch/x86/kernel/traps.c:178
 fixup_bug arch/x86/kernel/traps.c:247 [inline]
 do_error_trap+0x2d7/0x3e0 arch/x86/kernel/traps.c:296
 do_invalid_op+0x1b/0x20 arch/x86/kernel/traps.c:315
 invalid_op+0x1b/0x40 arch/x86/entry/entry_64.S:986
RIP: 0010:kmalloc_slab+0x5d/0x70 mm/slab_common.c:1012
RSP: 0018:ffff8801a223f970 EFLAGS: 00010246
RAX: 0000000000000000 RBX: fffffffffffffff4 RCX: ffffffff8197516b
RDX: ffffffff8423768f RSI: 0000000000000000 RDI: 0000000001000000
RBP: ffff8801a223f970 R08: 0000000000000000 R09: 0000000000000000
R10: ffffffff88614400 R11: 0000000000000000 R12: 0000000001000000
R13: 000000000000000a R14: 00000000014200c0 R15: ffff8801b95c9a00
 __do_kmalloc mm/slab.c:3700 [inline]
 __kmalloc_track_caller+0x21/0x760 mm/slab.c:3720
 memdup_user+0x2c/0x90 mm/util.c:160
 ucma_set_option+0x14f/0x520 drivers/infiniband/core/ucma.c:1313
 ucma_write+0x2d6/0x3d0 drivers/infiniband/core/ucma.c:1649
 __vfs_write+0xef/0x970 fs/read_write.c:480
 vfs_write+0x189/0x510 fs/read_write.c:544
 SYSC_write fs/read_write.c:589 [inline]
 SyS_write+0xef/0x220 fs/read_write.c:581
 do_syscall_64+0x281/0x940 arch/x86/entry/common.c:287
 entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x454879
RSP: 002b:00007fb9e7b63c68 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007fb9e7b646d4 RCX: 0000000000454879
RDX: 00000000000000b2 RSI: 0000000020000400 RDI: 0000000000000013
RBP: 000000000072bea0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff
R13: 0000000000000683 R14: 00000000006face8 R15: 0000000000000000
Dumping ftrace buffer:
   (ftrace buffer empty)
Kernel Offset: disabled
Rebooting in 86400 seconds..

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/03/26 16:12 upstream 3eb2ce825ea1 e033c1f1 .config console log report ci-upstream-kasan-gce-root
* Struck through repros no longer work on HEAD.