syzbot


general protection fault in mutex_optimistic_spin

Status: upstream: reported on 2022/10/13 08:00
Reported-by: syzbot+f587f14d28021bea6455@syzkaller.appspotmail.com
First crash: 44d, last: 43d

Sample crash report:
ERROR: Out of memory at tomoyo_realpath_from_path.
general protection fault, probably for non-canonical address 0xdffffc0000000007: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000038-0x000000000000003f]
CPU: 1 PID: 17930 Comm: syz-executor.4 Not tainted 6.0.0-syzkaller-09423-g493ffd6605b2 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/22/2022
RIP: 0010:owner_on_cpu include/linux/sched.h:2269 [inline]
RIP: 0010:mutex_can_spin_on_owner kernel/locking/mutex.c:409 [inline]
RIP: 0010:mutex_optimistic_spin+0x12d/0x2d0 kernel/locking/mutex.c:452
Code: 89 d8 48 c1 e8 03 42 80 3c 28 00 74 08 48 89 df e8 48 1a 74 00 4c 8b 23 49 83 e4 f8 74 72 49 8d 6c 24 34 48 89 e8 48 c1 e8 03 <42> 8a 04 28 84 c0 0f 85 4f 01 00 00 83 7d 00 00 74 78 49 83 c4 14
RSP: 0018:ffffc9000995f888 EFLAGS: 00010203
RAX: 0000000000000007 RBX: ffff88802dea4028 RCX: ffffffff8165d1a2
RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffff88802dea4028
RBP: 000000000000003c R08: dffffc0000000000 R09: ffffed1005bd4806
R10: ffffed1005bd4806 R11: 1ffff11005bd4805 R12: 0000000000000008
R13: dffffc0000000000 R14: 0000000000000000 R15: 0000000000000000
FS:  00007f7ad070c700(0000) GS:ffff8880b9b00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f41ca3ad0b0 CR3: 0000000032ff1000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 __mutex_lock_common+0x1ef/0x26e0 kernel/locking/mutex.c:607
 __mutex_lock kernel/locking/mutex.c:747 [inline]
 mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:799
 reiserfs_write_lock+0x77/0xd0 fs/reiserfs/lock.c:27
 reiserfs_setattr+0x4a8/0x11a0 fs/reiserfs/inode.c:3284
 notify_change+0xe38/0x10f0 fs/attr.c:420
 chown_common+0x586/0x8f0 fs/open.c:736
 do_fchownat+0x165/0x240 fs/open.c:767
 __do_sys_chown fs/open.c:787 [inline]
 __se_sys_chown fs/open.c:785 [inline]
 __x64_sys_chown+0x7e/0x90 fs/open.c:785
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f7acf68b5a9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f7ad070c168 EFLAGS: 00000246 ORIG_RAX: 000000000000005c
RAX: ffffffffffffffda RBX: 00007f7acf7abf80 RCX: 00007f7acf68b5a9
RDX: 00000000616c6572 RSI: 0000000000000000 RDI: 0000000020000040
RBP: 00007f7ad070c1d0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00007ffd215a3c9f R14: 00007f7ad070c300 R15: 0000000000022000
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:owner_on_cpu include/linux/sched.h:2269 [inline]
RIP: 0010:mutex_can_spin_on_owner kernel/locking/mutex.c:409 [inline]
RIP: 0010:mutex_optimistic_spin+0x12d/0x2d0 kernel/locking/mutex.c:452
Code: 89 d8 48 c1 e8 03 42 80 3c 28 00 74 08 48 89 df e8 48 1a 74 00 4c 8b 23 49 83 e4 f8 74 72 49 8d 6c 24 34 48 89 e8 48 c1 e8 03 <42> 8a 04 28 84 c0 0f 85 4f 01 00 00 83 7d 00 00 74 78 49 83 c4 14
RSP: 0018:ffffc9000995f888 EFLAGS: 00010203
RAX: 0000000000000007 RBX: ffff88802dea4028 RCX: ffffffff8165d1a2
RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffff88802dea4028
RBP: 000000000000003c R08: dffffc0000000000 R09: ffffed1005bd4806
R10: ffffed1005bd4806 R11: 1ffff11005bd4805 R12: 0000000000000008
R13: dffffc0000000000 R14: 0000000000000000 R15: 0000000000000000
FS:  00007f7ad070c700(0000) GS:ffff8880b9b00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f41ca3ad0b0 CR3: 0000000032ff1000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	89 d8                	mov    %ebx,%eax
   2:	48 c1 e8 03          	shr    $0x3,%rax
   6:	42 80 3c 28 00       	cmpb   $0x0,(%rax,%r13,1)
   b:	74 08                	je     0x15
   d:	48 89 df             	mov    %rbx,%rdi
  10:	e8 48 1a 74 00       	callq  0x741a5d
  15:	4c 8b 23             	mov    (%rbx),%r12
  18:	49 83 e4 f8          	and    $0xfffffffffffffff8,%r12
  1c:	74 72                	je     0x90
  1e:	49 8d 6c 24 34       	lea    0x34(%r12),%rbp
  23:	48 89 e8             	mov    %rbp,%rax
  26:	48 c1 e8 03          	shr    $0x3,%rax
* 2a:	42 8a 04 28          	mov    (%rax,%r13,1),%al <-- trapping instruction
  2e:	84 c0                	test   %al,%al
  30:	0f 85 4f 01 00 00    	jne    0x185
  36:	83 7d 00 00          	cmpl   $0x0,0x0(%rbp)
  3a:	74 78                	je     0xb4
  3c:	49 83 c4 14          	add    $0x14,%r12

Crashes (2):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci2-upstream-fs 2022/10/14 12:04 upstream 493ffd6605b2 4954e4b2 .config log report info general protection fault in mutex_optimistic_spin
ci-upstream-kasan-gce-smack-root 2022/10/13 06:31 upstream 55be6084c8e0 3f6b40a1 .config log report info general protection fault in mutex_optimistic_spin
* Struck through repros no longer work on HEAD.