syzbot


KASAN: slab-out-of-bounds Write in udf_find_entry

Status: upstream: reported C repro on 2022/11/24 14:45
Reported-by: syzbot+533cd0b18fadb8a01a15@syzkaller.appspotmail.com
First crash: 758d, last: 661d
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.19 KASAN: slab-out-of-bounds Write in udf_find_entry C error 10 743d 1054d 0/1 upstream: reported C repro on 2022/02/01 19:02
upstream KASAN: slab-out-of-bounds Write in udf_find_entry udf C error 19 772d 803d 22/28 fixed on 2023/06/12 19:24
Fix bisection attempts (2)
Created Duration User Patch Repo Result
2023/03/01 18:17 37m bisect fix linux-4.14.y OK (0) job log log
2023/01/29 01:06 24m bisect fix linux-4.14.y OK (0) job log log

Sample crash report:
UDF-fs: error (device loop0): udf_process_sequence: Block 100 of volume descriptor sequence is corrupted or we could not read it
UDF-fs: INFO Mounting volume 'LinuxUDF', timestamp 2022/11/22 14:59 (1000)
audit: type=1800 audit(1669322225.320:2): pid=7980 uid=0 auid=4294967295 ses=4294967295 op="collect_data" cause="failed(directio)" comm="syz-executor566" name=789CECDD4F6C1CD77D07F0DF1B922229B715133B8ADDC6C5A62D5299B15CFD8BA95885BBAA69B601649908C5DC02704552EAC214499054231B69C1F4D2430F018AA2879C08B44681140D8CA6087A645B17482E3E1439F544B4B011143DB045809C020633FB565C5294458BA444DA9F8F4D7D6767DF9B796F663C230B7AF302 dev="loop0" ino=1318 res=0
==================================================================
BUG: KASAN: slab-out-of-bounds in memcpy include/linux/string.h:376 [inline]
BUG: KASAN: slab-out-of-bounds in udf_find_entry+0x8fb/0xef0 fs/udf/namei.c:250
Write of size 165 at addr ffff8880b49b9cda by task syz-executor566/7980

CPU: 0 PID: 7980 Comm: syz-executor566 Not tainted 4.14.299-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
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+0x6f/0x80 mm/kasan/report.c:409
 memcpy+0x35/0x50 mm/kasan/kasan.c:303
 memcpy include/linux/string.h:376 [inline]
 udf_find_entry+0x8fb/0xef0 fs/udf/namei.c:250
 udf_lookup fs/udf/namei.c:321 [inline]
 udf_lookup+0x11b/0x210 fs/udf/namei.c:295
 lookup_open+0x5c4/0x1750 fs/namei.c:3220
 do_last fs/namei.c:3334 [inline]
 path_openat+0xe08/0x2970 fs/namei.c:3571
 do_filp_open+0x179/0x3c0 fs/namei.c:3605
 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+0x5e/0xd3

Allocated by task 7980:
 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]
 udf_find_entry+0x959/0xef0 fs/udf/namei.c:240
 udf_lookup fs/udf/namei.c:321 [inline]
 udf_lookup+0x11b/0x210 fs/udf/namei.c:295
 lookup_open+0x5c4/0x1750 fs/namei.c:3220
 do_last fs/namei.c:3334 [inline]
 path_openat+0xe08/0x2970 fs/namei.c:3571
 do_filp_open+0x179/0x3c0 fs/namei.c:3605
 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+0x5e/0xd3

Freed by task 6228:
 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
 seq_release+0x57/0x70 fs/seq_file.c:372
 kernfs_fop_release+0xdc/0x180 fs/kernfs/file.c:781
 __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+0x5e/0xd3

The buggy address belongs to the object at ffff8880b49b9c80
 which belongs to the cache kmalloc-256 of size 256
The buggy address is located 90 bytes inside of
 256-byte region [ffff8880b49b9c80, ffff8880b49b9d80)
The buggy address belongs to the page:
page:ffffea0002d26e40 count:1 mapcount:0 mapping:ffff8880b49b9000 index:0xffff8880b49b9a00
flags: 0xfff00000000100(slab)
raw: 00fff00000000100 ffff8880b49b9000 ffff8880b49b9a00 0000000100000007
raw: ffffea0002d83ee0 ffffea0002c23da0 ffff88813fe747c0 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8880b49b9c00: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
 ffff8880b49b9c80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff8880b49b9d00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 06
                                                                ^
 ffff8880b49b9d80: fc fc fc fc fc fc fc fc 00 00 00 00 00 00 00 00
 ffff8880b49b9e00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/11/24 20:38 linux-4.14.y e911713e40ca ff68ff8f .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-4-14 KASAN: slab-out-of-bounds Write in udf_find_entry
2022/11/24 14:45 linux-4.14.y e911713e40ca ff68ff8f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-4-14 KASAN: slab-out-of-bounds Write in udf_find_entry
* Struck through repros no longer work on HEAD.