syzbot


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

Status: upstream: reported C repro on 2022/02/01 19:02
Reported-by: syzbot+96e7e0249bb80cc7065b@syzkaller.appspotmail.com
First crash: 1045d, last: 735d
Fix bisection: failed (error log, bisect log)
  
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: slab-out-of-bounds Write in udf_find_entry udf C error 19 763d 795d 22/28 fixed on 2023/06/12 19:24
linux-4.14 KASAN: slab-out-of-bounds Write in udf_find_entry C 2 652d 749d 0/1 upstream: reported C repro on 2022/11/24 14:45

Sample crash report:
UDF-fs: INFO Mounting volume 'LinuxUDF', timestamp 2022/11/22 14:59 (1000)
audit: type=1800 audit(1669398228.037:2): pid=8128 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=collect_data cause=failed(directio) comm="syz-executor590" name=789CECDD4F6C1CD77D07F0DF1B922229B715133B8ADDC6C5A62D5299B15CFD8BA95885BBAA69B601649908C5DC02704552EAC214499054231B69C1F4D2430F018AA2879C08B44681140D8CA6087A645B17482E3E1439F544B4B011143DB045809C020633FB565C5294458BA444DA9F8F4D7D6767DF9B796F663C230B7AF302 dev="loop0" ino=1318 res=0
==================================================================
BUG: KASAN: slab-out-of-bounds in memcpy include/linux/string.h:377 [inline]
BUG: KASAN: slab-out-of-bounds in udf_find_entry+0xa33/0x1070 fs/udf/namei.c:251
Write of size 165 at addr ffff8880abf84bda by task syz-executor590/8128

CPU: 1 PID: 8128 Comm: syz-executor590 Not tainted 4.19.211-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
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+0x8f/0xa0 mm/kasan/report.c:412
 memcpy+0x35/0x50 mm/kasan/kasan.c:303
 memcpy include/linux/string.h:377 [inline]
 udf_find_entry+0xa33/0x1070 fs/udf/namei.c:251
 udf_lookup fs/udf/namei.c:322 [inline]
 udf_lookup+0x156/0x270 fs/udf/namei.c:296
 lookup_open+0x698/0x1a20 fs/namei.c:3214
 do_last fs/namei.c:3327 [inline]
 path_openat+0x1094/0x2df0 fs/namei.c:3537
 do_filp_open+0x18c/0x3f0 fs/namei.c:3567
 do_sys_open+0x3b3/0x520 fs/open.c:1085
 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x7f142f503639
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 51 14 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 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffcdfef57c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000055
RAX: ffffffffffffffda RBX: 00007ffcdfef57d8 RCX: 00007f142f503639
RDX: 00007f142f503639 RSI: 0000000000000000 RDI: 0000000020000000
RBP: 00007ffcdfef57d0 R08: 00007ffcdfef57d0 R09: 00007f142f4c0960
R10: 00007ffcdfef57d0 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000

Allocated by task 8128:
 kmem_cache_alloc_trace+0x12f/0x380 mm/slab.c:3625
 kmalloc include/linux/slab.h:515 [inline]
 udf_find_entry+0xa82/0x1070 fs/udf/namei.c:241
 udf_lookup fs/udf/namei.c:322 [inline]
 udf_lookup+0x156/0x270 fs/udf/namei.c:296
 lookup_open+0x698/0x1a20 fs/namei.c:3214
 do_last fs/namei.c:3327 [inline]
 path_openat+0x1094/0x2df0 fs/namei.c:3537
 do_filp_open+0x18c/0x3f0 fs/namei.c:3567
 do_sys_open+0x3b3/0x520 fs/open.c:1085
 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 6416:
 __cache_free mm/slab.c:3503 [inline]
 kfree+0xcc/0x210 mm/slab.c:3822
 __do_execve_file+0x187a/0x2360 fs/exec.c:1862
 do_execveat_common fs/exec.c:1879 [inline]
 do_execve+0x35/0x50 fs/exec.c:1896
 call_usermodehelper_exec_async+0x50e/0x6a0 kernel/umh.c:116
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415

The buggy address belongs to the object at ffff8880abf84b80
 which belongs to the cache kmalloc-256 of size 256
The buggy address is located 90 bytes inside of
 256-byte region [ffff8880abf84b80, ffff8880abf84c80)
The buggy address belongs to the page:
page:ffffea0002afe100 count:1 mapcount:0 mapping:ffff88813bff07c0 index:0xffff8880abf84cc0
flags: 0xfff00000000100(slab)
raw: 00fff00000000100 ffffea0002adaf48 ffffea0002ac0308 ffff88813bff07c0
raw: ffff8880abf84cc0 ffff8880abf84040 0000000100000003 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8880abf84b00: 00 00 00 00 00 00 00 06 fc fc fc fc fc fc fc fc
 ffff8880abf84b80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff8880abf84c00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 06
                                                                ^
 ffff8880abf84c80: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb
 ffff8880abf84d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (10):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/11/25 17:45 linux-4.19.y 3f8a27f9e27b 74a66371 .config console log report syz C [disk image] [vmlinux] [mounted in repro] ci2-linux-4-19 KASAN: slab-out-of-bounds Write in udf_find_entry
2022/10/30 13:12 linux-4.19.y 3f8a27f9e27b 2a71366b .config console log report syz C [disk image] [vmlinux] [mounted in repro] ci2-linux-4-19 KASAN: slab-out-of-bounds Write in udf_find_entry
2022/10/16 13:38 linux-4.19.y 3f8a27f9e27b 67cb024c .config console log report syz C [disk image] [vmlinux] [mounted in repro] ci2-linux-4-19 KASAN: slab-out-of-bounds Write in udf_find_entry
2022/10/09 18:20 linux-4.19.y 3f8a27f9e27b aea5da89 .config console log report syz C [disk image] [vmlinux] [mounted in repro #1] [mounted in repro #2] ci2-linux-4-19 KASAN: slab-out-of-bounds Write in udf_find_entry
2022/02/01 19:34 linux-4.19.y 3f8a27f9e27b c1c1631d .config console log report syz C ci2-linux-4-19 KASAN: slab-out-of-bounds Write in udf_find_entry
2022/12/09 05:52 linux-4.19.y 3f8a27f9e27b 1034e5fa .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: slab-out-of-bounds Write in udf_find_entry
2022/12/08 14:20 linux-4.19.y 3f8a27f9e27b d88f3abb .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: slab-out-of-bounds Write in udf_find_entry
2022/12/02 09:03 linux-4.19.y 3f8a27f9e27b e080de16 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: slab-out-of-bounds Write in udf_find_entry
2022/11/13 15:42 linux-4.19.y 3f8a27f9e27b f42ee5d8 .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: slab-out-of-bounds Write in udf_find_entry
2022/02/01 19:01 linux-4.19.y 3f8a27f9e27b c1c1631d .config console log report info ci2-linux-4-19 KASAN: slab-out-of-bounds Write in udf_find_entry
* Struck through repros no longer work on HEAD.