syzbot


KASAN: use-after-free Read in udf_get_fileident

Status: upstream: reported C repro on 2022/02/15 04:15
Subsystems: udf
[Documentation on labels]
Reported-by: syzbot+20e0018f5cf946534e8c@syzkaller.appspotmail.com
First crash: 795d, last: 414d
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.19 KASAN: slab-out-of-bounds Read in udf_get_fileident udf C error 17 445d 804d 0/1 upstream: reported C repro on 2022/02/06 06:37
Fix bisection attempts (10)
Created Duration User Patch Repo Result
2023/03/02 18:00 29m bisect fix linux-4.14.y job log (0) log
2022/11/14 11:11 28m bisect fix linux-4.14.y job log (0) log
2022/10/15 01:24 22m bisect fix linux-4.14.y job log (0) log
2022/09/14 06:51 21m bisect fix linux-4.14.y job log (0) log
2022/08/15 06:15 22m bisect fix linux-4.14.y job log (0) log
2022/07/16 05:24 23m bisect fix linux-4.14.y job log (0) log
2022/06/16 05:02 21m bisect fix linux-4.14.y job log (0) log
2022/05/17 04:35 26m bisect fix linux-4.14.y job log (0) log
2022/04/17 03:58 21m bisect fix linux-4.14.y job log (0) log
2022/03/17 04:14 24m bisect fix linux-4.14.y job log (0) log

Sample crash report:
UDF-fs: INFO Mounting volume 'LinuxUDF', timestamp 2020/09/19 18:44 (1000)
==================================================================
BUG: KASAN: use-after-free in udf_get_fileident+0x1ea/0x200 fs/udf/directory.c:178
Read of size 2 at addr ffff8880980024fc by task syz-executor244/7960

CPU: 1 PID: 7960 Comm: syz-executor244 Not tainted 4.14.266-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x1b2/0x281 lib/dump_stack.c:58
 print_address_description.cold+0x54/0x1d3 mm/kasan/report.c:252
 kasan_report_error.cold+0x8a/0x191 mm/kasan/report.c:351
 kasan_report mm/kasan/report.c:409 [inline]
 __asan_report_load_n_noabort+0x6b/0x80 mm/kasan/report.c:440
 udf_get_fileident+0x1ea/0x200 fs/udf/directory.c:178
 udf_fileident_read+0x4b9/0x1840 fs/udf/directory.c:36
 udf_readdir+0x4d0/0x11f0 fs/udf/dir.c:129
 iterate_dir+0x1a0/0x5e0 fs/readdir.c:52
 SYSC_getdents64 fs/readdir.c:358 [inline]
 SyS_getdents64+0x125/0x230 fs/readdir.c:339
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x46/0xbb
RIP: 0033:0x7efd8c27c5b9
RSP: 002b:00007ffd8620d638 EFLAGS: 00000246 ORIG_RAX: 00000000000000d9
RAX: ffffffffffffffda RBX: 0030656c69662f2e RCX: 00007efd8c27c5b9
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000004
RBP: 00007efd8c23be50 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007efd8c23bee0
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000

Allocated by task 6234:
 save_stack mm/kasan/kasan.c:447 [inline]
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_kmalloc+0xeb/0x160 mm/kasan/kasan.c:551
 kmem_cache_alloc_trace+0x131/0x3d0 mm/slab.c:3618
 kmalloc include/linux/slab.h:488 [inline]
 kzalloc include/linux/slab.h:661 [inline]
 kernfs_fop_open+0x266/0xc40 fs/kernfs/file.c:648
 do_dentry_open+0x44b/0xec0 fs/open.c:777
 vfs_open+0x105/0x220 fs/open.c:888
 do_last fs/namei.c:3428 [inline]
 path_openat+0x628/0x2970 fs/namei.c:3569
 do_filp_open+0x179/0x3c0 fs/namei.c:3603
 do_sys_open+0x296/0x410 fs/open.c:1081
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x46/0xbb

Freed by task 6234:
 save_stack mm/kasan/kasan.c:447 [inline]
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_slab_free+0xc3/0x1a0 mm/kasan/kasan.c:524
 __cache_free mm/slab.c:3496 [inline]
 kfree+0xc9/0x250 mm/slab.c:3815
 kernfs_fop_release+0x10e/0x180 fs/kernfs/file.c:783
 __fput+0x25f/0x7a0 fs/file_table.c:210
 task_work_run+0x11f/0x190 kernel/task_work.c:113
 tracehook_notify_resume include/linux/tracehook.h:191 [inline]
 exit_to_usermode_loop+0x1ad/0x200 arch/x86/entry/common.c:164
 prepare_exit_to_usermode arch/x86/entry/common.c:199 [inline]
 syscall_return_slowpath arch/x86/entry/common.c:270 [inline]
 do_syscall_64+0x4a3/0x640 arch/x86/entry/common.c:297
 entry_SYSCALL_64_after_hwframe+0x46/0xbb

The buggy address belongs to the object at ffff888098002340
 which belongs to the cache kmalloc-512 of size 512
The buggy address is located 444 bytes inside of
 512-byte region [ffff888098002340, ffff888098002540)
The buggy address belongs to the page:
page:ffffea0002600080 count:1 mapcount:0 mapping:ffff8880980020c0 index:0xffff888098002340
flags: 0xfff00000000100(slab)
raw: 00fff00000000100 ffff8880980020c0 ffff888098002340 0000000100000005
raw: ffffea00025bd9a0 ffff88813fe64738 ffff88813fe74940 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff888098002380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888098002400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888098002480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                                                ^
 ffff888098002500: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
 ffff888098002580: fc fc fc fc fc fc fc fc 00 00 00 00 00 00 00 00
==================================================================

Crashes (10):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/02/15 04:14 linux-4.14.y 8034e99d1a01 8b9ca619 .config console log report syz C ci2-linux-4-14 KASAN: use-after-free Read in udf_get_fileident
2022/11/23 05:18 linux-4.14.y e911713e40ca 9da37ae8 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-4-14 KASAN: slab-out-of-bounds Read in udf_get_fileident
2023/01/30 23:41 linux-4.14.y 3949d1610004 b68fb8d6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 KASAN: use-after-free Read in udf_get_fileident
2022/12/29 03:39 linux-4.14.y c4215ee4771b 44712fbc .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 KASAN: use-after-free Read in udf_get_fileident
2023/01/30 23:40 linux-4.14.y 3949d1610004 b68fb8d6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 KASAN: slab-out-of-bounds Read in udf_get_fileident
2022/11/23 02:11 linux-4.14.y e911713e40ca 9da37ae8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 KASAN: slab-out-of-bounds Read in udf_get_fileident
2022/11/22 23:52 linux-4.14.y e911713e40ca 9da37ae8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 KASAN: slab-out-of-bounds Read in udf_get_fileident
2022/11/22 23:46 linux-4.14.y e911713e40ca 9da37ae8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 KASAN: slab-out-of-bounds Read in udf_get_fileident
2022/11/22 23:43 linux-4.14.y e911713e40ca 9da37ae8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 KASAN: slab-out-of-bounds Read in udf_get_fileident
2022/11/22 23:42 linux-4.14.y e911713e40ca 9da37ae8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 KASAN: slab-out-of-bounds Read in udf_get_fileident
* Struck through repros no longer work on HEAD.