BUG: bad usercopy in memdup_user_nul

Status: closed as dup on 2017/12/31 08:11
Subsystems: hardening mm
[Documentation on labels]
First crash: 2271d, last: 2254d
Duplicate of
Title Repro Cause bisect Fix bisect Count Last Reported
KASAN: use-after-free Read in __list_del_entry_valid (2) crypto C 11 2266d 2268d

Sample crash report:
usercopy: kernel memory overwrite attempt detected to 00000000a9e44ec2 (kmalloc-1024) (984 bytes)
QAT: Invalid ioctl
------------[ cut here ]------------
kernel BUG at mm/usercopy.c:72!
invalid opcode: 0000 [#1] SMP KASAN
Dumping ftrace buffer:
   (ftrace buffer empty)
Modules linked in:
CPU: 0 PID: 25103 Comm: syz-executor7 Not tainted 4.15.0-rc3+ #221
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:report_usercopy mm/usercopy.c:64 [inline]
RIP: 0010:__check_object_size+0x3a2/0x4f0 mm/usercopy.c:264
RSP: 0018:ffff8801cdc773e0 EFLAGS: 00010282
RAX: 0000000000000061 RBX: ffffffff85328c00 RCX: 0000000000000000
QAT: Invalid ioctl
RDX: 0000000000000061 RSI: ffffc90001896000 RDI: ffffed0039b8ee70
RBP: ffff8801cdc774d0 R08: 1ffff10039b8edfe R09: 0000000000000000
R10: 000000007fb6d303 R11: 0000000000000000 R12: ffffffff85328bc0
R13: ffff8801d4918090 R14: 00000000000003d8 R15: ffffea0007524600
FS:  00007f71abb39700(0000) GS:ffff8801db400000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f56aa9834a0 CR3: 00000001d8eaa000 CR4: 00000000001426f0
DR0: 0000000020000000 DR1: 0000000020001000 DR2: 0000000020001000
DR3: 0000000020001008 DR6: 00000000fffe0ff0 DR7: 0000000000000600
Call Trace:
 check_object_size include/linux/thread_info.h:112 [inline]
 check_copy_size include/linux/thread_info.h:143 [inline]
 copy_from_user include/linux/uaccess.h:146 [inline]
 memdup_user_nul+0x47/0x110 mm/util.c:227
 map_write+0x3c3/0x19f0 kernel/user_namespace.c:903
 proc_projid_map_write+0x159/0x1c0 kernel/user_namespace.c:1085
 __vfs_write+0xef/0x970 fs/read_write.c:480
 __kernel_write+0xfe/0x350 fs/read_write.c:501
 write_pipe_buf+0x175/0x220 fs/splice.c:797
 splice_from_pipe_feed fs/splice.c:502 [inline]
 __splice_from_pipe+0x328/0x730 fs/splice.c:626
 splice_from_pipe+0x1e9/0x330 fs/splice.c:661
 default_file_splice_write+0x40/0x90 fs/splice.c:809
 do_splice_from fs/splice.c:851 [inline]
 direct_splice_actor+0x125/0x180 fs/splice.c:1018
 splice_direct_to_actor+0x2c1/0x820 fs/splice.c:973
 do_splice_direct+0x2a7/0x3d0 fs/splice.c:1061
 do_sendfile+0x5d5/0xe90 fs/read_write.c:1413
 SYSC_sendfile64 fs/read_write.c:1468 [inline]
 SyS_sendfile64+0xbd/0x160 fs/read_write.c:1460
RIP: 0033:0x452a39
RSP: 002b:00007f71abb38c58 EFLAGS: 00000212 ORIG_RAX: 0000000000000028
RAX: ffffffffffffffda RBX: 00007f71abb38940 RCX: 0000000000452a39
RDX: 000000002030f000 RSI: 0000000000000014 RDI: 0000000000000016
RBP: 00007f71abb38930 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000007563 R11: 0000000000000212 R12: 00000000004b73c9
R13: 00007f71abb38ab8 R14: 00000000004b73d9 R15: 0000000000000000
Code: 48 0f 44 da e8 a0 70 c2 ff 48 8b 85 28 ff ff ff 4d 89 f1 4c 89 e9 4c 89 e2 48 89 de 48 c7 c7 c0 8c 32 85 49 89 c0 e8 a6 2e ac ff <0f> 0b 48 c7 c0 80 8a 32 85 eb 96 48 c7 c0 c0 8a 32 85 eb 8d 48 
RIP: report_usercopy mm/usercopy.c:64 [inline] RSP: ffff8801cdc773e0
RIP: __check_object_size+0x3a2/0x4f0 mm/usercopy.c:264 RSP: ffff8801cdc773e0
---[ end trace 9e984add87d38e0a ]---

Crashes (5):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2017/12/15 04:25 upstream d455df0bcc00 ac20b98c .config console log report ci-upstream-kasan-gce
2018/01/01 05:48 linux-next 0e08c463db38 00193447 .config console log report ci-upstream-next-kasan-gce
2017/12/31 13:58 linux-next 0e08c463db38 00193447 .config console log report ci-upstream-next-kasan-gce
2017/12/21 08:32 linux-next 0e08c463db38 90a46995 .config console log report ci-upstream-next-kasan-gce
2017/12/19 04:36 linux-next 6084b576dca2 1c4160ef .config console log report ci-upstream-next-kasan-gce
* Struck through repros no longer work on HEAD.