syzbot


general protection fault in lbmStartIO

Status: fixed on 2023/12/21 03:45
Subsystems: jfs
[Documentation on labels]
Reported-by: syzbot+23bc20037854bb335d59@syzkaller.appspotmail.com
Fix commit: 6306ff39a7fc jfs: fix log->bdev_handle null ptr deref in lbmStartIO
First crash: 237d, last: 225d
Cause bisection: introduced by (bisect log) :
commit bacfceeda53ea9ee9af714245e6c67aa70632b63
Author: Jan Kara <jack@suse.cz>
Date: Wed Sep 27 09:34:30 2023 +0000

  jfs: Convert to bdev_open_by_dev()

Crash: BUG: unable to handle kernel NULL pointer dereference in lbmStartIO (log)
Repro: C syz .config
  
Discussions (2)
Title Replies (including bot) Last reply
[PATCH] jfs: fix log->bdev_handle null ptr deref in lbmStartIO 4 (4) 2023/10/09 13:55
[syzbot] [jfs?] general protection fault in lbmStartIO 0 (1) 2023/10/07 22:24
Similar bugs (3)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.14 general protection fault in lbmStartIO jfs C 112 448d 605d 0/1 upstream: reported C repro on 2022/09/30 12:33
linux-4.19 general protection fault in lbmStartIO (2) jfs tmpfs C error 303 448d 891d 0/1 upstream: reported C repro on 2021/12/19 00:23
linux-4.19 general protection fault in lbmStartIO 1 1325d 1325d 0/1 auto-closed as invalid on 2021/02/07 18:50
Last patch testing requests (6)
Created Duration User Patch Repo Result
2023/10/09 07:41 1h52m lizhi.xu@windriver.com patch https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git c9f2baaa18b5 OK log
2023/10/09 06:46 21m lizhi.xu@windriver.com patch https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git c9f2baaa18b5 report log
2023/10/09 04:03 23m lizhi.xu@windriver.com patch https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git c9f2baaa18b5 report log
2023/10/09 03:19 26m lizhi.xu@windriver.com patch https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git c9f2baaa18b5 report log
2023/10/09 02:07 14m lizhi.xu@windriver.com patch https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git c9f2baaa18b5 report log
2023/10/09 01:24 14m lizhi.xu@windriver.com patch https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git c9f2baaa18b5 report log

Sample crash report:
general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007]
CPU: 1 PID: 5058 Comm: syz-executor352 Not tainted 6.6.0-rc4-next-20231003-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/06/2023
RIP: 0010:lbmStartIO+0xb7/0x3a0 fs/jfs/jfs_logmgr.c:2116
Code: fc ff df 48 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 cf 02 00 00 48 b8 00 00 00 00 00 fc ff df 49 8b 5c 24 20 48 89 da 48 c1 ea 03 <80> 3c 02 00 0f 85 86 02 00 00 48 8b 3b ba 01 08 00 00 b9 40 0c 00
RSP: 0018:ffffc90003a5fa90 EFLAGS: 00010246
RAX: dffffc0000000000 RBX: 0000000000000000 RCX: ffffffff82fd8ed3
RDX: 0000000000000000 RSI: ffffffff82fd8ee1 RDI: ffff88807bb07020
RBP: ffff88801764d800 R08: 0000000000000005 R09: 0000000000000003
R10: 0000000000000002 R11: ffffffff910eb4a0 R12: ffff88807bb07000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000002
FS:  0000555555ed5380(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fffc6e0506c CR3: 000000007c5c6000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 lbmWrite+0x32e/0x470 fs/jfs/jfs_logmgr.c:2067
 lmNextPage.isra.0+0x278/0x700 fs/jfs/jfs_logmgr.c:616
 lmWriteRecord+0xb6d/0x12a0 fs/jfs/jfs_logmgr.c:529
 lmLogSync+0x182/0x820 fs/jfs/jfs_logmgr.c:969
 jfs_syncpt+0x89/0xa0 fs/jfs/jfs_logmgr.c:1041
 jfs_sync_fs+0x83/0xa0 fs/jfs/super.c:685
 sync_filesystem fs/sync.c:56 [inline]
 sync_filesystem+0x109/0x280 fs/sync.c:30
 generic_shutdown_super+0x7e/0x3c0 fs/super.c:669
 kill_block_super+0x3b/0x90 fs/super.c:1652
 deactivate_locked_super+0xbc/0x1a0 fs/super.c:484
 deactivate_super+0xde/0x100 fs/super.c:517
 cleanup_mnt+0x222/0x3d0 fs/namespace.c:1256
 task_work_run+0x14d/0x240 kernel/task_work.c:180
 ptrace_notify+0x10c/0x130 kernel/signal.c:2399
 ptrace_report_syscall include/linux/ptrace.h:411 [inline]
 ptrace_report_syscall_exit include/linux/ptrace.h:473 [inline]
 syscall_exit_work kernel/entry/common.c:251 [inline]
 syscall_exit_to_user_mode_prepare+0x120/0x220 kernel/entry/common.c:278
 __syscall_exit_to_user_mode_work kernel/entry/common.c:283 [inline]
 syscall_exit_to_user_mode+0xd/0x60 kernel/entry/common.c:296
 do_syscall_64+0x44/0xb0 arch/x86/entry/common.c:87
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7ff1e4cd5547
Code: 07 00 48 83 c4 08 5b 5d c3 66 2e 0f 1f 84 00 00 00 00 00 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 b8 a6 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 01 c3 48 c7 c2 b8 ff ff ff f7 d8 64 89 02 b8
RSP: 002b:00007fffc6e05058 EFLAGS: 00000202 ORIG_RAX: 00000000000000a6
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 00007ff1e4cd5547
RDX: 0000000000000000 RSI: 000000000000000a RDI: 00007fffc6e05110
RBP: 00007fffc6e05110 R08: 0000000000000000 R09: 0000000000000000
R10: 00000000ffffffff R11: 0000000000000202 R12: 00007fffc6e06180
R13: 0000555555ed66c0 R14: 431bde82d7b634db R15: 00007fffc6e061a0
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:lbmStartIO+0xb7/0x3a0 fs/jfs/jfs_logmgr.c:2116
Code: fc ff df 48 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 cf 02 00 00 48 b8 00 00 00 00 00 fc ff df 49 8b 5c 24 20 48 89 da 48 c1 ea 03 <80> 3c 02 00 0f 85 86 02 00 00 48 8b 3b ba 01 08 00 00 b9 40 0c 00
RSP: 0018:ffffc90003a5fa90 EFLAGS: 00010246
RAX: dffffc0000000000 RBX: 0000000000000000 RCX: ffffffff82fd8ed3
RDX: 0000000000000000 RSI: ffffffff82fd8ee1 RDI: ffff88807bb07020
RBP: ffff88801764d800 R08: 0000000000000005 R09: 0000000000000003
R10: 0000000000000002 R11: ffffffff910eb4a0 R12: ffff88807bb07000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000002
FS:  0000555555ed5380(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000555555ede6f8 CR3: 000000007c5c6000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess), 2 bytes skipped:
   0:	df 48 89             	fisttps -0x77(%rax)
   3:	fa                   	cli
   4:	48 c1 ea 03          	shr    $0x3,%rdx
   8:	80 3c 02 00          	cmpb   $0x0,(%rdx,%rax,1)
   c:	0f 85 cf 02 00 00    	jne    0x2e1
  12:	48 b8 00 00 00 00 00 	movabs $0xdffffc0000000000,%rax
  19:	fc ff df
  1c:	49 8b 5c 24 20       	mov    0x20(%r12),%rbx
  21:	48 89 da             	mov    %rbx,%rdx
  24:	48 c1 ea 03          	shr    $0x3,%rdx
* 28:	80 3c 02 00          	cmpb   $0x0,(%rdx,%rax,1) <-- trapping instruction
  2c:	0f 85 86 02 00 00    	jne    0x2b8
  32:	48 8b 3b             	mov    (%rbx),%rdi
  35:	ba 01 08 00 00       	mov    $0x801,%edx
  3a:	b9                   	.byte 0xb9
  3b:	40 0c 00             	rex or $0x0,%al

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/10/03 22:18 linux-next c9f2baaa18b5 65faba36 .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci-upstream-linux-next-kasan-gce-root general protection fault in lbmStartIO
2023/10/15 06:09 linux-next 7d730f1bf6f3 6388bc36 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in lbmStartIO
* Struck through repros no longer work on HEAD.