syzbot


KASAN: use-after-free Read in leaf_paste_entries (2)

Status: upstream: reported C repro on 2025/11/10 10:16
Bug presence: origin:lts-only
[Documentation on labels]
Reported-by: syzbot+9145cb498df875fd6176@syzkaller.appspotmail.com
First crash: 14d, last: 13d
Bug presence (2)
Date Name Commit Repro Result
2025/11/11 linux-6.6.y (ToT) 0a805b6ea8cd C [report] KASAN: use-after-free Read in leaf_paste_entries
2025/11/11 upstream (ToT) 4427259cc7f7 C Didn't crash
Similar bugs (9)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.19 KASAN: out-of-bounds Read in leaf_paste_entries reiserfs 19 C error 73 997d 1836d 0/1 upstream: reported C repro on 2020/11/14 23:23
linux-5.15 KASAN: out-of-bounds Read in leaf_paste_entries missing-backport origin:upstream 19 C done 133 10d 987d 0/3 upstream: reported C repro on 2023/03/13 09:08
linux-4.14 KASAN: use-after-free Read in leaf_paste_entries 19 C done 6 1795d 1838d 1/1 fixed on 2021/01/26 16:42
linux-6.1 KASAN: out-of-bounds Read in leaf_paste_entries origin:upstream missing-backport 19 C done 113 9d21h 983d 0/3 upstream: reported C repro on 2023/03/18 05:48
linux-4.19 KASAN: use-after-free Read in leaf_paste_entries 19 C done 1 1801d 1801d 1/1 fixed on 2021/01/19 18:33
upstream KASAN: out-of-bounds Read in leaf_paste_entries (2) fs 19 C inconclusive inconclusive 327 668d 1442d 0/29 auto-obsoleted due to no activity on 2024/04/06 02:37
linux-4.14 KASAN: out-of-bounds Read in leaf_paste_entries reiserfs 19 C error 13 1065d 1876d 0/1 upstream: reported C repro on 2020/10/05 14:11
linux-6.6 KASAN: use-after-free Read in leaf_paste_entries 19 1 142d 142d 0/2 auto-obsoleted due to no activity on 2025/10/13 10:20
upstream KASAN: out-of-bounds Read in leaf_paste_entries fs 17 C inconclusive 8 1508d 1739d 20/29 fixed on 2021/11/10 00:50

Sample crash report:
REISERFS (device loop0): journal params: device loop0, size 512, journal first block 18, max trans len 256, max batch 225, max commit age 30, max trans age 30
REISERFS (device loop0): checking transaction log (loop0)
REISERFS (device loop0): Using tea hash to sort names
REISERFS (device loop0): Created .reiserfs_priv - reserved for xattr storage.
==================================================================
BUG: KASAN: use-after-free in leaf_paste_entries+0xe78/0x1110 fs/reiserfs/lbalance.c:1351
Read of size 2 at addr ffff88805da9bf08 by task syz.0.17/5945

CPU: 0 PID: 5945 Comm: syz.0.17 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/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
 leaf_paste_entries+0xe78/0x1110 fs/reiserfs/lbalance.c:1351
 leaf_copy_dir_entries+0x699/0x990 fs/reiserfs/lbalance.c:119
 leaf_copy_boundary_item+0xb90/0x2180 fs/reiserfs/lbalance.c:168
 leaf_copy_items fs/reiserfs/lbalance.c:551 [inline]
 leaf_move_items+0x8b5/0xe90 fs/reiserfs/lbalance.c:726
 leaf_shift_left+0xbd/0x450 fs/reiserfs/lbalance.c:750
 balance_leaf_when_delete_left fs/reiserfs/do_balan.c:194 [inline]
 balance_leaf_when_delete fs/reiserfs/do_balan.c:272 [inline]
 balance_leaf+0x1dc1/0x10da0 fs/reiserfs/do_balan.c:1393
 do_balance+0x2fe/0x940 fs/reiserfs/do_balan.c:1888
 reiserfs_cut_from_item+0x13b2/0x1f10 fs/reiserfs/stree.c:1836
 reiserfs_do_truncate+0xa3d/0x1340 fs/reiserfs/stree.c:1971
 reiserfs_truncate_file+0x37a/0x7c0 fs/reiserfs/inode.c:2306
 reiserfs_setattr+0xc0c/0x11a0 fs/reiserfs/inode.c:3392
 notify_change+0xb0d/0xe10 fs/attr.c:499
 do_truncate+0x19b/0x220 fs/open.c:66
 handle_truncate fs/namei.c:3299 [inline]
 do_open fs/namei.c:3644 [inline]
 path_openat+0x298c/0x3190 fs/namei.c:3797
 do_filp_open+0x1c5/0x3d0 fs/namei.c:3824
 do_sys_openat2+0x12c/0x1c0 fs/open.c:1419
 do_sys_open fs/open.c:1434 [inline]
 __do_sys_openat fs/open.c:1450 [inline]
 __se_sys_openat fs/open.c:1445 [inline]
 __x64_sys_openat+0x139/0x160 fs/open.c:1445
 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:0x7f4f8cb8f6c9
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:00007ffe953a3f38 EFLAGS: 00000246 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 00007f4f8cde5fa0 RCX: 00007f4f8cb8f6c9
RDX: 000000000000275a RSI: 0000200000000000 RDI: ffffffffffffff9c
RBP: 00007f4f8cc11f91 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f4f8cde5fa0 R14: 00007f4f8cde5fa0 R15: 0000000000000004
 </TASK>

The buggy address belongs to the physical page:
page:ffffea000176a6c0 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x5da9b
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000000000 dead000000000100 dead000000000122 0000000000000000
raw: 0000000000000001 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as freed
page last allocated via order 0, migratetype Movable, gfp_mask 0x8(__GFP_MOVABLE), pid 1, tgid 1 (swapper/0), ts 16646416727, free_ts 17763854916
 set_page_owner include/linux/page_owner.h:31 [inline]
 post_alloc_hook+0x1cd/0x210 mm/page_alloc.c:1554
 split_map_pages+0x27b/0x4d0 mm/compaction.c:97
 isolate_freepages_range+0x3e0/0x430 mm/compaction.c:775
 alloc_contig_range+0x5b2/0x860 mm/page_alloc.c:6244
 __alloc_contig_pages mm/page_alloc.c:6267 [inline]
 alloc_contig_pages+0x47c/0x580 mm/page_alloc.c:6347
 debug_vm_pgtable_alloc_huge_page+0xbf/0x110 mm/debug_vm_pgtable.c:1087
 init_args+0x724/0x9b0 mm/debug_vm_pgtable.c:1269
 debug_vm_pgtable+0xc1/0x410 mm/debug_vm_pgtable.c:1307
 do_one_initcall+0x1fd/0x750 init/main.c:1250
 do_initcall_level+0x137/0x1f0 init/main.c:1312
 do_initcalls+0x69/0xd0 init/main.c:1328
 kernel_init_freeable+0x3d2/0x570 init/main.c:1565
 kernel_init+0x1d/0x1c0 init/main.c:1455
 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:152
 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:293
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
 free_contig_range+0xa1/0x160 mm/page_alloc.c:6369
 destroy_args+0x80/0x850 mm/debug_vm_pgtable.c:1015
 debug_vm_pgtable+0x3cc/0x410 mm/debug_vm_pgtable.c:1400
 do_one_initcall+0x1fd/0x750 init/main.c:1250
 do_initcall_level+0x137/0x1f0 init/main.c:1312
 do_initcalls+0x69/0xd0 init/main.c:1328
 kernel_init_freeable+0x3d2/0x570 init/main.c:1565
 kernel_init+0x1d/0x1c0 init/main.c:1455
 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:
 ffff88805da9be00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff88805da9be80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff88805da9bf00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                      ^
 ffff88805da9bf80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff88805da9c000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/11/10 11:51 linux-6.6.y 0a805b6ea8cd 4e1406b4 .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro (corrupt fs)] ci2-linux-6-6-kasan KASAN: use-after-free Read in leaf_paste_entries
2025/11/10 11:04 linux-6.6.y 0a805b6ea8cd 4e1406b4 .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro (corrupt fs)] ci2-linux-6-6-kasan KASAN: slab-out-of-bounds Read in leaf_paste_entries
2025/11/10 10:15 linux-6.6.y 0a805b6ea8cd 4e1406b4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan KASAN: use-after-free Read in leaf_paste_entries
* Struck through repros no longer work on HEAD.