syzbot has found a reproducer for the following issue on:
HEAD commit: 02b72ccb5f9d Linux 6.1.138
git tree: linux-6.1.y
console output:
https://syzkaller.appspot.com/x/log.txt?x=173692f4580000
kernel config:
https://syzkaller.appspot.com/x/.config?x=40498c8aeab367b8
dashboard link:
https://syzkaller.appspot.com/bug?extid=a0acccd8e6068831fd3b
compiler: Debian clang version 20.1.2 (++20250402124445+58df0ef89dd6-1~exp1~20250402004600.97), Debian LLD 20.1.2
syz repro:
https://syzkaller.appspot.com/x/repro.syz?x=14ed4cd4580000
C reproducer:
https://syzkaller.appspot.com/x/repro.c?x=12fb7768580000
Downloadable assets:
disk image:
https://storage.googleapis.com/syzbot-assets/741917d96f57/disk-02b72ccb.raw.xz
vmlinux:
https://storage.googleapis.com/syzbot-assets/b5e0c69249ae/vmlinux-02b72ccb.xz
kernel image:
https://storage.googleapis.com/syzbot-assets/06bfb546fb37/bzImage-02b72ccb.xz
mounted in repro:
https://storage.googleapis.com/syzbot-assets/2494aee1e1e2/mount_0.gz
fsck result: failed (log:
https://syzkaller.appspot.com/x/fsck.log?x=10ed4cd4580000)
BUG: KASAN: use-after-free in dtMoveEntry fs/jfs/jfs_dtree.c:3922 [inline]
BUG: KASAN: use-after-free in dtSplitPage+0x1aba/0x31d0 fs/jfs/jfs_dtree.c:1561
Write of size 1 at addr ffff88807a274000 by task syz-executor170/4259
CPU: 1 PID: 4259 Comm: syz-executor170 Not tainted 6.1.138-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/19/2025
Call Trace:
<TASK>
dump_stack_lvl+0x168/0x22e lib/dump_stack.c:106
print_address_description mm/kasan/report.c:316 [inline]
print_report+0xa8/0x220 mm/kasan/report.c:427
kasan_report+0x10b/0x140 mm/kasan/report.c:531
dtMoveEntry fs/jfs/jfs_dtree.c:3922 [inline]
dtSplitPage+0x1aba/0x31d0 fs/jfs/jfs_dtree.c:1561
dtSplitUp fs/jfs/jfs_dtree.c:1092 [inline]
dtInsert+0xfbd/0x58a0 fs/jfs/jfs_dtree.c:871
jfs_create+0x69d/0xa50 fs/jfs/namei.c:137
lookup_open fs/namei.c:3482 [inline]
open_last_lookups fs/namei.c:3550 [inline]
path_openat+0x1187/0x2e70 fs/namei.c:3780
do_filp_open+0x1c1/0x3c0 fs/namei.c:3810
do_sys_openat2+0x142/0x490 fs/open.c:1318
do_sys_open fs/open.c:1334 [inline]
__do_sys_creat fs/open.c:1412 [inline]
__se_sys_creat fs/open.c:1406 [inline]
__x64_sys_creat+0x8c/0xb0 fs/open.c:1406
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7f95a28a9929
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 71 1d 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 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f95a203b218 EFLAGS: 00000246 ORIG_RAX: 0000000000000055
RAX: ffffffffffffffda RBX: 00007f95a2930638 RCX: 00007f95a28a9929
RDX: 00007f95a28a9929 RSI: 0000000000000000 RDI: 00002000000006c0
RBP: 00007f95a2930630 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f95a28fc45c
R13: 0000200000000080 R14: 00002000000008c0 R15: 00002000000006c0
</TASK>
The buggy address belongs to the physical page:
page:ffffea0001e89d00 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7a274
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000000 ffffea00009dd088 ffffea0001e89d88 0000000000000000
raw: 0000000000000000 0000000000100000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as freed
page last allocated via order 1, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 3962, tgid 3962 (dhcpcd-run-hook), ts 57205764727, free_ts 86539493011
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x173/0x1a0 mm/page_alloc.c:2532
prep_new_page mm/page_alloc.c:2539 [inline]
get_page_from_freelist+0x1a26/0x1ac0 mm/page_alloc.c:4328
__alloc_pages+0x1df/0x4e0 mm/page_alloc.c:5606
alloc_slab_page+0x5d/0x160 mm/slub.c:1794
allocate_slab mm/slub.c:1939 [inline]
new_slab+0x87/0x2c0 mm/slub.c:1992
___slab_alloc+0xbc6/0x1220 mm/slub.c:3180
kmem_cache_alloc_bulk+0x1a3/0x4e0 mm/slub.c:3830
mt_alloc_bulk lib/maple_tree.c:157 [inline]
mas_alloc_nodes+0x449/0x890 lib/maple_tree.c:1299
mas_node_count_gfp lib/maple_tree.c:1359 [inline]
mas_preallocate+0x11e/0x340 lib/maple_tree.c:5805
__vma_adjust+0x2e2/0x1bd0 mm/mmap.c:723
vma_adjust include/linux/mm.h:2742 [inline]
__split_vma+0x3a7/0x500 mm/mmap.c:-1
do_mas_align_munmap+0x351/0x1220 mm/mmap.c:2468
do_mas_munmap+0x240/0x2b0 mm/mmap.c:2638
__mmap_region mm/mmap.c:2686 [inline]
mmap_region+0x713/0x1d30 mm/mmap.c:2904
do_mmap+0x894/0xf30 mm/mmap.c:1424
vm_mmap_pgoff+0x1b2/0x2b0 mm/util.c:520
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1459 [inline]
free_pcp_prepare mm/page_alloc.c:1509 [inline]
free_unref_page_prepare+0x8b4/0x9a0 mm/page_alloc.c:3384
free_unref_page+0x2e/0x3f0 mm/page_alloc.c:3479
qlink_free mm/kasan/quarantine.c:168 [inline]
qlist_free_all+0x76/0xe0 mm/kasan/quarantine.c:187
kasan_quarantine_reduce+0x144/0x160 mm/kasan/quarantine.c:294
__kasan_slab_alloc+0x1e/0x80 mm/kasan/common.c:305
kasan_slab_alloc include/linux/kasan.h:201 [inline]
slab_post_alloc_hook+0x4b/0x480 mm/slab.h:737
slab_alloc_node mm/slub.c:3398 [inline]
__kmem_cache_alloc_node+0x140/0x260 mm/slub.c:3437
kmalloc_node_trace+0x22/0xe0 mm/slab_common.c:1039
kmalloc_node include/linux/slab.h:585 [inline]
kzalloc_node include/linux/slab.h:710 [inline]
alloc_worker kernel/workqueue.c:1843 [inline]
create_worker+0x10f/0x630 kernel/workqueue.c:1940
maybe_create_worker kernel/workqueue.c:2110 [inline]
manage_workers kernel/workqueue.c:2162 [inline]
worker_thread+0x4de/0x1250 kernel/workqueue.c:2411
kthread+0x29d/0x330 kernel/kthread.c:376
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295
Memory state around the buggy address:
ffff88807a273f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff88807a273f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff88807a274000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff88807a274080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff88807a274100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff