syzbot


kernel BUG in mfill_atomic_copy

Status: upstream: reported C repro on 2023/07/14 03:34
Subsystems: mm
[Documentation on labels]
Reported-by: syzbot+42309678e0bc7b32f8e9@syzkaller.appspotmail.com
Fix commit: mm: userfaultfd: check for start + len overflow in validate_range: fix
Patched on: [ci-upstream-linux-next-kasan-gce-root], missing on: [ci-qemu-gce-upstream-auto ci-qemu-native-arm64-kvm ci-qemu-upstream ci-qemu-upstream-386 ci-qemu2-arm32 ci-qemu2-arm64 ci-qemu2-arm64-compat ci-qemu2-arm64-mte ci-qemu2-riscv64 ci-snapshot-upstream-root ci-upstream-bpf-kasan-gce ci-upstream-bpf-next-kasan-gce ci-upstream-gce-arm64 ci-upstream-gce-leak ci-upstream-kasan-badwrites-root ci-upstream-kasan-gce ci-upstream-kasan-gce-386 ci-upstream-kasan-gce-root ci-upstream-kasan-gce-selinux-root ci-upstream-kasan-gce-smack-root ci-upstream-kmsan-gce-386-root ci-upstream-kmsan-gce-root ci-upstream-net-kasan-gce ci-upstream-net-this-kasan-gce ci2-upstream-fs ci2-upstream-kcsan-gce ci2-upstream-usb]
First crash: 455d, last: 455d
Cause bisection: failed (error log, bisect log)
  
Discussions (2)
Title Replies (including bot) Last reply
[PATCH mm-unstable fix] mm: userfaultfd: check for start + len overflow in validate_range: fix 4 (4) 2023/08/10 19:23
[syzbot] [mm?] kernel BUG in mfill_atomic_copy 2 (3) 2023/07/14 18:18

Sample crash report:
------------[ cut here ]------------
kernel BUG at mm/userfaultfd.c:573!
invalid opcode: 0000 [#1] PREEMPT SMP KASAN
CPU: 1 PID: 5031 Comm: syz-executor410 Not tainted 6.5.0-rc1-next-20230710-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/03/2023
RIP: 0010:mfill_atomic mm/userfaultfd.c:573 [inline]
RIP: 0010:mfill_atomic_copy+0x9ed/0x17e0 mm/userfaultfd.c:725
Code: 8d 8c 24 a8 00 00 00 4c 89 e7 e8 be 54 d9 ff 4c 63 f0 e9 71 fc ff ff e8 51 eb a1 ff 0f 0b e8 4a eb a1 ff 0f 0b e8 43 eb a1 ff <0f> 0b e8 3c eb a1 ff 0f 0b 49 c7 c6 ef ff ff ff e9 54 fd ff ff e8
RSP: 0018:ffffc9000395fb48 EFLAGS: 00010293
RAX: 0000000000000000 RBX: dffffc0000000000 RCX: 0000000000000000
RDX: ffff88801f67bb80 RSI: ffffffff81e32bad RDI: 0000000000000006
RBP: 0000000000000000 R08: 0000000000000006 R09: ffffffffffffffff
R10: 0000000005ffffff R11: 0000000000000001 R12: 0000200000000000
R13: 00005ffffffff001 R14: ffffffffffffffff R15: 0000000005ffffff
FS:  00005555571e03c0(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020000060 CR3: 000000002ba7a000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 userfaultfd_copy fs/userfaultfd.c:1766 [inline]
 userfaultfd_ioctl+0xe43/0x4c40 fs/userfaultfd.c:2098
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:870 [inline]
 __se_sys_ioctl fs/ioctl.c:856 [inline]
 __x64_sys_ioctl+0x19d/0x210 fs/ioctl.c:856
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f2e41c4b4b9
Code: 28 c3 e8 2a 14 00 00 66 2e 0f 1f 84 00 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 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fff13a95188 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007fff13a95198 RCX: 00007f2e41c4b4b9
RDX: 0000000020000040 RSI: 00000000c028aa03 RDI: 0000000000000003
RBP: 00007fff13a95190 R08: 00007fff13a95190 R09: 00007f2e41c0e380
R10: 00007fff13a95190 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:mfill_atomic mm/userfaultfd.c:573 [inline]
RIP: 0010:mfill_atomic_copy+0x9ed/0x17e0 mm/userfaultfd.c:725
Code: 8d 8c 24 a8 00 00 00 4c 89 e7 e8 be 54 d9 ff 4c 63 f0 e9 71 fc ff ff e8 51 eb a1 ff 0f 0b e8 4a eb a1 ff 0f 0b e8 43 eb a1 ff <0f> 0b e8 3c eb a1 ff 0f 0b 49 c7 c6 ef ff ff ff e9 54 fd ff ff e8
RSP: 0018:ffffc9000395fb48 EFLAGS: 00010293
RAX: 0000000000000000 RBX: dffffc0000000000 RCX: 0000000000000000
RDX: ffff88801f67bb80 RSI: ffffffff81e32bad RDI: 0000000000000006
RBP: 0000000000000000 R08: 0000000000000006 R09: ffffffffffffffff
R10: 0000000005ffffff R11: 0000000000000001 R12: 0000200000000000
R13: 00005ffffffff001 R14: ffffffffffffffff R15: 0000000005ffffff
FS:  00005555571e03c0(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020000060 CR3: 000000002ba7a000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/07/10 09:22 linux-next fe57d0d86f03 668cb1fa .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in mfill_atomic_copy
2023/07/10 06:37 linux-next fe57d0d86f03 668cb1fa .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in mfill_atomic_copy
2023/07/10 03:29 linux-next fe57d0d86f03 668cb1fa .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in mfill_atomic_copy
* Struck through repros no longer work on HEAD.