syzbot


BUG: unable to handle kernel NULL pointer dereference in hdr_find_e (2)

Status: fixed on 2023/12/21 03:45
Subsystems: ntfs3
[Documentation on labels]
Reported-by: syzbot+60cf892fc31d1f4358fc@syzkaller.appspotmail.com
Fix commit: 1f9b94af923c fs/ntfs3: Fix possible null-pointer dereference in hdr_find_e()
First crash: 261d, last: 189d
Cause bisection: introduced by (bisect log) :
commit 6e5be40d32fb1907285277c02e74493ed43d77fe
Author: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Date: Fri Aug 13 14:21:30 2021 +0000

  fs/ntfs3: Add NTFS3 in fs/Kconfig and fs/Makefile

Crash: BUG: unable to handle kernel NULL pointer dereference in hdr_find_e (log)
Repro: C syz .config
  
Discussions (4)
Title Replies (including bot) Last reply
[PATCH AUTOSEL 5.15 08/28] fs/ntfs3: Fix possible null-pointer dereference in hdr_find_e() 1 (1) 2023/10/29 22:58
[PATCH AUTOSEL 6.1 08/39] fs/ntfs3: Fix possible null-pointer dereference in hdr_find_e() 1 (1) 2023/10/29 22:56
[PATCH AUTOSEL 6.5 13/52] fs/ntfs3: Fix possible null-pointer dereference in hdr_find_e() 1 (1) 2023/10/29 22:53
[syzbot] [ntfs3?] BUG: unable to handle kernel NULL pointer dereference in hdr_find_e (2) 0 (2) 2023/08/31 00:31
Similar bugs (4)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-6.1 BUG: unable to handle kernel NULL pointer dereference in hdr_find_e origin:upstream missing-backport C done 23 299d 395d 3/3 fixed on 2023/09/08 14:10
upstream KASAN: use-after-free Read in hdr_find_e ntfs3 C done done 66 429d 571d 22/26 fixed on 2023/02/24 13:50
upstream BUG: unable to handle kernel NULL pointer dereference in hdr_find_e ntfs3 2 372d 386d 0/26 auto-obsoleted due to no activity on 2023/07/13 08:32
linux-5.15 BUG: unable to handle kernel NULL pointer dereference in hdr_find_e origin:lts-only C done 8 310d 395d 3/3 fixed on 2023/08/01 16:10
Last patch testing requests (5)
Created Duration User Patch Repo Result
2023/09/28 14:01 22m almaz.alexandrovich@paragon-software.com https://github.com/Paragon-Software-Group/linux-ntfs3.git 1f9b94af923c88539426ed811ae7e9543834a5c5 OK log
2023/09/05 03:22 9m retest repro upstream report log
2023/08/09 19:11 36m astrajoan@yahoo.com patch https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master OK log
2023/08/09 19:00 32m astrajoan@yahoo.com patch https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master OK log
2023/08/09 18:48 2m astrajoan@yahoo.com patch https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master error OK
Cause bisection attempts (3)
Created Duration User Patch Repo Result
2023/08/30 18:25 6h02m bisect upstream job log (1) log
2023/08/23 02:09 12h18m bisect upstream error job log (0)
marked invalid by nogikh@google.com
2023/08/03 05:12 12h33m bisect upstream error job log (0)
marked invalid by nogikh@google.com

Sample crash report:
ntfs3: loop0: Different NTFS sector size (2048) and media sector size (512).
BUG: kernel NULL pointer dereference, address: 0000000000000000
#PF: supervisor instruction fetch in kernel mode
#PF: error_code(0x0010) - not-present page
PGD 7ef1f067 P4D 7ef1f067 PUD 252a8067 PMD 0 
Oops: 0010 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 5038 Comm: syz-executor331 Not tainted 6.6.0-rc5-syzkaller-00234-g8cb1f10d8c4b #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/06/2023
RIP: 0010:0x0
Code: Unable to access opcode bytes at 0xffffffffffffffd6.
RSP: 0018:ffffc90003cbf8b8 EFLAGS: 00010246
RAX: 0000000000000000 RBX: ffff88802ae26200 RCX: 0000000000000000
RDX: ffff88802ae26210 RSI: 0000000000000000 RDI: ffff88801c318000
RBP: 0000000000000000 R08: ffff88807d716000 R09: 0000000000000000
R10: 0000000000000002 R11: ffffffff81dd5885 R12: 00000000000000d0
R13: 0000000000000002 R14: 0000000000000000 R15: 0000000000000000
FS:  0000555557342380(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffffffffd6 CR3: 0000000028cde000 CR4: 0000000000350ef0
Call Trace:
 <TASK>
 hdr_find_e.isra.0+0x3d7/0x620 fs/ntfs3/index.c:759
 indx_find+0x267/0x980 fs/ntfs3/index.c:1166
 dir_search_u+0x290/0x3d0 fs/ntfs3/dir.c:254
 ntfs_lookup+0x1c5/0x2a0 fs/ntfs3/namei.c:85
 lookup_one_qstr_excl+0x116/0x180 fs/namei.c:1608
 do_renameat2+0x515/0xdc0 fs/namei.c:4953
 __do_sys_rename fs/namei.c:5058 [inline]
 __se_sys_rename fs/namei.c:5056 [inline]
 __x64_sys_rename+0x81/0xa0 fs/namei.c:5056
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f533b96e5f9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 61 17 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffe8bb6a298 EFLAGS: 00000246 ORIG_RAX: 0000000000000052
RAX: ffffffffffffffda RBX: 0031656c69662f2e RCX: 00007f533b96e5f9
RDX: 00007f533b96d8f0 RSI: 00000000200000c0 RDI: 0000000020000040
RBP: 00007f533ba00610 R08: 000000000001f3d5 R09: 0000000000000000
R10: 00007ffe8bb6a160 R11: 0000000000000246 R12: 0000000000000001
R13: 00007ffe8bb6a468 R14: 0000000000000001 R15: 0000000000000001
 </TASK>
Modules linked in:
CR2: 0000000000000000
---[ end trace 0000000000000000 ]---
RIP: 0010:0x0
Code: Unable to access opcode bytes at 0xffffffffffffffd6.
RSP: 0018:ffffc90003cbf8b8 EFLAGS: 00010246
RAX: 0000000000000000 RBX: ffff88802ae26200 RCX: 0000000000000000
RDX: ffff88802ae26210 RSI: 0000000000000000 RDI: ffff88801c318000
RBP: 0000000000000000 R08: ffff88807d716000 R09: 0000000000000000
R10: 0000000000000002 R11: ffffffff81dd5885 R12: 00000000000000d0
R13: 0000000000000002 R14: 0000000000000000 R15: 0000000000000000
FS:  0000555557342380(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffffffffd6 CR3: 0000000028cde000 CR4: 0000000000350ef0

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/10/14 09:25 upstream 8cb1f10d8c4b 6388bc36 .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci-upstream-kasan-badwrites-root BUG: unable to handle kernel NULL pointer dereference in hdr_find_e
2023/08/03 04:39 upstream 4b954598a47b b178af49 .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-upstream-fs BUG: unable to handle kernel NULL pointer dereference in hdr_find_e
2023/08/22 01:00 upstream f7757129e3de 6b415825 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root BUG: unable to handle kernel NULL pointer dereference in hdr_find_e
2023/08/03 04:22 upstream 4b954598a47b b178af49 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs BUG: unable to handle kernel NULL pointer dereference in hdr_find_e
* Struck through repros no longer work on HEAD.