syzbot


KASAN: null-ptr-deref Write in udf_bread

Status: upstream: reported C repro on 2023/08/28 19:44
Bug presence: origin:upstream
Labels: missing-backport
[Documentation on labels]
Reported-by: syzbot+a38e34ca637c224f4a79@syzkaller.appspotmail.com
First crash: 248d, last: 3d01h
Fix commit to backport (bisect log) :
tree: upstream
commit 32f123a3f34283f9c6446de87861696f0502b02e
Author: Jan Kara <jack@suse.cz>
Date: Wed Jan 18 14:33:41 2023 +0000

  udf: Fold udf_getblk() into udf_bread()

  
Fix bisection: the issue occurs on the latest tested release (bisect log)
Crash: KASAN: null-ptr-deref Write in udf_bread (log)
Repro: C syz .config
  
Bug presence (3)
Date Name Commit Repro Result
2023/11/28 linux-6.1.y (ToT) 6ac30d748bb0 C [report] KASAN: null-ptr-deref Write in udf_bread
2023/10/14 upstream (ToT) 70f8c6f8f880 C [report] WARNING in __udf_add_aext
2023/11/28 upstream (ToT) 18d46e76d7c2 C Didn't crash
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: null-ptr-deref Write in udf_bread udf 1 466d 462d 0/26 auto-obsoleted due to no activity on 2023/04/23 14:58
linux-5.15 KASAN: null-ptr-deref Write in udf_bread origin:lts-only C 2 2d08h 3d01h 0/3 upstream: reported C repro on 2024/04/30 17:16
Fix bisection attempts (2)
Created Duration User Patch Repo Result
2023/12/19 15:09 4h58m fix candidate upstream job log (1)
2023/11/17 03:03 1h10m bisect fix linux-6.1.y job log (0) log

Sample crash report:
==================================================================
BUG: KASAN: null-ptr-deref in instrument_atomic_read_write include/linux/instrumented.h:102 [inline]
BUG: KASAN: null-ptr-deref in test_and_set_bit_lock include/asm-generic/bitops/instrumented-lock.h:57 [inline]
BUG: KASAN: null-ptr-deref in trylock_buffer include/linux/buffer_head.h:390 [inline]
BUG: KASAN: null-ptr-deref in lock_buffer include/linux/buffer_head.h:396 [inline]
BUG: KASAN: null-ptr-deref in udf_getblk fs/udf/inode.c:474 [inline]
BUG: KASAN: null-ptr-deref in udf_bread+0x29f/0x4b0 fs/udf/inode.c:1202
Write of size 8 at addr 0000000000000000 by task syz-executor805/3544

CPU: 0 PID: 3544 Comm: syz-executor805 Not tainted 6.1.57-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/06/2023
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
 print_report+0xe6/0x4f0 mm/kasan/report.c:398
 kasan_report+0x136/0x160 mm/kasan/report.c:495
 kasan_check_range+0x27f/0x290 mm/kasan/generic.c:189
 instrument_atomic_read_write include/linux/instrumented.h:102 [inline]
 test_and_set_bit_lock include/asm-generic/bitops/instrumented-lock.h:57 [inline]
 trylock_buffer include/linux/buffer_head.h:390 [inline]
 lock_buffer include/linux/buffer_head.h:396 [inline]
 udf_getblk fs/udf/inode.c:474 [inline]
 udf_bread+0x29f/0x4b0 fs/udf/inode.c:1202
 udf_add_entry+0x1d1e/0x3350 fs/udf/namei.c:495
 udf_add_nondir+0x132/0x5d0 fs/udf/namei.c:588
 lookup_open fs/namei.c:3413 [inline]
 open_last_lookups fs/namei.c:3481 [inline]
 path_openat+0x12f1/0x2e60 fs/namei.c:3711
 do_filp_open+0x230/0x480 fs/namei.c:3741
 do_sys_openat2+0x13b/0x500 fs/open.c:1318
 do_sys_open fs/open.c:1334 [inline]
 __do_sys_openat fs/open.c:1350 [inline]
 __se_sys_openat fs/open.c:1345 [inline]
 __x64_sys_openat+0x243/0x290 fs/open.c:1345
 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:0x7f5793766ed9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 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:00007ffc80866f18 EFLAGS: 00000246 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 00007ffc80866f40 RCX: 00007f5793766ed9
RDX: 000000000000275a RSI: 0000000020000040 RDI: 00000000ffffff9c
RBP: 00007f57937db5f0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffc80866f40
R13: 00007ffc808671a8 R14: 431bde82d7b634db R15: 00007f57937b003b
 </TASK>
==================================================================

Crashes (5):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/10/14 11:02 linux-6.1.y 082280fe94a0 f757a323 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan KASAN: null-ptr-deref Write in udf_bread
2024/04/30 17:27 linux-6.1.y dcbc050cb0d3 3ce4924c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: null-ptr-deref Write in udf_bread
2024/04/30 17:17 linux-6.1.y dcbc050cb0d3 3ce4924c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: null-ptr-deref Write in udf_bread
2023/10/14 07:18 linux-6.1.y 082280fe94a0 f757a323 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: null-ptr-deref Write in udf_bread
2023/08/28 19:44 linux-6.1.y 024f76bca9d0 7ba13a15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: null-ptr-deref Write in udf_bread
* Struck through repros no longer work on HEAD.