[v5.15] KASAN: null-ptr-deref Write in udf_bread

0 views
Skip to first unread message

syzbot

unread,
Apr 30, 2024, 1:16:26 PMApr 30
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: b925f60c6ee7 Linux 5.15.157
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=14e5556b180000
kernel config: https://syzkaller.appspot.com/x/.config?x=2a1cb0d51cbb9dfb
dashboard link: https://syzkaller.appspot.com/bug?extid=257351b0d5fe1fb3655e
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/07f51426f82f/disk-b925f60c.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/d41cc73399aa/vmlinux-b925f60c.xz
kernel image: https://storage.googleapis.com/syzbot-assets/0f542c09e64b/bzImage-b925f60c.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+257351...@syzkaller.appspotmail.com

==================================================================
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-executor.0/10619

CPU: 0 PID: 10619 Comm: syz-executor.0 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:0x7f89dfc73ea9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 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 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f89de1c50c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000055
RAX: ffffffffffffffda RBX: 00007f89dfda2050 RCX: 00007f89dfc73ea9
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000020000300
RBP: 00007f89dfcc04a4 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000006e R14: 00007f89dfda2050 R15: 00007fff162be9e8
</TASK>
==================================================================


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

syzbot

unread,
Apr 30, 2024, 6:43:31 PMApr 30
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: b925f60c6ee7 Linux 5.15.157
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=1239a228980000
kernel config: https://syzkaller.appspot.com/x/.config?x=2a1cb0d51cbb9dfb
dashboard link: https://syzkaller.appspot.com/bug?extid=257351b0d5fe1fb3655e
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=124c40a7180000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1197597f180000
mounted in repro: https://storage.googleapis.com/syzbot-assets/b6d95a3c7b79/mount_1.gz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+257351...@syzkaller.appspotmail.com

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
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>
==================================================================


---
If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

syzbot

unread,
May 13, 2024, 5:25:07 AM (5 days ago) May 13
to syzkaller...@googlegroups.com
syzbot suspects this issue could be fixed by backporting the following commit:

commit 32f123a3f34283f9c6446de87861696f0502b02e
git tree: upstream
Author: Jan Kara <ja...@suse.cz>
Date: Wed Jan 18 14:33:41 2023 +0000

udf: Fold udf_getblk() into udf_bread()

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=111348cc980000
Please keep in mind that other backports might be required as well.

For information about bisection process see: https://goo.gl/tpsmEJ#bisection
Reply all
Reply to author
Forward
0 new messages