syzbot


KASAN: slab-use-after-free Read in jfs_readdir

Status: upstream: reported C repro on 2025/12/05 07:21
Reported-by: syzbot+e87c4983f6a921e84439@syzkaller.appspotmail.com
First crash: 7d22h, last: 7d18h
Bug presence (1)
Date Name Commit Repro Result
2025/12/05 upstream (ToT) 2061f18ad76e C Failed due to an error; will retry later
Similar bugs (7)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: slab-out-of-bounds Read in jfs_readdir jfs 19 C error done 17 705d 1065d 25/29 fixed on 2024/03/20 11:33
upstream KASAN: slab-use-after-free Read in jfs_readdir jfs 19 C unreliable 211 4h35m 345d 0/29 upstream: reported C repro on 2025/01/02 02:02
upstream UBSAN: array-index-out-of-bounds in jfs_readdir jfs 19 C inconclusive 89 368d 620d 28/29 fixed on 2024/12/16 09:50
linux-5.15 UBSAN: array-index-out-of-bounds in jfs_readdir origin:upstream 19 C error 51 8d13h 621d 0/3 upstream: reported C repro on 2024/04/01 00:20
linux-6.1 UBSAN: array-index-out-of-bounds in jfs_readdir origin:upstream missing-backport 19 C inconclusive 59 76d 621d 0/3 upstream: reported C repro on 2024/04/01 00:16
linux-4.14 KASAN: slab-out-of-bounds Read in jfs_readdir jfs 17 1 1065d 1065d 0/1 upstream: reported on 2023/01/12 07:34
linux-4.19 KASAN: slab-out-of-bounds Read in jfs_readdir jfs 17 2 1065d 1065d 0/1 upstream: reported on 2023/01/12 07:27

Sample crash report:
syz.0.17[5941]: memfd_create() called without MFD_EXEC or MFD_NOEXEC_SEAL set
loop0: detected capacity change from 0 to 32768
==================================================================
BUG: KASAN: slab-use-after-free in jfs_readdir+0x1173/0x3a90 fs/jfs/jfs_dtree.c:2870
Read of size 8 at addr ffff88805fc0a410 by task syz.0.17/5941

CPU: 1 PID: 5941 Comm: syz.0.17 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/25/2025
Call Trace:
 <TASK>
 dump_stack_lvl+0x16c/0x230 lib/dump_stack.c:106
 print_address_description mm/kasan/report.c:364 [inline]
 print_report+0xac/0x220 mm/kasan/report.c:468
 kasan_report+0x117/0x150 mm/kasan/report.c:581
 jfs_readdir+0x1173/0x3a90 fs/jfs/jfs_dtree.c:2870
 wrap_directory_iterator+0x92/0xd0 fs/readdir.c:67
 iterate_dir+0x1c2/0x580 fs/readdir.c:106
 __do_sys_getdents64 fs/readdir.c:405 [inline]
 __se_sys_getdents64+0xe9/0x260 fs/readdir.c:390
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:81
 entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7f797b38f749
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffd19410558 EFLAGS: 00000246 ORIG_RAX: 00000000000000d9
RAX: ffffffffffffffda RBX: 00007f797b5e5fa0 RCX: 00007f797b38f749
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000005
RBP: 00007f797b413f91 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f797b5e5fa0 R14: 00007f797b5e5fa0 R15: 0000000000000003
 </TASK>

Allocated by task 5941:
 kasan_save_stack mm/kasan/common.c:45 [inline]
 kasan_set_track+0x4e/0x70 mm/kasan/common.c:52
 __kasan_slab_alloc+0x6c/0x80 mm/kasan/common.c:328
 kasan_slab_alloc include/linux/kasan.h:188 [inline]
 slab_post_alloc_hook+0x6e/0x4d0 mm/slab.h:767
 slab_alloc_node mm/slub.c:3495 [inline]
 slab_alloc mm/slub.c:3503 [inline]
 __kmem_cache_alloc_lru mm/slub.c:3510 [inline]
 kmem_cache_alloc+0x11e/0x2e0 mm/slub.c:3519
 mempool_alloc+0x1a1/0x4f0 mm/mempool.c:418
 alloc_metapage fs/jfs/jfs_metapage.c:176 [inline]
 __get_metapage+0x54c/0xfa0 fs/jfs/jfs_metapage.c:651
 dtSplitRoot+0x203/0x16b0 fs/jfs/jfs_dtree.c:1910
 dtSplitUp fs/jfs/jfs_dtree.c:993 [inline]
 dtInsert+0xeec/0x5f40 fs/jfs/jfs_dtree.c:871
 jfs_create+0x6a1/0xa40 fs/jfs/namei.c:137
 lookup_open fs/namei.c:3496 [inline]
 open_last_lookups fs/namei.c:3564 [inline]
 path_openat+0x1277/0x3190 fs/namei.c:3794
 do_filp_open+0x1c5/0x3d0 fs/namei.c:3824
 do_sys_openat2+0x12c/0x1c0 fs/open.c:1421
 do_sys_open fs/open.c:1436 [inline]
 __do_sys_openat fs/open.c:1452 [inline]
 __se_sys_openat fs/open.c:1447 [inline]
 __x64_sys_openat+0x139/0x160 fs/open.c:1447
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:81
 entry_SYSCALL_64_after_hwframe+0x68/0xd2

Freed by task 5941:
 kasan_save_stack mm/kasan/common.c:45 [inline]
 kasan_set_track+0x4e/0x70 mm/kasan/common.c:52
 kasan_save_free_info+0x2e/0x50 mm/kasan/generic.c:522
 ____kasan_slab_free+0x126/0x1e0 mm/kasan/common.c:236
 kasan_slab_free include/linux/kasan.h:164 [inline]
 slab_free_hook mm/slub.c:1811 [inline]
 slab_free_freelist_hook+0x130/0x1b0 mm/slub.c:1837
 slab_free mm/slub.c:3830 [inline]
 kmem_cache_free+0xf8/0x280 mm/slub.c:3852
 free_metapage fs/jfs/jfs_metapage.c:191 [inline]
 drop_metapage fs/jfs/jfs_metapage.c:228 [inline]
 release_metapage+0x6ed/0x870 fs/jfs/jfs_metapage.c:786
 dtReadNext fs/jfs/jfs_dtree.c:3190 [inline]
 jfs_readdir+0xeb2/0x3a90 fs/jfs/jfs_dtree.c:2863
 wrap_directory_iterator+0x92/0xd0 fs/readdir.c:67
 iterate_dir+0x1c2/0x580 fs/readdir.c:106
 __do_sys_getdents64 fs/readdir.c:405 [inline]
 __se_sys_getdents64+0xe9/0x260 fs/readdir.c:390
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:81
 entry_SYSCALL_64_after_hwframe+0x68/0xd2

The buggy address belongs to the object at ffff88805fc0a3e0
 which belongs to the cache jfs_mp of size 184
The buggy address is located 48 bytes inside of
 freed 184-byte region [ffff88805fc0a3e0, ffff88805fc0a498)

The buggy address belongs to the physical page:
page:ffffea00017f0280 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x5fc0a
flags: 0xfff00000000800(slab|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000000800 ffff8881436c08c0 dead000000000122 0000000000000000
raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 0, migratetype Unmovable, gfp_mask 0x192800(GFP_NOWAIT|__GFP_NOWARN|__GFP_NORETRY|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 5941, tgid 5941 (syz.0.17), ts 81485437638, free_ts 81130040304
 set_page_owner include/linux/page_owner.h:31 [inline]
 post_alloc_hook+0x1cd/0x210 mm/page_alloc.c:1554
 prep_new_page mm/page_alloc.c:1561 [inline]
 get_page_from_freelist+0x195c/0x19f0 mm/page_alloc.c:3191
 __alloc_pages+0x1e3/0x460 mm/page_alloc.c:4457
 alloc_slab_page+0x5d/0x170 mm/slub.c:1881
 allocate_slab mm/slub.c:2028 [inline]
 new_slab+0x87/0x2e0 mm/slub.c:2081
 ___slab_alloc+0xc6d/0x1300 mm/slub.c:3253
 __slab_alloc mm/slub.c:3339 [inline]
 __slab_alloc_node mm/slub.c:3392 [inline]
 slab_alloc_node mm/slub.c:3485 [inline]
 slab_alloc mm/slub.c:3503 [inline]
 __kmem_cache_alloc_lru mm/slub.c:3510 [inline]
 kmem_cache_alloc+0x1b7/0x2e0 mm/slub.c:3519
 mempool_alloc+0x1a1/0x4f0 mm/mempool.c:418
 alloc_metapage fs/jfs/jfs_metapage.c:176 [inline]
 __get_metapage+0x54c/0xfa0 fs/jfs/jfs_metapage.c:651
 diIAGRead fs/jfs/jfs_imap.c:2672 [inline]
 diRead+0x1f7/0xb90 fs/jfs/jfs_imap.c:316
 jfs_iget+0x90/0x440 fs/jfs/inode.c:35
 jfs_fill_super+0x70c/0xac0 fs/jfs/super.c:580
 mount_bdev+0x22b/0x2d0 fs/super.c:1643
 legacy_get_tree+0xea/0x180 fs/fs_context.c:662
 vfs_get_tree+0x8c/0x280 fs/super.c:1764
 do_new_mount+0x24b/0xa40 fs/namespace.c:3386
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:24 [inline]
 free_pages_prepare mm/page_alloc.c:1154 [inline]
 free_unref_page_prepare+0x7ce/0x8e0 mm/page_alloc.c:2336
 free_unref_page+0x32/0x2e0 mm/page_alloc.c:2429
 vfree+0x1a6/0x320 mm/vmalloc.c:2868
 delayed_vfree_work+0x55/0x80 mm/vmalloc.c:2788
 process_one_work kernel/workqueue.c:2634 [inline]
 process_scheduled_works+0xa45/0x15b0 kernel/workqueue.c:2711
 worker_thread+0xa55/0xfc0 kernel/workqueue.c:2792
 kthread+0x2fa/0x390 kernel/kthread.c:388
 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:152
 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:293

Memory state around the buggy address:
 ffff88805fc0a300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff88805fc0a380: 00 00 00 00 fc fc fc fc fc fc fc fc fa fb fb fb
>ffff88805fc0a400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                         ^
 ffff88805fc0a480: fb fb fb fc fc fc fc fc fc fc fc 00 00 00 00 00
 ffff88805fc0a500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================

Crashes (5):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/12/05 10:32 linux-6.6.y 4791134e4aeb d6526ea3 .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro (corrupt fs)] ci2-linux-6-6-kasan KASAN: slab-use-after-free Read in jfs_readdir
2025/12/05 09:48 linux-6.6.y 4791134e4aeb d6526ea3 .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro (corrupt fs)] ci2-linux-6-6-kasan KASAN: slab-use-after-free Read in jfs_readdir
2025/12/05 09:05 linux-6.6.y 4791134e4aeb d6526ea3 .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro (corrupt fs)] ci2-linux-6-6-kasan KASAN: slab-use-after-free Read in jfs_readdir
2025/12/05 08:20 linux-6.6.y 4791134e4aeb d6526ea3 .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro (corrupt fs)] ci2-linux-6-6-kasan KASAN: slab-use-after-free Read in jfs_readdir
2025/12/05 07:21 linux-6.6.y 4791134e4aeb d6526ea3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan KASAN: slab-use-after-free Read in jfs_readdir
* Struck through repros no longer work on HEAD.