syzbot


KASAN: use-after-free Read in diFree
Status: upstream: reported C repro on 2022/03/22 12:48
Reported-by: syzbot+1964c915c8c3913b3d7a@syzkaller.appspotmail.com
First crash: 70d, last: 70d

Cause bisection: the issue happens on the oldest tested release (bisect log)
Crash: BUG: unable to handle kernel paging request in diFree (log)
Repro: C syz .config
similar bugs (6):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.19 KASAN: use-after-free Read in diFree C error 12 69d 591d 0/1 upstream: reported C repro on 2020/10/13 01:51
linux-4.14 KASAN: use-after-free Read in diFree C error 1 90d 604d 0/1 upstream: reported C repro on 2020/09/30 00:31
linux-4.19 BUG: unable to handle kernel paging request in diFree C done 18 313d 605d 1/1 fixed on 2021/08/17 00:59
linux-4.14 general protection fault in diFree 1 484d 484d 0/1 auto-closed as invalid on 2021/05/28 19:31
linux-4.14 general protection fault in diFree (2) C 2 9d22h 129d 0/1 upstream: reported C repro on 2022/01/18 19:31
upstream BUG: unable to handle kernel paging request in diFree C done 13 335d 606d 22/22 fixed on 2021/11/10 00:50
Patch testing requests:
Created Duration User Patch Repo Result
2022/03/31 05:14 11m mudongliangabcd@gmail.com git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git -- OK

Sample crash report:
loop0: detected capacity change from 0 to 180
jfs_mount: dbMount failed w/rc = -5
Mount JFS Failure: -5
jfs_mount failed w/return code = -5
loop0: detected capacity change from 0 to 180
jfs_mount: diMount failed w/rc = -5
general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007]
CPU: 0 PID: 3828 Comm: syz-executor115 Not tainted 5.17.0-rc6-next-20220303-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:diFree+0x17f/0x2660 fs/jfs/jfs_imap.c:871
Code: 00 48 8b 44 24 18 48 8b 68 80 4c 89 e8 48 c1 e8 0c 48 89 04 24 48 b8 00 00 00 00 00 fc ff df 4c 8d 65 04 4c 89 e2 48 c1 ea 03 <0f> b6 14 02 4c 89 e0 83 e0 07 83 c0 03 38 d0 7c 08 84 d2 0f 85 26
RSP: 0018:ffffc90003aff8e0 EFLAGS: 00010247
RAX: dffffc0000000000 RBX: ffff88801ce21400 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffffffff82ce6625 RDI: ffff8880718883b0
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: ffffffff82cc0f85 R11: 0000000000000000 R12: 0000000000000004
R13: 0000000000000001 R14: ffffffff8a07aa60 R15: ffff8880718a2930
FS:  00005555569f3300(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f1e855c0720 CR3: 0000000072fcb000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 jfs_evict_inode+0x392/0x470 fs/jfs/inode.c:155
 evict+0x2ed/0x6b0 fs/inode.c:664
 iput_final fs/inode.c:1744 [inline]
 iput.part.0+0x562/0x820 fs/inode.c:1770
 iput+0x58/0x70 fs/inode.c:1760
 diFreeSpecial+0x73/0x100 fs/jfs/jfs_imap.c:548
 jfs_mount+0x1c1/0x7b0 fs/jfs/jfs_mount.c:207
 jfs_fill_super+0x5a4/0xc70 fs/jfs/super.c:560
 mount_bdev+0x34d/0x410 fs/super.c:1367
 legacy_get_tree+0x105/0x220 fs/fs_context.c:610
 vfs_get_tree+0x89/0x2f0 fs/super.c:1497
 do_new_mount fs/namespace.c:3025 [inline]
 path_mount+0x1320/0x1fa0 fs/namespace.c:3355
 do_mount fs/namespace.c:3368 [inline]
 __do_sys_mount fs/namespace.c:3576 [inline]
 __se_sys_mount fs/namespace.c:3553 [inline]
 __x64_sys_mount+0x27f/0x300 fs/namespace.c:3553
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7f1e855ecdba
Code: 48 c7 c2 c0 ff ff ff f7 d8 64 89 02 b8 ff ff ff ff eb d2 e8 a8 00 00 00 0f 1f 84 00 00 00 00 00 49 89 ca b8 a5 00 00 00 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:00007ffe2176c5d8 EFLAGS: 00000282 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007ffe2176c640 RCX: 00007f1e855ecdba
RDX: 0000000020000000 RSI: 0000000020000100 RDI: 00007ffe2176c600
RBP: 00007ffe2176c600 R08: 00007ffe2176c640 R09: 0000000000000002
R10: 0000000000000000 R11: 0000000000000282 R12: 0000000020000260
R13: 0000000000000003 R14: 0000000000000004 R15: 0000000000000004
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:diFree+0x17f/0x2660 fs/jfs/jfs_imap.c:871
Code: 00 48 8b 44 24 18 48 8b 68 80 4c 89 e8 48 c1 e8 0c 48 89 04 24 48 b8 00 00 00 00 00 fc ff df 4c 8d 65 04 4c 89 e2 48 c1 ea 03 <0f> b6 14 02 4c 89 e0 83 e0 07 83 c0 03 38 d0 7c 08 84 d2 0f 85 26
RSP: 0018:ffffc90003aff8e0 EFLAGS: 00010247
RAX: dffffc0000000000 RBX: ffff88801ce21400 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffffffff82ce6625 RDI: ffff8880718883b0
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: ffffffff82cc0f85 R11: 0000000000000000 R12: 0000000000000004
R13: 0000000000000001 R14: ffffffff8a07aa60 R15: ffff8880718a2930
FS:  00005555569f3300(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f1e855c0720 CR3: 0000000072fcb000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	00 48 8b             	add    %cl,-0x75(%rax)
   3:	44 24 18             	rex.R and $0x18,%al
   6:	48 8b 68 80          	mov    -0x80(%rax),%rbp
   a:	4c 89 e8             	mov    %r13,%rax
   d:	48 c1 e8 0c          	shr    $0xc,%rax
  11:	48 89 04 24          	mov    %rax,(%rsp)
  15:	48 b8 00 00 00 00 00 	movabs $0xdffffc0000000000,%rax
  1c:	fc ff df
  1f:	4c 8d 65 04          	lea    0x4(%rbp),%r12
  23:	4c 89 e2             	mov    %r12,%rdx
  26:	48 c1 ea 03          	shr    $0x3,%rdx
* 2a:	0f b6 14 02          	movzbl (%rdx,%rax,1),%edx <-- trapping instruction
  2e:	4c 89 e0             	mov    %r12,%rax
  31:	83 e0 07             	and    $0x7,%eax
  34:	83 c0 03             	add    $0x3,%eax
  37:	38 d0                	cmp    %dl,%al
  39:	7c 08                	jl     0x43
  3b:	84 d2                	test   %dl,%dl
  3d:	0f                   	.byte 0xf
  3e:	85 26                	test   %esp,(%rsi)

Crashes (2):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-linux-next-kasan-gce-root 2022/03/18 14:32 linux-next 91265a6da44d e2d91b1d .config log report syz C general protection fault in diFree
ci-upstream-linux-next-kasan-gce-root 2022/03/18 12:43 linux-next 91265a6da44d e2d91b1d .config log report info KASAN: use-after-free Read in diFree