syzbot


KASAN: use-after-free Read in search_by_entry_key

Status: upstream: reported C repro on 2023/04/08 09:36
Bug presence: origin:upstream
Labels: missing-backport
[Documentation on labels]
Reported-by: syzbot+6c3babb20f9e8bcadd25@syzkaller.appspotmail.com
First crash: 720d, last: 5d19h
Fix commit to backport (bisect log) :
tree: upstream
commit fb6f20ecb121cef4d7946f834a6ee867c4e21b4a
Author: Jan Kara <jack@suse.cz>
Date: Thu Oct 17 10:28:23 2024 +0000

  reiserfs: The last commit

  
Fix bisection: failed (error log, bisect log)
  
Bug presence (3)
Date Name Commit Repro Result
2024/12/20 linux-5.15.y (ToT) 91786f140358 C [report] KASAN: use-after-free Read in search_by_entry_key
2023/11/18 upstream (ToT) 791c8ab095f7 C [report] KASAN: use-after-free Read in search_by_entry_key
2024/12/20 upstream (ToT) 8faabc041a00 C Didn't crash
Similar bugs (8)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: use-after-free Read in search_by_entry_key (2) reiserfs C inconclusive inconclusive 139 427d 1020d 0/28 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 C error 6 823d 1442d 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 C done 3 1542d 1648d 1/1 fixed on 2021/02/21 17:18
linux-4.19 KASAN: use-after-free Read in search_by_entry_key (3) reiserfs C error 8 822d 1015d 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 C done 1 1544d 1634d 1/1 fixed on 2021/02/20 09:47
linux-6.1 KASAN: use-after-free Read in search_by_entry_key origin:upstream missing-backport C error 18 79d 705d 0/3 upstream: reported C repro on 2023/04/23 10:15
upstream KASAN: use-after-free Read in search_by_entry_key reiserfs C done 3 1628d 1632d 19/28 fixed on 2021/03/10 01:49
linux-4.19 KASAN: use-after-free Read in search_by_entry_key (2) C done 2 1325d 1475d 1/1 fixed on 2021/09/10 21:17
Last patch testing requests (10)
Created Duration User Patch Repo Result
2025/03/15 12:51 14m retest repro linux-5.15.y report log
2025/03/15 12:51 1h07m retest repro linux-5.15.y report log
2025/03/15 12:51 14m retest repro linux-5.15.y report log
2025/03/15 12:51 11m retest repro linux-5.15.y report log
2025/02/28 04:22 9m retest repro linux-5.15.y report log
2025/02/08 20:59 13m retest repro linux-5.15.y report log
2025/01/18 14:52 15m retest repro linux-5.15.y report log
2025/01/18 14:52 10m retest repro linux-5.15.y report log
2025/01/04 11:33 11m retest repro linux-5.15.y report log
2025/01/04 11:33 10m retest repro linux-5.15.y report log
Fix bisection attempts (4)
Created Duration User Patch Repo Result
2025/03/22 04:25 8h31m fix candidate upstream OK (1) job log
2023/12/18 12:32 0m bisect fix linux-5.15.y error job log
2023/11/18 09:51 56m bisect fix linux-5.15.y OK (0) job log log
2023/08/17 02:25 2h23m bisect fix linux-5.15.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 tea 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+0x575/0x1380 fs/reiserfs/namei.c:165
Read of size 4 at addr ffff888075584fc4 by task syz-executor291/4161

CPU: 1 PID: 4161 Comm: syz-executor291 Not tainted 5.15.179-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106
 print_address_description+0x63/0x3b0 mm/kasan/report.c:248
 __kasan_report mm/kasan/report.c:434 [inline]
 kasan_report+0x16b/0x1c0 mm/kasan/report.c:451
 bin_search_in_dir_item fs/reiserfs/namei.c:40 [inline]
 search_by_entry_key+0x575/0x1380 fs/reiserfs/namei.c:165
 reiserfs_find_entry+0x2ca/0x19b0 fs/reiserfs/namei.c:322
 reiserfs_lookup+0x1e6/0x4b0 fs/reiserfs/namei.c:368
 __lookup_slow+0x275/0x3d0 fs/namei.c:1663
 lookup_one_len+0x187/0x2d0 fs/namei.c:2718
 reiserfs_lookup_privroot+0x85/0x1e0 fs/reiserfs/xattr.c:980
 reiserfs_fill_super+0x2224/0x2690 fs/reiserfs/super.c:2178
 mount_bdev+0x2c9/0x3f0 fs/super.c:1400
 legacy_get_tree+0xeb/0x180 fs/fs_context.c:611
 vfs_get_tree+0x88/0x270 fs/super.c:1530
 do_new_mount+0x2ba/0xb40 fs/namespace.c:3012
 do_mount fs/namespace.c:3355 [inline]
 __do_sys_mount fs/namespace.c:3563 [inline]
 __se_sys_mount+0x2d5/0x3c0 fs/namespace.c:3540
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7fe37273982a
Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 ee 08 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fffa2bb18d8 EFLAGS: 00000286 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007fffa2bb18f0 RCX: 00007fe37273982a
RDX: 0000400000000180 RSI: 0000400000000040 RDI: 00007fffa2bb18f0
RBP: 0000400000000040 R08: 00007fffa2bb1930 R09: 0000000000001127
R10: 000000000001801c R11: 0000000000000286 R12: 0000400000000180
R13: 00007fffa2bb1930 R14: 0000000000000003 R15: 000000000001801c
 </TASK>

The buggy address belongs to the page:
page:ffffea0001d56100 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x75584
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000000 ffffea00003da648 ffffea0001ff1688 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 0x1100dca(GFP_HIGHUSER_MOVABLE|__GFP_ZERO), pid 4153, ts 59679276000, free_ts 59716887877
 prep_new_page mm/page_alloc.c:2426 [inline]
 get_page_from_freelist+0x3b78/0x3d40 mm/page_alloc.c:4192
 __alloc_pages+0x272/0x700 mm/page_alloc.c:5466
 alloc_pages_vma+0x39a/0x800 mm/mempolicy.c:2146
 do_anonymous_page mm/memory.c:3838 [inline]
 handle_pte_fault mm/memory.c:4648 [inline]
 __handle_mm_fault mm/memory.c:4785 [inline]
 handle_mm_fault+0x2f49/0x5960 mm/memory.c:4883
 do_user_addr_fault arch/x86/mm/fault.c:1357 [inline]
 handle_page_fault arch/x86/mm/fault.c:1445 [inline]
 exc_page_fault+0x271/0x700 arch/x86/mm/fault.c:1501
 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:606
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:24 [inline]
 free_pages_prepare mm/page_alloc.c:1340 [inline]
 free_pcp_prepare mm/page_alloc.c:1391 [inline]
 free_unref_page_prepare+0xc34/0xcf0 mm/page_alloc.c:3317
 free_unref_page_list+0x1f7/0x8e0 mm/page_alloc.c:3433
 release_pages+0x1bb9/0x1f40 mm/swap.c:963
 tlb_batch_pages_flush mm/mmu_gather.c:49 [inline]
 tlb_flush_mmu_free mm/mmu_gather.c:240 [inline]
 tlb_flush_mmu mm/mmu_gather.c:247 [inline]
 tlb_finish_mmu+0x177/0x320 mm/mmu_gather.c:338
 unmap_region+0x304/0x350 mm/mmap.c:2657
 __do_munmap+0x130a/0x1710 mm/mmap.c:2887
 __vm_munmap+0x134/0x230 mm/mmap.c:2940
 __do_sys_munmap mm/mmap.c:2966 [inline]
 __se_sys_munmap mm/mmap.c:2962 [inline]
 __x64_sys_munmap+0x67/0x70 mm/mmap.c:2962
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0

Memory state around the buggy address:
 ffff888075584e80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff888075584f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff888075584f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                                           ^
 ffff888075585000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff888075585080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================

Crashes (47):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/03/16 01:47 linux-5.15.y 0c935c049b5c e2826670 .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro (corrupt fs)] ci2-linux-5-15-kasan KASAN: use-after-free Read in search_by_entry_key
2023/06/04 06:14 linux-5.15.y 0ab06468cbd1 a4ae4f42 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-5-15-kasan KASAN: use-after-free Read in search_by_entry_key
2025/01/25 20:47 linux-5.15.y 003148680b79 9fbd772e .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in search_by_entry_key
2024/08/08 00:45 linux-5.15.y 7e89efd3ae1c 109d2082 .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in search_by_entry_key
2024/04/08 02:53 linux-5.15.y 9465fef4ae35 ca620dd8 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in search_by_entry_key
2024/04/04 23:21 linux-5.15.y 9465fef4ae35 0ee3535e .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in search_by_entry_key
2024/03/20 22:03 linux-5.15.y b95c01af2113 5b7d42ae .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in search_by_entry_key
2023/09/18 15:30 linux-5.15.y aff03380bda4 0b6a67ac .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in search_by_entry_key
2023/05/14 16:46 linux-5.15.y b0ece631f84a 2b9ba477 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in search_by_entry_key
2024/10/14 17:14 linux-5.15.y 3a5928702e71 084d8178 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in search_by_entry_key
2024/09/21 04:11 linux-5.15.y 3a5928702e71 6f888b75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in search_by_entry_key
2024/08/12 00:50 linux-5.15.y 7e89efd3ae1c 6f4edef4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in search_by_entry_key
2024/08/12 00:50 linux-5.15.y 7e89efd3ae1c 6f4edef4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in search_by_entry_key
2023/10/17 17:21 linux-5.15.y 02e21884dcf2 342b9c55 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in search_by_entry_key
2025/03/23 04:33 linux-5.15.y 0c935c049b5c 4e8d3850 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in search_by_entry_key
2025/03/21 21:07 linux-5.15.y 0c935c049b5c c6512ef7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in search_by_entry_key
2025/03/21 14:16 linux-5.15.y 0c935c049b5c 62330552 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in search_by_entry_key
2025/03/20 20:05 linux-5.15.y 0c935c049b5c 62330552 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in search_by_entry_key
2025/03/19 20:00 linux-5.15.y 0c935c049b5c e20d7b13 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in search_by_entry_key
2025/03/19 19:57 linux-5.15.y 0c935c049b5c e20d7b13 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in search_by_entry_key
2025/03/19 16:09 linux-5.15.y 0c935c049b5c e20d7b13 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in search_by_entry_key
2025/03/19 16:09 linux-5.15.y 0c935c049b5c e20d7b13 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in search_by_entry_key
2025/03/18 15:20 linux-5.15.y 0c935c049b5c 22a6c2b1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in search_by_entry_key
2025/03/18 10:33 linux-5.15.y 0c935c049b5c ce3352cd .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in search_by_entry_key
2025/03/18 10:24 linux-5.15.y 0c935c049b5c ce3352cd .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in search_by_entry_key
2025/03/18 10:19 linux-5.15.y 0c935c049b5c ce3352cd .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in search_by_entry_key
2025/03/18 10:14 linux-5.15.y 0c935c049b5c ce3352cd .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in search_by_entry_key
2025/03/18 10:13 linux-5.15.y 0c935c049b5c ce3352cd .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in search_by_entry_key
2025/03/18 10:12 linux-5.15.y 0c935c049b5c ce3352cd .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in search_by_entry_key
2025/03/18 10:08 linux-5.15.y 0c935c049b5c ce3352cd .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in search_by_entry_key
2025/03/18 10:07 linux-5.15.y 0c935c049b5c ce3352cd .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in search_by_entry_key
2025/03/17 04:25 linux-5.15.y 0c935c049b5c e2826670 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in search_by_entry_key
2024/11/10 23:59 linux-5.15.y 3c17fc483905 6b856513 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in search_by_entry_key
2024/09/19 11:55 linux-5.15.y 3a5928702e71 c673ca06 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in search_by_entry_key
2024/08/07 23:37 linux-5.15.y 7e89efd3ae1c 109d2082 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in search_by_entry_key
2024/05/01 22:55 linux-5.15.y b925f60c6ee7 3ba885bc .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in search_by_entry_key
2024/04/01 09:19 linux-5.15.y 9465fef4ae35 6baf5069 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in search_by_entry_key
2024/03/20 21:43 linux-5.15.y b95c01af2113 5b7d42ae .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in search_by_entry_key
2023/09/18 15:15 linux-5.15.y aff03380bda4 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in search_by_entry_key
2023/04/24 06:46 linux-5.15.y 3299fb36854f 2b32bd34 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in search_by_entry_key
2023/04/21 08:03 linux-5.15.y 3299fb36854f 2b32bd34 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in search_by_entry_key
2023/04/09 10:41 linux-5.15.y d86dfc4d95cd 71147e29 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in search_by_entry_key
2023/08/25 04:28 linux-5.15.y f6f7927ac664 49be837e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in search_by_entry_key
2023/06/23 05:56 linux-5.15.y f67653019430 79782afc .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in search_by_entry_key
2023/04/08 09:36 linux-5.15.y d86dfc4d95cd 71147e29 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in search_by_entry_key
* Struck through repros no longer work on HEAD.