syzbot


BUG: bad usercopy in __check_heap_object (3)

Status: fixed on 2019/06/11 10:01
Subsystems: hardening mm
[Documentation on labels]
Reported-by: syzbot+4b712dce5cbce6700f27@syzkaller.appspotmail.com
Fix commit: 1f4aace60b0e fs/seq_file.c: simplify seq_file iteration code and interface
First crash: 2150d, last: 2079d
Discussions (2)
Title Replies (including bot) Last reply
BUG: bad usercopy in __check_heap_object (3) 1 (2) 2018/07/17 18:44
[PATCH] VFS: simplify seq_file iteration code and interface 11 (11) 2018/07/09 19:40
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream BUG: bad usercopy in __check_heap_object hardening mm 4 2241d 2247d 0/26 closed as invalid on 2018/04/10 15:15
upstream BUG: bad usercopy in __check_heap_object (2) mm hardening 1 2231d 2231d 0/26 closed as invalid on 2018/05/26 17:45

Sample crash report:
IPv6: ADDRCONF(NETDEV_CHANGE): bond0: link becomes ready
IPv6: ADDRCONF(NETDEV_UP): team0: link is not ready
8021q: adding VLAN 0 to HW filter on device team0
usercopy: Kernel memory exposure attempt detected from SLAB object 'kmalloc-4096' (offset 2399, size 2626)!
------------[ cut here ]------------
kernel BUG at mm/usercopy.c:100!
invalid opcode: 0000 [#1] SMP KASAN
CPU: 1 PID: 4718 Comm: syz-executor688 Not tainted 4.18.0-rc3-next-20180706+ #1
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:usercopy_abort+0xbb/0xbd mm/usercopy.c:88
Code: c0 e8 37 ec b8 ff ff 75 c8 48 8b 55 c0 4d 89 f9 ff 75 d0 4d 89 e8 48 89 d9 4c 89 e6 41 56 48 c7 c7 e0 4c f3 87 e8 37 a0 9f ff <0f> 0b e8 0c ec b8 ff e8 97 42 f7 ff 4c 89 e1 8b 95 14 ff ff ff 31 
RSP: 0018:ffff8801d33a78b0 EFLAGS: 00010286
RAX: 000000000000006b RBX: ffffffff88c10e70 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffffffff81634381 RDI: 0000000000000001
RBP: ffff8801d33a7908 R08: ffff8801d1e2a200 R09: ffffed003b5e4fc0
R10: ffffed003b5e4fc0 R11: ffff8801daf27e07 R12: ffffffff87f34bc0
R13: ffffffff87f34a80 R14: ffffffff87f34a40 R15: ffffffff88c0c905
FS:  00007f56a6072700(0000) GS:ffff8801daf00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020001000 CR3: 00000001b8fdf000 CR4: 00000000001406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 __check_heap_object+0xb5/0xb5 mm/slab.c:4445
 check_heap_object mm/usercopy.c:236 [inline]
 __check_object_size+0x4db/0x5f2 mm/usercopy.c:259
 check_object_size include/linux/thread_info.h:119 [inline]
 check_copy_size include/linux/thread_info.h:150 [inline]
 copy_to_user include/linux/uaccess.h:154 [inline]
 seq_read+0x578/0x10e0 fs/seq_file.c:211
 do_loop_readv_writev fs/read_write.c:700 [inline]
 do_iter_read+0x49e/0x650 fs/read_write.c:924
 vfs_readv+0x175/0x1c0 fs/read_write.c:986
 do_readv+0x11a/0x310 fs/read_write.c:1019
 __do_sys_readv fs/read_write.c:1106 [inline]
 __se_sys_readv fs/read_write.c:1103 [inline]
 __x64_sys_readv+0x75/0xb0 fs/read_write.c:1103
 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x446c09
Code: e8 1c bc 02 00 48 83 c4 18 c3 0f 1f 80 00 00 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 5b 07 fc ff c3 66 2e 0f 1f 84 00 00 00 00 
RSP: 002b:00007f56a6071d18 EFLAGS: 00000246 ORIG_RAX: 0000000000000013
RAX: ffffffffffffffda RBX: 00000000006dcc5c RCX: 0000000000446c09
RDX: 0000000000000002 RSI: 00000000200021c0 RDI: 0000000000000005
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000006dcc58
R13: 00007f56a6071d20 R14: 6f72746e6f632f2e R15: 0000000000000007
Modules linked in:
Dumping ftrace buffer:
   (ftrace buffer empty)
---[ end trace 532b9c3f493b2e4d ]---
RIP: 0010:usercopy_abort+0xbb/0xbd mm/usercopy.c:88
Code: c0 e8 37 ec b8 ff ff 75 c8 48 8b 55 c0 4d 89 f9 ff 75 d0 4d 89 e8 48 89 d9 4c 89 e6 41 56 48 c7 c7 e0 4c f3 87 e8 37 a0 9f ff <0f> 0b e8 0c ec b8 ff e8 97 42 f7 ff 4c 89 e1 8b 95 14 ff ff ff 31 
RSP: 0018:ffff8801d33a78b0 EFLAGS: 00010286
RAX: 000000000000006b RBX: ffffffff88c10e70 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffffffff81634381 RDI: 0000000000000001
RBP: ffff8801d33a7908 R08: ffff8801d1e2a200 R09: ffffed003b5e4fc0
R10: ffffed003b5e4fc0 R11: ffff8801daf27e07 R12: ffffffff87f34bc0
R13: ffffffff87f34a80 R14: ffffffff87f34a40 R15: ffffffff88c0c905
FS:  00007f56a6072700(0000) GS:ffff8801daf00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020001000 CR3: 00000001b8fdf000 CR4: 00000000001406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400

Crashes (287):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/07/06 18:20 linux-next 526674536360 9636bc93 .config console log report syz C ci-upstream-linux-next-kasan-gce-root
2018/07/17 16:09 upstream 30b06abfb92b 6d5bd5b5 .config console log report ci-upstream-kasan-gce-root
2018/09/03 16:54 bpf 597222f72a94 a4718693 .config console log report ci-upstream-bpf-kasan-gce
2018/07/12 07:37 bpf 61d769807f27 2e0e3130 .config console log report ci-upstream-bpf-kasan-gce
2018/09/15 13:17 net-next-old ee4fccbee7d3 a343a400 .config console log report ci-upstream-net-kasan-gce
2018/07/23 18:10 bpf-next 8ae71e76cf1f f69c5fcd .config console log report ci-upstream-bpf-next-kasan-gce
2018/07/23 14:14 bpf-next 8ae71e76cf1f f69c5fcd .config console log report ci-upstream-bpf-next-kasan-gce
2018/07/23 10:53 bpf-next 8ae71e76cf1f f69c5fcd .config console log report ci-upstream-bpf-next-kasan-gce
2018/07/23 08:59 bpf-next 8ae71e76cf1f f69c5fcd .config console log report ci-upstream-bpf-next-kasan-gce
2018/07/23 07:01 bpf-next 8ae71e76cf1f 8cc079c3 .config console log report ci-upstream-bpf-next-kasan-gce
2018/07/23 02:39 bpf-next 8ae71e76cf1f 8cc079c3 .config console log report ci-upstream-bpf-next-kasan-gce
2018/07/23 00:26 bpf-next 8ae71e76cf1f 8cc079c3 .config console log report ci-upstream-bpf-next-kasan-gce
2018/07/22 22:41 bpf-next 8ae71e76cf1f 8cc079c3 .config console log report ci-upstream-bpf-next-kasan-gce
2018/07/22 18:11 bpf-next 8ae71e76cf1f 8cc079c3 .config console log report ci-upstream-bpf-next-kasan-gce
2018/07/22 16:15 bpf-next 8ae71e76cf1f 8cc079c3 .config console log report ci-upstream-bpf-next-kasan-gce
2018/07/22 13:54 bpf-next 8ae71e76cf1f 8cc079c3 .config console log report ci-upstream-bpf-next-kasan-gce
2018/07/22 11:08 bpf-next 8ae71e76cf1f 8cc079c3 .config console log report ci-upstream-bpf-next-kasan-gce
2018/07/22 10:27 bpf-next 8ae71e76cf1f 8cc079c3 .config console log report ci-upstream-bpf-next-kasan-gce
2018/07/22 08:30 bpf-next 8ae71e76cf1f 8cc079c3 .config console log report ci-upstream-bpf-next-kasan-gce
2018/07/22 04:35 bpf-next 8ae71e76cf1f 8cc079c3 .config console log report ci-upstream-bpf-next-kasan-gce
2018/07/22 03:19 bpf-next 8ae71e76cf1f 8cc079c3 .config console log report ci-upstream-bpf-next-kasan-gce
2018/07/22 01:39 bpf-next 8ae71e76cf1f 8cc079c3 .config console log report ci-upstream-bpf-next-kasan-gce
2018/07/21 22:31 bpf-next 8ae71e76cf1f 8cc079c3 .config console log report ci-upstream-bpf-next-kasan-gce
2018/07/21 14:43 bpf-next 8ae71e76cf1f 8cc079c3 .config console log report ci-upstream-bpf-next-kasan-gce
2018/07/21 11:32 bpf-next 8ae71e76cf1f 8cc079c3 .config console log report ci-upstream-bpf-next-kasan-gce
2018/07/21 09:59 bpf-next 8ae71e76cf1f 8cc079c3 .config console log report ci-upstream-bpf-next-kasan-gce
2018/07/21 08:13 bpf-next 8ae71e76cf1f 8cc079c3 .config console log report ci-upstream-bpf-next-kasan-gce
2018/07/21 04:34 bpf-next 8ae71e76cf1f af255b09 .config console log report ci-upstream-bpf-next-kasan-gce
2018/07/21 03:20 bpf-next 8ae71e76cf1f af255b09 .config console log report ci-upstream-bpf-next-kasan-gce
2018/07/21 01:52 bpf-next 8ae71e76cf1f af255b09 .config console log report ci-upstream-bpf-next-kasan-gce
2018/07/21 01:04 net-next-old eecd6857709e af255b09 .config console log report ci-upstream-net-kasan-gce
2018/07/20 21:55 bpf-next 8ae71e76cf1f af255b09 .config console log report ci-upstream-bpf-next-kasan-gce
2018/07/20 19:52 bpf-next 8ae71e76cf1f af255b09 .config console log report ci-upstream-bpf-next-kasan-gce
2018/07/20 18:49 net-next-old a3eed83a1895 af255b09 .config console log report ci-upstream-net-kasan-gce
2018/07/20 16:31 bpf-next 8ae71e76cf1f 49f35839 .config console log report ci-upstream-bpf-next-kasan-gce
2018/07/20 14:24 bpf-next 8ae71e76cf1f 49f35839 .config console log report ci-upstream-bpf-next-kasan-gce
2018/07/20 13:15 net-next-old a3eed83a1895 49f35839 .config console log report ci-upstream-net-kasan-gce
2018/07/20 11:15 net-next-old a3eed83a1895 49f35839 .config console log report ci-upstream-net-kasan-gce
2018/07/20 08:26 bpf-next 8ae71e76cf1f 49f35839 .config console log report ci-upstream-bpf-next-kasan-gce
2018/07/20 06:11 bpf-next 8ae71e76cf1f 49f35839 .config console log report ci-upstream-bpf-next-kasan-gce
2018/07/20 02:00 bpf-next 8ae71e76cf1f 49f35839 .config console log report ci-upstream-bpf-next-kasan-gce
2018/07/20 00:56 bpf-next 8ae71e76cf1f 49f35839 .config console log report ci-upstream-bpf-next-kasan-gce
2018/07/19 22:14 net-next-old 3bc950c34b28 49f35839 .config console log report ci-upstream-net-kasan-gce
2018/07/11 08:06 linux-next 98be45067040 2e0e3130 .config console log report ci-upstream-linux-next-kasan-gce-root
* Struck through repros no longer work on HEAD.