syzbot


general protection fault in reiserfs_xattr_set

Status: upstream: reported C repro on 2024/01/02 10:39
Subsystems: reiserfs
[Documentation on labels]
Reported-by: syzbot+74dce9511a59ad67a492@syzkaller.appspotmail.com
First crash: 111d, last: 97d
Cause bisection: introduced by (bisect log) [no-op commit]:
commit 6f26d010e678249367cc00b5a827c3731c8138f3
Author: Paul E. McKenney <paulmck@kernel.org>
Date: Thu Sep 17 19:34:01 2020 +0000

  rcutorture: Adjust scenarios SRCU-t and SRCU-u to make kconfig happy

Crash: BUG: unable to handle kernel NULL pointer dereference in reiserfs_xattr_set (log)
Repro: C syz .config
  
Fix bisection: fixed by (bisect log) :
commit 6f861765464f43a71462d52026fbddfc858239a5
Author: Jan Kara <jack@suse.cz>
Date: Wed Nov 1 17:43:10 2023 +0000

  fs: Block writes to mounted block devices

  
Discussions (2)
Title Replies (including bot) Last reply
[syzbot] [reiserfs?] general protection fault in reiserfs_xattr_set 1 (4) 2024/03/08 04:02
[PATCH] reiserfs: fix null ptr deref in reiserfs_xattr_set 1 (1) 2024/01/03 12:40
Last patch testing requests (4)
Created Duration User Patch Repo Result
2024/03/25 17:11 1h06m retest repro git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci OK log
2024/02/01 16:10 24m retest repro upstream OK log
2024/01/14 20:52 26m retest repro git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci report log
2024/01/03 12:13 23m eadavis@qq.com patch https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 453f5db0619e OK log

Sample crash report:
general protection fault, probably for non-canonical address 0xdffffc000000000d: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000068-0x000000000000006f]
CPU: 0 PID: 6365 Comm: syz-executor145 Not tainted 6.7.0-rc7-syzkaller-00049-g453f5db0619e #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023
RIP: 0010:d_really_is_negative include/linux/dcache.h:467 [inline]
RIP: 0010:reiserfs_xattr_jcreate_nblocks fs/reiserfs/xattr.h:79 [inline]
RIP: 0010:reiserfs_xattr_set+0x2d4/0x5c0 fs/reiserfs/xattr.c:626
Code: e9 03 80 3c 11 00 0f 85 e0 02 00 00 4d 8b a4 24 a0 05 00 00 48 ba 00 00 00 00 00 fc ff df 49 8d 7c 24 68 48 89 f9 48 c1 e9 03 <80> 3c 11 00 0f 85 cc 02 00 00 49 83 7c 24 68 00 0f 84 eb 01 00 00
RSP: 0018:ffffc9000a22f8f0 EFLAGS: 00010212
RAX: 000000000000006c RBX: ffff88805d650190 RCX: 000000000000000d
RDX: dffffc0000000000 RSI: ffffffff822cd9af RDI: 0000000000000068
RBP: 0000000000000000 R08: 0000000000000005 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000002 R12: 0000000000000000
R13: ffff88801c4e0000 R14: ffff88805d6501b8 R15: 0000000000000036
FS:  00007fd868e9f6c0(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fd868e9fd58 CR3: 0000000079dbb000 CR4: 0000000000350ef0
Call Trace:
 <TASK>
 security_set+0x85/0xb0 fs/reiserfs/xattr_security.c:32
 __vfs_setxattr+0x173/0x1d0 fs/xattr.c:201
 __vfs_setxattr_noperm+0x127/0x5e0 fs/xattr.c:235
 __vfs_setxattr_locked+0x17e/0x250 fs/xattr.c:296
 vfs_setxattr+0x146/0x350 fs/xattr.c:322
 do_setxattr+0x142/0x170 fs/xattr.c:630
 setxattr+0x159/0x170 fs/xattr.c:653
 __do_sys_fsetxattr fs/xattr.c:709 [inline]
 __se_sys_fsetxattr fs/xattr.c:698 [inline]
 __x64_sys_fsetxattr+0x25e/0x310 fs/xattr.c:698
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0x40/0x110 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x63/0x6b
RIP: 0033:0x7fd868f03e99
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 b1 18 00 00 90 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 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fd868e9f228 EFLAGS: 00000246 ORIG_RAX: 00000000000000be
RAX: ffffffffffffffda RBX: 00007fd868f8c6d8 RCX: 00007fd868f03e99
RDX: 0000000020000400 RSI: 00000000200003c0 RDI: 0000000000000004
RBP: 00007fd868f8c6d0 R08: 0000000000000000 R09: 00007fd868e9f6c0
R10: 0000000000000002 R11: 0000000000000246 R12: 00007fd868f58073
R13: 00007fd868f5806b R14: 3404af7c435ebb98 R15: 00007ffd907624e8
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:d_really_is_negative include/linux/dcache.h:467 [inline]
RIP: 0010:reiserfs_xattr_jcreate_nblocks fs/reiserfs/xattr.h:79 [inline]
RIP: 0010:reiserfs_xattr_set+0x2d4/0x5c0 fs/reiserfs/xattr.c:626
Code: e9 03 80 3c 11 00 0f 85 e0 02 00 00 4d 8b a4 24 a0 05 00 00 48 ba 00 00 00 00 00 fc ff df 49 8d 7c 24 68 48 89 f9 48 c1 e9 03 <80> 3c 11 00 0f 85 cc 02 00 00 49 83 7c 24 68 00 0f 84 eb 01 00 00
RSP: 0018:ffffc9000a22f8f0 EFLAGS: 00010212
RAX: 000000000000006c RBX: ffff88805d650190 RCX: 000000000000000d
RDX: dffffc0000000000 RSI: ffffffff822cd9af RDI: 0000000000000068
RBP: 0000000000000000 R08: 0000000000000005 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000002 R12: 0000000000000000
R13: ffff88801c4e0000 R14: ffff88805d6501b8 R15: 0000000000000036
FS:  00007fd868e9f6c0(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fd860e9f000 CR3: 0000000079dbb000 CR4: 0000000000350ef0
----------------
Code disassembly (best guess), 2 bytes skipped:
   0:	80 3c 11 00          	cmpb   $0x0,(%rcx,%rdx,1)
   4:	0f 85 e0 02 00 00    	jne    0x2ea
   a:	4d 8b a4 24 a0 05 00 	mov    0x5a0(%r12),%r12
  11:	00
  12:	48 ba 00 00 00 00 00 	movabs $0xdffffc0000000000,%rdx
  19:	fc ff df
  1c:	49 8d 7c 24 68       	lea    0x68(%r12),%rdi
  21:	48 89 f9             	mov    %rdi,%rcx
  24:	48 c1 e9 03          	shr    $0x3,%rcx
* 28:	80 3c 11 00          	cmpb   $0x0,(%rcx,%rdx,1) <-- trapping instruction
  2c:	0f 85 cc 02 00 00    	jne    0x2fe
  32:	49 83 7c 24 68 00    	cmpq   $0x0,0x68(%r12)
  38:	0f 84 eb 01 00 00    	je     0x229

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/12/31 18:23 upstream 453f5db0619e fb427a07 .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci-upstream-kasan-gce-root general protection fault in reiserfs_xattr_set
2023/12/31 19:21 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci aafe7ad77b91 fb427a07 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci-upstream-gce-arm64 BUG: unable to handle kernel paging request in reiserfs_xattr_set
2023/12/31 17:19 upstream 453f5db0619e fb427a07 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root general protection fault in reiserfs_xattr_set
* Struck through repros no longer work on HEAD.