syzbot


KASAN: use-after-free Read in ocfs2_search_dirblock

Status: upstream: reported C repro on 2025/01/21 15:12
Bug presence: origin:lts-only
[Documentation on labels]
Reported-by: syzbot+431bbdbca98058b47a18@syzkaller.appspotmail.com
First crash: 14d, last: 14d
Bug presence (2)
Date Name Commit Repro Result
2025/01/21 linux-6.1.y (ToT) f4f677285b38 C [report] KASAN: use-after-free Read in ocfs2_search_dirblock
2025/01/21 upstream (ToT) 9f3ee94e705a C Didn't crash
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-5.15 KASAN: use-after-free Read in ocfs2_search_dirblock C 5 14h58m 17h28m 0/3 upstream: reported C repro on 2025/02/04 10:38
upstream KASAN: use-after-free Read in ocfs2_search_dirblock ocfs2 C inconclusive 14 26d 172d 1/28 upstream: reported C repro on 2024/08/16 09:49

Sample crash report:
loop0: detected capacity change from 0 to 32768
ocfs2: Mounting device (7,0) on (node local, slot 0) with writeback data mode.
==================================================================
BUG: KASAN: use-after-free in ocfs2_match fs/ocfs2/dir.c:334 [inline]
BUG: KASAN: use-after-free in ocfs2_search_dirblock+0x22c/0x840 fs/ocfs2/dir.c:367
Read of size 1 at addr ffff0000e52338cb by task syz-executor169/4305

CPU: 0 PID: 4305 Comm: syz-executor169 Not tainted 6.1.126-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
Call trace:
 dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158
 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106
 print_address_description mm/kasan/report.c:316 [inline]
 print_report+0x174/0x4c0 mm/kasan/report.c:427
 kasan_report+0xd4/0x130 mm/kasan/report.c:531
 __asan_report_load1_noabort+0x2c/0x38 mm/kasan/report_generic.c:348
 ocfs2_match fs/ocfs2/dir.c:334 [inline]
 ocfs2_search_dirblock+0x22c/0x840 fs/ocfs2/dir.c:367
 ocfs2_find_entry_id fs/ocfs2/dir.c:414 [inline]
 ocfs2_find_entry+0xf34/0x2620 fs/ocfs2/dir.c:1078
 ocfs2_find_files_on_disk+0x130/0x468 fs/ocfs2/dir.c:1982
 ocfs2_lookup_ino_from_name+0xb8/0x1d4 fs/ocfs2/dir.c:2004
 ocfs2_lookup+0x28c/0xc0c fs/ocfs2/namei.c:122
 lookup_open fs/namei.c:3460 [inline]
 open_last_lookups fs/namei.c:3550 [inline]
 path_openat+0xd3c/0x2548 fs/namei.c:3780
 do_filp_open+0x1bc/0x3cc fs/namei.c:3810
 do_sys_openat2+0x128/0x3e0 fs/open.c:1318
 do_sys_open fs/open.c:1334 [inline]
 __do_sys_openat fs/open.c:1350 [inline]
 __se_sys_openat fs/open.c:1345 [inline]
 __arm64_sys_openat+0x1f0/0x240 fs/open.c:1345
 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
 invoke_syscall+0x98/0x2bc arch/arm64/kernel/syscall.c:52
 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140
 do_el0_svc+0x58/0x13c arch/arm64/kernel/syscall.c:204
 el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637
 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585

The buggy address belongs to the physical page:
page:00000000983fb47e refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x125233
flags: 0x5ffc00000000000(node=0|zone=2|lastcpupid=0x7ff)
raw: 05ffc00000000000 fffffc0003948d08 fffffc0003948c88 0000000000000000
raw: 0000000000000001 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff0000e5233780: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff0000e5233800: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff0000e5233880: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                                              ^
 ffff0000e5233900: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff0000e5233980: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/01/21 16:07 linux-6.1.y f4f677285b38 6e87cfa2 .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in ocfs2_search_dirblock
2025/01/21 15:11 linux-6.1.y f4f677285b38 6e87cfa2 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in ocfs2_search_dirblock
* Struck through repros no longer work on HEAD.