syzbot


KASAN: use-after-free Write in udf_close_lvid

Status: upstream: reported C repro on 2021/12/21 15:22
Subsystems: udf
[Documentation on labels]
Reported-by: syzbot+efb32e5b4b237e0a8392@syzkaller.appspotmail.com
First crash: 855d, last: 441d
Fix bisection: failed (error log, bisect log)
  
Similar bugs (4)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.14 KASAN: use-after-free Write in udf_close_lvid udf C 4 442d 504d 0/1 upstream: reported C repro on 2022/12/07 21:30
linux-5.15 KASAN: use-after-free Write in udf_close_lvid origin:upstream C 12 2d15h 337d 0/3 upstream: reported C repro on 2023/05/23 16:31
linux-6.1 BUG: unable to handle kernel paging request in udf_close_lvid origin:upstream C 23 6d10h 390d 0/3 upstream: reported C repro on 2023/04/01 11:57
upstream KASAN: use-after-free Write in udf_close_lvid udf C done 144 108d 702d 26/26 fixed on 2024/02/21 18:23

Sample crash report:
UDF-fs: error (device loop5): udf_read_inode: (ino 1408) failed !bh
UDF-fs: error (device loop5): udf_fill_super: Error in udf_iget, block=96, partition=0
==================================================================
BUG: KASAN: use-after-free in udf_close_lvid+0x67c/0x770 fs/udf/super.c:2051
Write of size 1 at addr ffff8880a9ab6ef0 by task syz-executor951/14225

CPU: 1 PID: 14225 Comm: syz-executor951 Not tainted 4.19.211-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
UDF-fs: INFO Mounting volume 'LinuxUDF', timestamp 2020/09/19 18:44 (1000)
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x1fc/0x2ef lib/dump_stack.c:118
 print_address_description.cold+0x54/0x219 mm/kasan/report.c:256
 kasan_report_error.cold+0x8a/0x1b9 mm/kasan/report.c:354
 kasan_report mm/kasan/report.c:412 [inline]
 __asan_report_store1_noabort+0x88/0x90 mm/kasan/report.c:435
 udf_close_lvid+0x67c/0x770 fs/udf/super.c:2051
 udf_fill_super+0xed2/0x17a0 fs/udf/super.c:2310
 mount_bdev+0x2fc/0x3b0 fs/super.c:1158
 mount_fs+0xa3/0x310 fs/super.c:1261
 vfs_kern_mount.part.0+0x68/0x470 fs/namespace.c:961
UDF-fs: error (device loop4): udf_read_inode: (ino 1408) failed !bh
 vfs_kern_mount fs/namespace.c:951 [inline]
 do_new_mount fs/namespace.c:2492 [inline]
 do_mount+0x115c/0x2f50 fs/namespace.c:2822
UDF-fs: error (device loop4): udf_fill_super: Error in udf_iget, block=96, partition=0
 ksys_mount+0xcf/0x130 fs/namespace.c:3038
 __do_sys_mount fs/namespace.c:3052 [inline]
 __se_sys_mount fs/namespace.c:3049 [inline]
 __x64_sys_mount+0xba/0x150 fs/namespace.c:3049
 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x7fe8f063c6aa
Code: 48 c7 c2 b8 ff ff ff f7 d8 64 89 02 b8 ff ff ff ff eb d2 e8 d8 00 00 00 0f 1f 84 00 00 00 00 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48
UDF-fs: error (device loop3): udf_fill_super: Error in udf_iget, block=96, partition=0
RSP: 002b:00007fe8f05e7168 EFLAGS: 00000286 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007fe8f05e71c0 RCX: 00007fe8f063c6aa
RDX: 0000000020000000 RSI: 0000000020000700 RDI: 00007fe8f05e7180
RBP: 000000000000000e R08: 00007fe8f05e71c0 R09: 00007fe8f05e76b8
R10: 0000000000000810 R11: 0000000000000286 R12: 00007fe8f05e7180
R13: 0000000020000350 R14: 0000000000000003 R15: 0000000000000004

The buggy address belongs to the page:
page:ffffea0002a6ad80 count:0 mapcount:-128 mapping:0000000000000000 index:0x0
flags: 0xfff00000000000()
raw: 00fff00000000000 ffffea0002c30f48 ffffea0002d26708 0000000000000000
raw: 0000000000000000 0000000000000000 00000000ffffff7f 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8880a9ab6d80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff8880a9ab6e00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff8880a9ab6e80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                                                             ^
 ffff8880a9ab6f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff8880a9ab6f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================

Crashes (5):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2021/12/21 18:51 linux-4.19.y 3f8a27f9e27b a938f0b8 .config console log report syz C ci2-linux-4-19 KASAN: use-after-free Write in udf_close_lvid
2023/02/09 14:11 linux-4.19.y 3f8a27f9e27b 14a312c8 .config console log report syz C [disk image] [vmlinux] [mounted in repro] ci2-linux-4-19 KASAN: slab-out-of-bounds Write in udf_close_lvid
2023/01/08 14:37 linux-4.19.y 3f8a27f9e27b 1dac8c7a .config console log report syz C [disk image] [vmlinux] [mounted in repro] ci2-linux-4-19 KASAN: slab-out-of-bounds Write in udf_close_lvid
2022/11/06 05:30 linux-4.19.y 3f8a27f9e27b 6d752409 .config console log report syz C [disk image] [vmlinux] [mounted in repro #1] [mounted in repro #2] ci2-linux-4-19 BUG: unable to handle kernel paging request in udf_close_lvid
2021/12/21 15:21 linux-4.19.y 3f8a27f9e27b a938f0b8 .config console log report info ci2-linux-4-19 KASAN: use-after-free Write in udf_close_lvid
* Struck through repros no longer work on HEAD.