syzbot


KASAN: use-after-free Read in search_by_entry_key

Status: upstream: reported C repro on 2023/04/23 10:15
Bug presence: origin:upstream
Labels: missing-backport
[Documentation on labels]
Reported-by: syzbot+f1695d226551f134846a@syzkaller.appspotmail.com
First crash: 846d, last: 4d20h
Fix bisection: failed (error log, bisect log)
  
Bug presence (3)
Date Name Commit Repro Result
2025/01/02 linux-6.1.y (ToT) 563edd786f0a C [report] KASAN: use-after-free Read in search_by_entry_key
2024/07/02 upstream (ToT) 1dfe225e9af5 C [report] KASAN: use-after-free Read in search_by_entry_key
2025/01/02 upstream (ToT) 56e6a3499e14 C Didn't crash
Similar bugs (8)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: use-after-free Read in search_by_entry_key (2) fs 19 C inconclusive inconclusive 139 567d 1161d 0/29 auto-obsoleted due to no activity on 2024/04/08 07:18
linux-4.14 KASAN: use-after-free Read in search_by_entry_key (2) reiserfs 19 C error 6 964d 1583d 0/1 upstream: reported C repro on 2021/04/16 06:17
linux-4.14 KASAN: use-after-free Read in search_by_entry_key 19 C done 3 1683d 1789d 1/1 fixed on 2021/02/21 17:18
linux-4.19 KASAN: use-after-free Read in search_by_entry_key (3) reiserfs 19 C error 8 962d 1156d 0/1 upstream: reported C repro on 2022/06/17 02:59
linux-4.19 KASAN: use-after-free Read in search_by_entry_key 19 C done 1 1684d 1774d 1/1 fixed on 2021/02/20 09:47
linux-5.15 KASAN: use-after-free Read in search_by_entry_key missing-backport origin:upstream 19 C done 60 12d 861d 0/3 upstream: reported C repro on 2023/04/08 09:36
upstream KASAN: use-after-free Read in search_by_entry_key fs 19 C done 3 1769d 1772d 19/29 fixed on 2021/03/10 01:49
linux-4.19 KASAN: use-after-free Read in search_by_entry_key (2) 19 C done 2 1465d 1615d 1/1 fixed on 2021/09/10 21:17
Fix bisection attempts (13)
Created Duration User Patch Repo Result
2025/04/29 04:18 2h26m fix candidate upstream OK (0) job log
2025/02/08 15:14 13m bisect fix linux-6.1.y error job log
2024/11/19 13:12 1h26m bisect fix linux-6.1.y OK (0) job log log
2024/10/15 23:39 2h02m bisect fix linux-6.1.y OK (0) job log log
2024/09/15 22:15 1h11m bisect fix linux-6.1.y OK (0) job log log
2024/08/12 19:05 1h11m bisect fix linux-6.1.y OK (0) job log log
2024/07/02 06:47 1h13m bisect fix linux-6.1.y OK (0) job log log
2024/05/23 22:02 4h19m bisect fix linux-6.1.y OK (0) job log log
2024/04/19 18:36 1h45m bisect fix linux-6.1.y OK (0) job log log
2024/03/05 09:36 1h38m bisect fix linux-6.1.y OK (0) job log log
2024/01/01 14:04 1h35m bisect fix linux-6.1.y OK (0) job log log
2023/10/26 04:49 1h48m bisect fix linux-6.1.y OK (0) job log log
2023/07/16 18:11 2h25m bisect fix linux-6.1.y OK (0) job log log

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 r5 hash to sort names
==================================================================
BUG: KASAN: use-after-free in bin_search_in_dir_item fs/reiserfs/namei.c:40 [inline]
BUG: KASAN: use-after-free in search_by_entry_key+0x597/0x1370 fs/reiserfs/namei.c:165
Read of size 4 at addr ffff88805b377754 by task syz.0.17/4431

CPU: 1 PID: 4431 Comm: syz.0.17 Not tainted 6.1.147-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/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/0x200 mm/kasan/report.c:418
 kasan_report+0x10b/0x140 mm/kasan/report.c:522
 bin_search_in_dir_item fs/reiserfs/namei.c:40 [inline]
 search_by_entry_key+0x597/0x1370 fs/reiserfs/namei.c:165
 reiserfs_find_entry+0x2ff/0x18e0 fs/reiserfs/namei.c:322
 reiserfs_lookup+0x1a7/0x420 fs/reiserfs/namei.c:368
 __lookup_slow+0x27d/0x3a0 fs/namei.c:1690
 lookup_one_len+0x18e/0x2c0 fs/namei.c:2740
 reiserfs_lookup_privroot+0x85/0x1e0 fs/reiserfs/xattr.c:973
 reiserfs_fill_super+0x16ef/0x2340 fs/reiserfs/super.c:2192
 mount_bdev+0x287/0x3c0 fs/super.c:1443
 legacy_get_tree+0xe6/0x180 fs/fs_context.c:632
 vfs_get_tree+0x88/0x270 fs/super.c:1573
 do_new_mount+0x24a/0xa40 fs/namespace.c:3063
 do_mount fs/namespace.c:3406 [inline]
 __do_sys_mount fs/namespace.c:3614 [inline]
 __se_sys_mount+0x2d6/0x3c0 fs/namespace.c:3591
 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:0x7fb56579038a
Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 de 1a 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 49 89 ca b8 a5 00 00 00 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:00007ffd4ebb0998 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007ffd4ebb0a20 RCX: 00007fb56579038a
RDX: 0000200000000000 RSI: 0000200000000440 RDI: 00007ffd4ebb09e0
RBP: 0000200000000000 R08: 00007ffd4ebb0a20 R09: 000000000120c081
R10: 000000000120c081 R11: 0000000000000246 R12: 0000200000000440
R13: 00007ffd4ebb09e0 R14: 0000000000001108 R15: 0000200000000900
 </TASK>

The buggy address belongs to the physical page:
page:ffffea00016cddc0 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x5b377
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000000 ffffea00016ce348 ffffea0001abcf48 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 0x140dca(GFP_HIGHUSER_MOVABLE|__GFP_COMP|__GFP_ZERO), pid 4288, tgid 4288 (udevd), ts 99571866337, free_ts 99637268565
 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:5614
 __folio_alloc+0xe/0x30 mm/page_alloc.c:5646
 vma_alloc_folio+0x4a3/0x900 mm/mempolicy.c:2243
 alloc_page_vma include/linux/gfp.h:284 [inline]
 do_anonymous_page mm/memory.c:4191 [inline]
 handle_pte_fault mm/memory.c:5029 [inline]
 __handle_mm_fault mm/memory.c:5173 [inline]
 handle_mm_fault+0x2242/0x3e70 mm/memory.c:5294
 do_user_addr_fault+0x51f/0xb10 arch/x86/mm/fault.c:1340
 handle_page_fault arch/x86/mm/fault.c:1431 [inline]
 exc_page_fault+0x60/0x100 arch/x86/mm/fault.c:1487
 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:608
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_list+0xbb/0x8e0 mm/page_alloc.c:3525
 release_pages+0x1f92/0x2200 mm/swap.c:1035
 tlb_batch_pages_flush mm/mmu_gather.c:59 [inline]
 tlb_flush_mmu_free mm/mmu_gather.c:254 [inline]
 tlb_flush_mmu+0xff/0x210 mm/mmu_gather.c:261
 tlb_finish_mmu+0xbd/0x1c0 mm/mmu_gather.c:361
 unmap_region+0x272/0x2c0 mm/mmap.c:2339
 do_mas_align_munmap+0xc57/0x1220 mm/mmap.c:2588
 do_mas_munmap+0x240/0x2b0 mm/mmap.c:2646
 __vm_munmap+0x18d/0x290 mm/mmap.c:2932
 __do_sys_munmap mm/mmap.c:2957 [inline]
 __se_sys_munmap mm/mmap.c:2954 [inline]
 __x64_sys_munmap+0x5c/0x70 mm/mmap.c:2954
 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

Memory state around the buggy address:
 ffff88805b377600: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff88805b377680: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff88805b377700: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                                                 ^
 ffff88805b377780: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff88805b377800: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================

Crashes (37):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/08/11 15:23 linux-6.1.y 3594f306da12 32a0e5ed .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro (corrupt fs)] ci2-linux-6-1-kasan KASAN: use-after-free Read in search_by_entry_key
2023/06/09 04:23 linux-6.1.y 76ba310227d2 058b3a5a .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan KASAN: use-after-free Read in search_by_entry_key
2025/04/28 16:51 linux-6.1.y 535ec20c5027 c6b4fb39 .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro (corrupt fs)] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in search_by_entry_key
2024/12/24 22:39 linux-6.1.y 29f02ec58a94 444551c4 .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 search_by_entry_key
2024/01/27 02:37 linux-6.1.y 883d1a956208 cc4a4020 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in search_by_entry_key
2023/09/21 13:08 linux-6.1.y a356197db198 0b6a67ac .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in search_by_entry_key
2023/05/10 03:17 linux-6.1.y ca48fc16c493 30aa2a7e .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in search_by_entry_key
2025/07/29 09:20 linux-6.1.y 3594f306da12 c4a95487 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in search_by_entry_key
2025/05/31 11:22 linux-6.1.y da3c5173c55f 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in search_by_entry_key
2025/05/31 11:19 linux-6.1.y da3c5173c55f 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in search_by_entry_key
2025/05/31 11:19 linux-6.1.y da3c5173c55f 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in search_by_entry_key
2025/05/31 11:16 linux-6.1.y da3c5173c55f 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in search_by_entry_key
2025/05/31 11:11 linux-6.1.y da3c5173c55f 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in search_by_entry_key
2025/05/31 11:10 linux-6.1.y da3c5173c55f 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in search_by_entry_key
2023/11/17 02:28 linux-6.1.y fb2635ac69ab cb976f63 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in search_by_entry_key
2025/07/30 20:20 linux-6.1.y 3594f306da12 f8f2b4da .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in search_by_entry_key
2025/07/13 01:00 linux-6.1.y dfc486ec9cce 3cda49cf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in search_by_entry_key
2025/07/13 01:00 linux-6.1.y dfc486ec9cce 3cda49cf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in search_by_entry_key
2025/07/13 00:51 linux-6.1.y dfc486ec9cce 3cda49cf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in search_by_entry_key
2025/07/13 00:44 linux-6.1.y dfc486ec9cce 3cda49cf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in search_by_entry_key
2025/06/23 20:17 linux-6.1.y 58485ff1a74f d6cdfb8a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in search_by_entry_key
2025/05/10 18:59 linux-6.1.y 02b72ccb5f9d 77908e5f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in search_by_entry_key
2025/05/08 11:15 linux-6.1.y ac7079a42ea5 dbf35fa1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in search_by_entry_key
2025/04/28 16:29 linux-6.1.y 535ec20c5027 c6b4fb39 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in search_by_entry_key
2025/01/08 05:30 linux-6.1.y 7dc732d24ff7 f3558dbf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in search_by_entry_key
2025/01/06 21:49 linux-6.1.y 7dc732d24ff7 f3558dbf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in search_by_entry_key
2025/01/06 04:00 linux-6.1.y 7dc732d24ff7 f3558dbf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in search_by_entry_key
2025/01/02 03:47 linux-6.1.y 563edd786f0a d3ccff63 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in search_by_entry_key
2024/03/18 04:09 linux-6.1.y d7543167affd d615901c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in search_by_entry_key
2023/12/01 21:48 linux-6.1.y 6ac30d748bb0 f819d6f7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in search_by_entry_key
2023/11/19 01:30 linux-6.1.y fb2635ac69ab cb976f63 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in search_by_entry_key
2023/09/21 12:32 linux-6.1.y a356197db198 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in search_by_entry_key
2023/05/16 10:56 linux-6.1.y bf4ad6fa4e53 71b00cfb .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in search_by_entry_key
2023/05/22 06:46 linux-6.1.y fa74641fb6b9 4bce1a3e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in search_by_entry_key
2023/05/14 08:43 linux-6.1.y bf4ad6fa4e53 2b9ba477 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in search_by_entry_key
2023/04/23 10:15 linux-6.1.y f17b0ab65d17 2b32bd34 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in search_by_entry_key
2025/05/31 11:14 linux-6.1.y da3c5173c55f 3d2f584d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: out-of-bounds Read in search_by_entry_key
* Struck through repros no longer work on HEAD.