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: 255d, last: 19d
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 1238d 2077d 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 162 10d 1228d 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 2035d 2079d 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 151 8d17h 1223d 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 2042d 2042d 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 908d 1683d 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 1305d 2117d 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 383d 383d 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 1748d 1979d 20/29 fixed on 2021/11/10 00:50
Fix bisection attempts (4)
Created Duration User Patch Repo Result
2026/05/13 13:06 16m fix candidate upstream error job log
2026/03/27 17:04 1m fix candidate upstream error job log
2026/02/24 06:09 1m fix candidate upstream error job log
2026/01/24 20:37 1m fix candidate upstream error job log

Sample crash report:
REISERFS (device loop2): Using tea hash to sort names
REISERFS (device loop2): Created .reiserfs_priv - reserved for xattr storage.
==================================================================
BUG: KASAN: use-after-free in leaf_paste_entries+0x532/0x11e0 fs/reiserfs/lbalance.c:1363
Read of size 2 at addr ffff888059e4c008 by task syz.2.32/6027

CPU: 0 PID: 6027 Comm: syz.2.32 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/09/2026
Call Trace:
 <TASK>
 dump_stack_lvl+0x18c/0x250 lib/dump_stack.c:106
 print_address_description mm/kasan/report.c:364 [inline]
 print_report+0xa8/0x210 mm/kasan/report.c:468
 kasan_report+0x117/0x150 mm/kasan/report.c:581
 leaf_paste_entries+0x532/0x11e0 fs/reiserfs/lbalance.c:1363
 leaf_copy_dir_entries+0x6d5/0xa10 fs/reiserfs/lbalance.c:119
 leaf_copy_boundary_item+0xba4/0x21f0 fs/reiserfs/lbalance.c:168
 leaf_copy_items fs/reiserfs/lbalance.c:551 [inline]
 leaf_move_items+0x8cc/0xec0 fs/reiserfs/lbalance.c:726
 leaf_shift_left+0xb5/0x3f0 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+0x1373/0x10e10 fs/reiserfs/do_balan.c:1393
 do_balance+0x31c/0x930 fs/reiserfs/do_balan.c:1888
 reiserfs_cut_from_item+0x1490/0x2020 fs/reiserfs/stree.c:1836
 reiserfs_do_truncate+0x994/0x1270 fs/reiserfs/stree.c:1971
 reiserfs_truncate_file+0x48a/0x7f0 fs/reiserfs/inode.c:2306
 reiserfs_setattr+0xbff/0x1230 fs/reiserfs/inode.c:3392
 notify_change+0xb05/0xde0 fs/attr.c:499
 do_truncate+0x1b0/0x240 fs/open.c:66
 handle_truncate fs/namei.c:3299 [inline]
 do_open fs/namei.c:3644 [inline]
 path_openat+0x2a7e/0x3270 fs/namei.c:3797
 do_filp_open+0x1f2/0x430 fs/namei.c:3824
 do_sys_openat2+0x134/0x1d0 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:46 [inline]
 do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76
 entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7fd06659de59
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 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 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fd0673b8028 EFLAGS: 00000246 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 00007fd066825fa0 RCX: 00007fd06659de59
RDX: 000000000000275a RSI: 0000200000000040 RDI: ffffffffffffff9c
RBP: 00007fd066633e6f R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fd066826038 R14: 00007fd066825fa0 R15: 00007ffecaae6018
 </TASK>

The buggy address belongs to the physical page:
page:ffffea0001679300 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x59e4c
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000000000 ffffea00016b7748 ffffea00016529c8 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 0x148c48(GFP_NOFS|__GFP_NOFAIL|__GFP_COMP|__GFP_HARDWALL|__GFP_MOVABLE), pid 6016, tgid 6015 (syz.3.29), ts 101334639965, free_ts 101990080837
 set_page_owner include/linux/page_owner.h:31 [inline]
 post_alloc_hook+0x1c1/0x200 mm/page_alloc.c:1582
 prep_new_page mm/page_alloc.c:1589 [inline]
 get_page_from_freelist+0x2181/0x22a0 mm/page_alloc.c:3221
 __alloc_pages+0x1f0/0x460 mm/page_alloc.c:4501
 folio_alloc+0x1e/0x30 mm/mempolicy.c:2289
 filemap_alloc_folio+0xdf/0x490 mm/filemap.c:1004
 __filemap_get_folio+0x3fb/0xbe0 mm/filemap.c:1962
 grow_dev_page fs/buffer.c:1058 [inline]
 grow_buffers fs/buffer.c:1118 [inline]
 __getblk_slow fs/buffer.c:1145 [inline]
 __getblk_gfp+0x212/0x620 fs/buffer.c:1439
 __getblk include/linux/buffer_head.h:399 [inline]
 reiserfs_breada fs/reiserfs/journal.c:2338 [inline]
 journal_read+0x84c/0x3ac0 fs/reiserfs/journal.c:2451
 journal_init+0x193f/0x2350 fs/reiserfs/journal.c:2904
 reiserfs_fill_super+0xdf4/0x20e0 fs/reiserfs/super.c:2022
 mount_bdev+0x21c/0x2c0 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+0x24a/0xa40 fs/namespace.c:3386
 do_mount fs/namespace.c:3726 [inline]
 __do_sys_mount fs/namespace.c:3935 [inline]
 __se_sys_mount+0x2e7/0x3d0 fs/namespace.c:3912
 do_syscall_x64 arch/x86/entry/common.c:46 [inline]
 do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:24 [inline]
 free_pages_prepare mm/page_alloc.c:1182 [inline]
 free_unref_page_prepare+0x7d7/0x8f0 mm/page_alloc.c:2366
 free_unref_page_list+0xbe/0x860 mm/page_alloc.c:2505
 release_pages+0x208a/0x2300 mm/swap.c:1022
 __folio_batch_release+0x71/0xe0 mm/swap.c:1042
 folio_batch_release include/linux/pagevec.h:83 [inline]
 truncate_inode_pages_range+0x381/0xea0 mm/truncate.c:396
 kill_bdev block/bdev.c:76 [inline]
 blkdev_flush_mapping+0x132/0x290 block/bdev.c:649
 blkdev_put_whole block/bdev.c:680 [inline]
 blkdev_put+0x49a/0x7a0 block/bdev.c:958
 blkdev_release+0x84/0x90 block/fops.c:604
 __fput+0x221/0x930 fs/file_table.c:384
 __do_sys_close fs/open.c:1573 [inline]
 __se_sys_close+0x15c/0x1e0 fs/open.c:1558
 do_syscall_x64 arch/x86/entry/common.c:46 [inline]
 do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76
 entry_SYSCALL_64_after_hwframe+0x68/0xd2

Memory state around the buggy address:
 ffff888059e4bf00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff888059e4bf80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff888059e4c000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                      ^
 ffff888059e4c080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff888059e4c100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================

Crashes (12):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/07/04 12:04 linux-6.6.y d1cfde2d5d15 fcece630 .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
2026/05/04 06:18 linux-6.6.y 258cf62a6dfd a0d91488 .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: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
2026/05/04 05:41 linux-6.6.y 258cf62a6dfd a0d91488 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan KASAN: use-after-free Read in leaf_paste_entries
2026/05/04 05:41 linux-6.6.y 258cf62a6dfd a0d91488 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan KASAN: use-after-free 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
2026/01/10 22:17 linux-6.6.y 5fa4793a2d2d d6526ea3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan KASAN: out-of-bounds Read in leaf_paste_entries
2026/01/04 12:25 linux-6.6.y 5fa4793a2d2d d6526ea3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan KASAN: out-of-bounds Read in leaf_paste_entries
2025/12/18 22:59 linux-6.6.y 5fa4793a2d2d d6526ea3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan KASAN: out-of-bounds Read in leaf_paste_entries
2025/12/12 20:24 linux-6.6.y 5fa4793a2d2d d6526ea3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan KASAN: out-of-bounds Read in leaf_paste_entries
2025/12/04 02:12 linux-6.6.y 4791134e4aeb d6526ea3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan KASAN: out-of-bounds Read in leaf_paste_entries
* Struck through repros no longer work on HEAD.