syzbot


general protection fault in cgroup_file_write
Status: fixed on 2022/03/08 16:11
Reported-by: syzbot+50f5cf33a284ce738b62@syzkaller.appspotmail.com
Fix commit: e57457641613 cgroup: Use open-time cgroup namespace for process migration perm checks
First crash: 231d, last: 150d

Sample crash report:
general protection fault, probably for non-canonical address 0xdffffc0000000008: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000040-0x0000000000000047]
CPU: 0 PID: 4206 Comm: syz-executor.1 Not tainted 5.16.0-rc7-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:cgroup_file_write+0xbe/0x790 kernel/cgroup/cgroup.c:3831
Code: 81 c3 88 08 00 00 48 89 d8 48 c1 e8 03 42 80 3c 38 00 74 08 48 89 df e8 b0 3f 51 00 48 8b 1b 48 83 c3 40 48 89 d8 48 c1 e8 03 <42> 80 3c 38 00 74 08 48 89 df e8 93 3f 51 00 48 8b 03 48 89 44 24
RSP: 0018:ffffc90003b2f2a0 EFLAGS: 00010202
RAX: 0000000000000008 RBX: 0000000000000040 RCX: ffff88801d6e9d00
RDX: 0000000000000000 RSI: ffff88801f864700 RDI: ffff88802356bc00
RBP: ffffc90003b2f390 R08: ffffffff82074ea3 R09: fffffbfff1ff3dfc
R10: fffffbfff1ff3dfc R11: 0000000000000000 R12: 1ffff92000765e5c
R13: ffff88802356bc00 R14: ffff88802356bc00 R15: dffffc0000000000
FS:  0000000000000000(0000) GS:ffff8880b9a00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000001b2e625000 CR3: 000000001e9a0000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 kernfs_fop_write_iter+0x3b6/0x510 fs/kernfs/file.c:296
 __kernel_write+0x5d1/0xaf0 fs/read_write.c:535
 do_acct_process+0x112a/0x17b0 kernel/acct.c:518
 acct_pin_kill+0x27/0x130 kernel/acct.c:173
 pin_kill+0x2a6/0x940 fs/fs_pin.c:44
 mnt_pin_kill+0xc1/0x170 fs/fs_pin.c:81
 cleanup_mnt+0x4bc/0x510 fs/namespace.c:1130
 task_work_run+0x146/0x1c0 kernel/task_work.c:164
 exit_task_work include/linux/task_work.h:32 [inline]
 do_exit+0x705/0x2340 kernel/exit.c:832
 do_group_exit+0x168/0x2d0 kernel/exit.c:929
 get_signal+0x1740/0x2120 kernel/signal.c:2852
 arch_do_signal_or_restart+0x9c/0x730 arch/x86/kernel/signal.c:868
 handle_signal_work kernel/entry/common.c:148 [inline]
 exit_to_user_mode_loop kernel/entry/common.c:172 [inline]
 exit_to_user_mode_prepare+0x191/0x220 kernel/entry/common.c:207
 __syscall_exit_to_user_mode_work kernel/entry/common.c:289 [inline]
 syscall_exit_to_user_mode+0x2e/0x70 kernel/entry/common.c:300
 do_syscall_64+0x53/0xd0 arch/x86/entry/common.c:86
 entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7fbaba320e99
Code: Unable to access opcode bytes at RIP 0x7fbaba320e6f.
RSP: 002b:00007fbab8c96218 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca
RAX: fffffffffffffe00 RBX: 00007fbaba433f68 RCX: 00007fbaba320e99
RDX: 0000000000000000 RSI: 0000000000000080 RDI: 00007fbaba433f68
RBP: 00007fbaba433f60 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007fbaba433f6c
R13: 00007ffd5c7d6b6f R14: 00007fbab8c96300 R15: 0000000000022000
 </TASK>
Modules linked in:
---[ end trace fdc5409623742eb4 ]---
RIP: 0010:cgroup_file_write+0xbe/0x790 kernel/cgroup/cgroup.c:3831
Code: 81 c3 88 08 00 00 48 89 d8 48 c1 e8 03 42 80 3c 38 00 74 08 48 89 df e8 b0 3f 51 00 48 8b 1b 48 83 c3 40 48 89 d8 48 c1 e8 03 <42> 80 3c 38 00 74 08 48 89 df e8 93 3f 51 00 48 8b 03 48 89 44 24
RSP: 0018:ffffc90003b2f2a0 EFLAGS: 00010202
RAX: 0000000000000008 RBX: 0000000000000040 RCX: ffff88801d6e9d00
RDX: 0000000000000000 RSI: ffff88801f864700 RDI: ffff88802356bc00
RBP: ffffc90003b2f390 R08: ffffffff82074ea3 R09: fffffbfff1ff3dfc
R10: fffffbfff1ff3dfc R11: 0000000000000000 R12: 1ffff92000765e5c
R13: ffff88802356bc00 R14: ffff88802356bc00 R15: dffffc0000000000
FS:  0000000000000000(0000) GS:ffff8880b9a00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000001b2e625000 CR3: 000000001e9a0000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	81 c3 88 08 00 00    	add    $0x888,%ebx
   6:	48 89 d8             	mov    %rbx,%rax
   9:	48 c1 e8 03          	shr    $0x3,%rax
   d:	42 80 3c 38 00       	cmpb   $0x0,(%rax,%r15,1)
  12:	74 08                	je     0x1c
  14:	48 89 df             	mov    %rbx,%rdi
  17:	e8 b0 3f 51 00       	callq  0x513fcc
  1c:	48 8b 1b             	mov    (%rbx),%rbx
  1f:	48 83 c3 40          	add    $0x40,%rbx
  23:	48 89 d8             	mov    %rbx,%rax
  26:	48 c1 e8 03          	shr    $0x3,%rax
* 2a:	42 80 3c 38 00       	cmpb   $0x0,(%rax,%r15,1) <-- trapping instruction
  2f:	74 08                	je     0x39
  31:	48 89 df             	mov    %rbx,%rdi
  34:	e8 93 3f 51 00       	callq  0x513fcc
  39:	48 8b 03             	mov    (%rbx),%rax
  3c:	48                   	rex.W
  3d:	89                   	.byte 0x89
  3e:	44                   	rex.R
  3f:	24                   	.byte 0x24

Crashes (15):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-kasan-gce-smack-root 2021/12/29 11:50 upstream e7c124bd0463 76c8cf06 .config log report info general protection fault in cgroup_file_write
ci-upstream-kasan-gce-smack-root 2021/12/22 20:22 upstream 3f066e882bf1 6caa12e4 .config log report info general protection fault in cgroup_file_write
ci-upstream-kasan-gce-smack-root 2021/12/21 14:57 upstream 6e0567b73052 a938f0b8 .config log report info general protection fault in cgroup_file_write
ci-upstream-kasan-gce-smack-root 2021/11/14 10:17 upstream ccfff0a2bd2a 83f5c9b5 .config log report info general protection fault in cgroup_file_write
ci-upstream-kasan-gce-smack-root 2021/11/14 00:03 upstream ccfff0a2bd2a 83f5c9b5 .config log report info general protection fault in cgroup_file_write
ci-upstream-kasan-gce-smack-root 2021/11/13 10:51 upstream 66f4beaa6c1d 83f5c9b5 .config log report info general protection fault in cgroup_file_write
ci-upstream-kasan-gce-smack-root 2021/11/09 16:09 upstream d2f38a3c6507 59bcaf9a .config log report info general protection fault in cgroup_file_write
ci-upstream-kasan-gce-smack-root 2021/11/08 20:32 upstream e851dfae4371 d29682f1 .config log report info general protection fault in cgroup_file_write
ci-upstream-kasan-gce-smack-root 2021/11/07 13:32 upstream b5013d084e03 4c1be0be .config log report info general protection fault in cgroup_file_write
ci-upstream-kasan-gce-smack-root 2021/11/07 00:23 upstream 512b7931ad05 4c1be0be .config log report info general protection fault in cgroup_file_write
ci-upstream-kasan-gce-smack-root 2021/11/05 10:34 upstream d4439a1189f9 4c1be0be .config log report info general protection fault in cgroup_file_write
ci-upstream-kasan-gce-smack-root 2021/11/04 10:13 upstream ce840177930f 4c1be0be .config log report info general protection fault in cgroup_file_write
ci-upstream-kasan-gce-smack-root 2021/11/03 11:31 upstream dcd68326d29b 17f3edd2 .config log report info general protection fault in cgroup_file_write
ci-upstream-kasan-gce-smack-root 2021/10/22 05:05 upstream 2f111a6fd5b5 55f90bc6 .config log report info general protection fault in cgroup_file_write
ci-upstream-kasan-gce-smack-root 2021/10/09 06:18 upstream 741668ef7832 efe0f24d .config log report info general protection fault in cgroup_file_write