syzbot


KASAN: null-ptr-deref Write in udf_bread

Status: upstream: reported C repro on 2024/04/30 17:16
Bug presence: origin:lts-only
[Documentation on labels]
Reported-by: syzbot+257351b0d5fe1fb3655e@syzkaller.appspotmail.com
First crash: 17d, last: 16d
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()

  
Bug presence (2)
Date Name Commit Repro Result
2024/05/01 linux-5.15.y (ToT) b925f60c6ee7 C [report] KASAN: null-ptr-deref Write in udf_bread
2024/05/01 upstream (ToT) 18daea77cca6 C Didn't crash
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-6.1 KASAN: null-ptr-deref Write in udf_bread origin:upstream missing-backport C done 5 17d 263d 0/3 upstream: reported C repro on 2023/08/28 19:44
upstream KASAN: null-ptr-deref Write in udf_bread udf 1 480d 476d 0/26 auto-obsoleted due to no activity on 2023/04/23 14:58
Fix bisection attempts (1)
Created Duration User Patch Repo Result
2024/05/13 04:56 4h28m fix candidate upstream job log (1)

Sample crash report:
loop0: detected capacity change from 0 to 2048
UDF-fs: error (device loop0): udf_read_tagged: tag checksum failed, block 99: 0x27 != 0x4d
UDF-fs: INFO Mounting volume 'LinuxUDF', timestamp 2022/11/22 14:59 (1000)
==================================================================
BUG: KASAN: null-ptr-deref in instrument_atomic_read_write include/linux/instrumented.h:101 [inline]
BUG: KASAN: null-ptr-deref in test_and_set_bit_lock include/asm-generic/bitops/instrumented-lock.h:55 [inline]
BUG: KASAN: null-ptr-deref in trylock_buffer include/linux/buffer_head.h:395 [inline]
BUG: KASAN: null-ptr-deref in lock_buffer include/linux/buffer_head.h:401 [inline]
BUG: KASAN: null-ptr-deref in udf_getblk fs/udf/inode.c:473 [inline]
BUG: KASAN: null-ptr-deref in udf_bread+0x27c/0x600 fs/udf/inode.c:1201
Write of size 8 at addr 0000000000000000 by task syz-executor250/3500

CPU: 1 PID: 3500 Comm: syz-executor250 Not tainted 5.15.157-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106
 __kasan_report mm/kasan/report.c:438 [inline]
 kasan_report+0x161/0x1c0 mm/kasan/report.c:451
 kasan_check_range+0x27e/0x290 mm/kasan/generic.c:189
 instrument_atomic_read_write include/linux/instrumented.h:101 [inline]
 test_and_set_bit_lock include/asm-generic/bitops/instrumented-lock.h:55 [inline]
 trylock_buffer include/linux/buffer_head.h:395 [inline]
 lock_buffer include/linux/buffer_head.h:401 [inline]
 udf_getblk fs/udf/inode.c:473 [inline]
 udf_bread+0x27c/0x600 fs/udf/inode.c:1201
 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:3462 [inline]
 open_last_lookups fs/namei.c:3532 [inline]
 path_openat+0x130a/0x2f20 fs/namei.c:3739
 do_filp_open+0x21c/0x460 fs/namei.c:3769
 do_sys_openat2+0x13b/0x500 fs/open.c:1253
 do_sys_open fs/open.c:1269 [inline]
 __do_sys_creat fs/open.c:1343 [inline]
 __se_sys_creat fs/open.c:1337 [inline]
 __x64_sys_creat+0x11f/0x160 fs/open.c:1337
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7f0106be1b79
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:00007ffcca466218 EFLAGS: 00000246 ORIG_RAX: 0000000000000055
RAX: ffffffffffffffda RBX: 00007f0106c2a068 RCX: 00007f0106be1b79
RDX: 00007f0106be1b79 RSI: 0000000000000000 RDI: 0000000020000300
RBP: 00007f0106c55610 R08: 00007ffcca4663e8 R09: 00007ffcca4663e8
R10: 00007ffcca4663e8 R11: 0000000000000246 R12: 0000000000000001
R13: 00007ffcca4663d8 R14: 0000000000000001 R15: 0000000000000001
 </TASK>
==================================================================

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/04/30 22:43 linux-5.15.y b925f60c6ee7 3ce4924c .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-5-15-kasan KASAN: null-ptr-deref Write in udf_bread
2024/04/30 17:15 linux-5.15.y b925f60c6ee7 3ce4924c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: null-ptr-deref Write in udf_bread
* Struck through repros no longer work on HEAD.