syzbot


BUG: unable to handle kernel NULL pointer dereference in reiserfs_find_entry

Status: fixed on 2024/02/02 11:15
Subsystems: reiserfs
[Documentation on labels]
Reported-by: syzbot+4654552e088ed458b10d@syzkaller.appspotmail.com
Fix commit: 6f861765464f fs: Block writes to mounted block devices
First crash: 603d, last: 167d
Cause bisection: failed (error log, bisect log)
  
Fix bisection: fixed by (bisect log) :
commit 6f861765464f43a71462d52026fbddfc858239a5
Author: Jan Kara <jack@suse.cz>
Date: Wed Nov 1 17:43:10 2023 +0000

  fs: Block writes to mounted block devices

  
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] BUG: unable to handle kernel NULL pointer dereference in reiserfs_find_entry 1 (4) 2024/01/31 17:18
Similar bugs (3)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-5.15 KASAN: use-after-free Read in reiserfs_find_entry origin:upstream C error 4 256d 413d 0/3 upstream: reported C repro on 2023/04/26 06:52
linux-4.14 KASAN: use-after-free Read in reiserfs_find_entry reiserfs C 1 482d 482d 0/1 upstream: reported C repro on 2023/02/16 03:16
linux-6.1 KASAN: use-after-free Read in reiserfs_find_entry origin:upstream C 3 11d 374d 0/3 upstream: reported C repro on 2023/06/03 22:29
Last patch testing requests (10)
Created Duration User Patch Repo Result
2024/01/23 16:00 18m retest repro upstream OK log
2023/12/28 17:00 19m retest repro git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci report log
2023/12/28 17:00 17m retest repro upstream report log
2023/12/28 17:00 17m retest repro upstream report log
2023/12/28 17:00 18m retest repro git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci report log
2023/12/28 16:53 10m retest repro upstream report log
2023/11/14 15:11 10m retest repro upstream report log
2023/09/15 03:11 29m retest repro upstream report log
2023/09/15 03:11 19m retest repro git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci report log
2023/08/31 08:30 13m retest repro upstream report log
Fix bisection attempts (3)
Created Duration User Patch Repo Result
2024/01/31 08:27 8h24m bisect fix upstream job log (1)
2023/10/18 05:19 1h20m bisect fix upstream job log (0) log
2023/04/24 23:30 48m bisect fix upstream job log (0) log

Sample crash report:
REISERFS warning:  read_super_block: reiserfs filesystem is deprecated and scheduled to be removed from the kernel in 2025
REISERFS (device loop0): found reiserfs format "3.5" with non-standard journal
REISERFS (device loop0): using ordered data mode
reiserfs: using flush barriers
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 strlen+0x58/0x70 lib/string.c:418
Read of size 1 at addr ffff888073ac47a3 by task syz-executor355/5025

CPU: 0 PID: 5025 Comm: syz-executor355 Not tainted 6.6.0-rc6-syzkaller-00334-g1acfd2bd3f0d #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/06/2023
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106
 print_address_description mm/kasan/report.c:364 [inline]
 print_report+0x163/0x540 mm/kasan/report.c:475
 kasan_report+0x175/0x1b0 mm/kasan/report.c:588
 strlen+0x58/0x70 lib/string.c:418
 set_de_name_and_namelen fs/reiserfs/namei.c:82 [inline]
 linear_search_in_dir_item fs/reiserfs/namei.c:262 [inline]
 reiserfs_find_entry+0x982/0x19b0 fs/reiserfs/namei.c:331
 reiserfs_lookup+0x1e2/0x580 fs/reiserfs/namei.c:368
 __lookup_slow+0x282/0x3e0 fs/namei.c:1694
 lookup_one_len+0x18b/0x2d0 fs/namei.c:2746
 reiserfs_lookup_privroot+0x89/0x180 fs/reiserfs/xattr.c:977
 reiserfs_fill_super+0x195b/0x2620 fs/reiserfs/super.c:2192
 mount_bdev+0x237/0x300 fs/super.c:1629
 legacy_get_tree+0xef/0x190 fs/fs_context.c:662
 vfs_get_tree+0x8c/0x280 fs/super.c:1750
 do_new_mount+0x28f/0xae0 fs/namespace.c:3335
 do_mount fs/namespace.c:3675 [inline]
 __do_sys_mount fs/namespace.c:3884 [inline]
 __se_sys_mount+0x2d9/0x3c0 fs/namespace.c:3861
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7fd542cfbe1a
Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 0e 06 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:00007ffcfb8bcaa8 EFLAGS: 00000286 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007ffcfb8bcab0 RCX: 00007fd542cfbe1a
RDX: 00000000200000c0 RSI: 0000000020000040 RDI: 00007ffcfb8bcab0
RBP: 0000000000000004 R08: 00007ffcfb8bcaf0 R09: 000000000000111c
R10: 0000000000008001 R11: 0000000000000286 R12: 00007ffcfb8bcaf0
R13: 0000000000000003 R14: 0000000000400000 R15: 000000000000000c
 </TASK>

The buggy address belongs to the physical page:
page:ffffea0001ceb100 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x73ac4
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000000000 ffffea0001ceb148 ffff8880b9842220 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 4981, tgid 4981 (sshd), ts 48362289199, free_ts 48404126216
 set_page_owner include/linux/page_owner.h:31 [inline]
 post_alloc_hook+0x1e6/0x210 mm/page_alloc.c:1536
 prep_new_page mm/page_alloc.c:1543 [inline]
 get_page_from_freelist+0x31db/0x3360 mm/page_alloc.c:3170
 __alloc_pages+0x255/0x670 mm/page_alloc.c:4426
 __folio_alloc+0x13/0x30 mm/page_alloc.c:4458
 vma_alloc_folio+0x48a/0x9a0 mm/mempolicy.c:2258
 do_anonymous_page mm/memory.c:4110 [inline]
 do_pte_missing mm/memory.c:3667 [inline]
 handle_pte_fault mm/memory.c:4978 [inline]
 __handle_mm_fault mm/memory.c:5119 [inline]
 handle_mm_fault+0x2376/0x62b0 mm/memory.c:5284
 do_user_addr_fault arch/x86/mm/fault.c:1364 [inline]
 handle_page_fault arch/x86/mm/fault.c:1505 [inline]
 exc_page_fault+0x455/0x860 arch/x86/mm/fault.c:1561
 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:24 [inline]
 free_pages_prepare mm/page_alloc.c:1136 [inline]
 free_unref_page_prepare+0x8c3/0x9f0 mm/page_alloc.c:2312
 free_unref_page_list+0x596/0x830 mm/page_alloc.c:2451
 release_pages+0x2113/0x23f0 mm/swap.c:1042
 tlb_batch_pages_flush mm/mmu_gather.c:98 [inline]
 tlb_flush_mmu_free mm/mmu_gather.c:293 [inline]
 tlb_flush_mmu+0x34c/0x4e0 mm/mmu_gather.c:300
 tlb_finish_mmu+0xd4/0x1f0 mm/mmu_gather.c:392
 unmap_region+0x300/0x350 mm/mmap.c:2318
 do_vmi_align_munmap+0x121e/0x1850 mm/mmap.c:2555
 do_vmi_munmap+0x24d/0x2d0 mm/mmap.c:2623
 __vm_munmap+0x230/0x450 mm/mmap.c:2908
 __do_sys_munmap mm/mmap.c:2925 [inline]
 __se_sys_munmap mm/mmap.c:2922 [inline]
 __x64_sys_munmap+0x69/0x80 mm/mmap.c:2922
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

Memory state around the buggy address:
 ffff888073ac4680: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff888073ac4700: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff888073ac4780: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                               ^
 ffff888073ac4800: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff888073ac4880: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================

Crashes (25):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/10/22 16:35 upstream 1acfd2bd3f0d 361b23dc .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci-upstream-kasan-gce-smack-root KASAN: use-after-free Read in reiserfs_find_entry
2023/08/07 01:52 upstream f0ab9f34e59e 4ffcc9ef .config strace log report syz C [mounted in repro] ci-upstream-kasan-gce-smack-root KASAN: use-after-free Read in reiserfs_find_entry
2023/12/06 23:58 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci d46efae31672 e3299f55 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci-upstream-gce-arm64 KASAN: use-after-free Read in reiserfs_find_entry
2023/06/03 18:43 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci eb0f1697d729 a4ae4f42 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci-upstream-gce-arm64 KASAN: use-after-free Read in reiserfs_find_entry
2023/06/03 20:18 upstream 51f269a6ecc7 a4ae4f42 .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-upstream-fs KASAN: use-after-free Read in reiserfs_find_entry
2023/02/13 23:40 upstream ceaa837f96ad 957959cb .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-upstream-fs KASAN: use-after-free Read in reiserfs_find_entry
2022/10/18 04:12 upstream 55be6084c8e0 754863b4 .config console log report info [disk image] [vmlinux] ci-upstream-kasan-gce-smack-root BUG: unable to handle kernel NULL pointer dereference in reiserfs_find_entry
2023/11/25 09:22 upstream 0f5cc96c367f 5b429f39 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs KASAN: use-after-free Read in reiserfs_find_entry
2023/10/31 13:28 upstream 5a6a09e97199 58499c95 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs KASAN: use-after-free Read in reiserfs_find_entry
2023/10/21 15:48 upstream 9c5d00cb7b6b 361b23dc .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs KASAN: use-after-free Read in reiserfs_find_entry
2023/08/17 02:49 upstream 4853c74bd7ab 74b106b6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs KASAN: use-after-free Read in reiserfs_find_entry
2023/07/10 00:01 upstream 1c7873e33645 668cb1fa .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs KASAN: use-after-free Read in reiserfs_find_entry
2023/05/16 21:00 upstream f1fcbaa18b28 11c89444 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs KASAN: use-after-free Read in reiserfs_find_entry
2023/03/25 23:29 upstream 65aca32efdcb fbf0499a .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs KASAN: use-after-free Read in reiserfs_find_entry
2023/02/26 07:48 upstream 489fa31ea873 ee50e71c .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs KASAN: use-after-free Read in reiserfs_find_entry
2023/02/26 01:32 upstream 489fa31ea873 ee50e71c .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs KASAN: use-after-free Read in reiserfs_find_entry
2023/02/21 04:09 upstream 91bc559d8d3a 2414209c .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs KASAN: use-after-free Read in reiserfs_find_entry
2023/02/13 23:20 upstream ceaa837f96ad 957959cb .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs KASAN: use-after-free Read in reiserfs_find_entry
2023/02/13 00:21 upstream 711e9a4d52bf 93e26d60 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs KASAN: use-after-free Read in reiserfs_find_entry
2023/12/14 16:48 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci d5b235ec8eab 3222d10c .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 KASAN: use-after-free Read in reiserfs_find_entry
2023/06/22 15:13 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 42234a752679 09ffe269 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 KASAN: use-after-free Read in reiserfs_find_entry
2023/06/03 18:20 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci eb0f1697d729 a4ae4f42 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 KASAN: use-after-free Read in reiserfs_find_entry
2023/05/15 01:19 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 14f8db1c0f9a 2b9ba477 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 KASAN: use-after-free Read in reiserfs_find_entry
2023/05/14 04:37 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 14f8db1c0f9a 2b9ba477 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 KASAN: use-after-free Read in reiserfs_find_entry
2023/04/25 04:42 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 14f8db1c0f9a fdc18293 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 KASAN: use-after-free Read in reiserfs_find_entry
* Struck through repros no longer work on HEAD.