syzbot


KASAN: slab-out-of-bounds Read in reiserfs_xattr_get

Status: upstream: reported on 2025/02/01 18:46
Reported-by: syzbot+5144a1ae0494ff0b7e91@syzkaller.appspotmail.com
First crash: 79d, last: 6d03h
Similar bugs (3)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-6.1 KASAN: slab-out-of-bounds Read in reiserfs_xattr_get 1 122d 122d 0/3 auto-obsoleted due to no activity on 2025/03/30 06:16
upstream KASAN: slab-out-of-bounds Read in reiserfs_xattr_get (2) reiserfs 1 449d 445d 0/28 auto-obsoleted due to no activity on 2024/05/07 19:35
upstream KASAN: slab-out-of-bounds Read in reiserfs_xattr_get reiserfs 106 583d 1469d 0/28 auto-obsoleted due to no activity on 2023/12/25 15:39

Sample crash report:
loop4: detected capacity change from 0 to 32768
==================================================================
BUG: KASAN: slab-out-of-bounds in reiserfs_xattr_get+0xe0/0x9d0 fs/reiserfs/xattr.c:681
Read of size 8 at addr ffff88805ab9bd98 by task syz.4.7062/20348

CPU: 1 PID: 20348 Comm: syz.4.7062 Not tainted 5.15.180-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
 reiserfs_xattr_get+0xe0/0x9d0 fs/reiserfs/xattr.c:681
 reiserfs_get_acl+0x7a/0x650 fs/reiserfs/xattr_acl.c:214
 get_acl+0x14e/0x250 fs/posix_acl.c:153
 check_acl+0x3a/0x150 fs/namei.c:307
 acl_permission_check fs/namei.c:352 [inline]
 generic_permission+0x396/0x4f0 fs/namei.c:405
 do_inode_permission fs/namei.c:459 [inline]
 inode_permission+0x22f/0x450 fs/namei.c:526
 may_open+0x29e/0x400 fs/namei.c:3232
 do_open fs/namei.c:3606 [inline]
 path_openat+0x25a2/0x2f20 fs/namei.c:3742
 do_filp_open+0x21c/0x460 fs/namei.c:3769
 do_sys_openat2+0x13b/0x4f0 fs/open.c:1253
 do_sys_open fs/open.c:1269 [inline]
 __do_sys_openat fs/open.c:1285 [inline]
 __se_sys_openat fs/open.c:1280 [inline]
 __x64_sys_openat+0x243/0x290 fs/open.c:1280
 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:0x7fba49bc7ad0
Code: 48 89 44 24 20 75 93 44 89 54 24 0c e8 49 94 02 00 44 8b 54 24 0c 89 da 48 89 ee 41 89 c0 bf 9c ff ff ff b8 01 01 00 00 0f 05 <48> 3d 00 f0 ff ff 77 38 44 89 c7 89 44 24 0c e8 9c 94 02 00 8b 44
RSP: 002b:00007fba47a30df0 EFLAGS: 00000293 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 0000000000010000 RCX: 00007fba49bc7ad0
RDX: 0000000000010000 RSI: 0000200000005d80 RDI: 00000000ffffff9c
RBP: 0000200000005d80 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000293 R12: 0000200000005d80
R13: 00007fba47a30eb0 R14: 0000000000005d0c R15: 0000200000005dc0
 </TASK>

Allocated by task 20343:
 kasan_save_stack mm/kasan/common.c:38 [inline]
 kasan_set_track mm/kasan/common.c:46 [inline]
 set_alloc_info mm/kasan/common.c:434 [inline]
 ____kasan_kmalloc+0xba/0xf0 mm/kasan/common.c:513
 kasan_kmalloc include/linux/kasan.h:264 [inline]
 kmem_cache_alloc_trace+0x143/0x290 mm/slub.c:3247
 kmalloc include/linux/slab.h:604 [inline]
 kzalloc include/linux/slab.h:735 [inline]
 set_kthread_struct kernel/kthread.c:103 [inline]
 kthread+0x10a/0x4f0 kernel/kthread.c:296
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287

Freed by task 14:
 kasan_save_stack mm/kasan/common.c:38 [inline]
 kasan_set_track+0x4b/0x80 mm/kasan/common.c:46
 kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:360
 ____kasan_slab_free+0xd8/0x120 mm/kasan/common.c:366
 kasan_slab_free include/linux/kasan.h:230 [inline]
 slab_free_hook mm/slub.c:1705 [inline]
 slab_free_freelist_hook+0xdd/0x160 mm/slub.c:1731
 slab_free mm/slub.c:3499 [inline]
 kfree+0xf1/0x270 mm/slub.c:4559
 free_task+0xd9/0x150 kernel/fork.c:473
 rcu_do_batch kernel/rcu/tree.c:2523 [inline]
 rcu_core+0xa15/0x1650 kernel/rcu/tree.c:2763
 handle_softirqs+0x3a7/0x930 kernel/softirq.c:558
 run_ksoftirqd+0xc6/0x120 kernel/softirq.c:925
 smpboot_thread_fn+0x51b/0x9d0 kernel/smpboot.c:164
 kthread+0x3f6/0x4f0 kernel/kthread.c:334
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287

The buggy address belongs to the object at ffff88805ab9bc00
 which belongs to the cache kmalloc-256 of size 256
The buggy address is located 152 bytes to the right of
 256-byte region [ffff88805ab9bc00, ffff88805ab9bd00)
The buggy address belongs to the page:
page:ffffea00016ae680 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x5ab9a
head:ffffea00016ae680 order:1 compound_mapcount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 ffffea00007e3280 0000000700000007 ffff888017441b40
raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 1, migratetype Unmovable, gfp_mask 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 18805, ts 664337942282, free_ts 634123321593
 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_slab_page mm/slub.c:1775 [inline]
 allocate_slab mm/slub.c:1912 [inline]
 new_slab+0xbb/0x4b0 mm/slub.c:1975
 ___slab_alloc+0x6f6/0xe10 mm/slub.c:3008
 __slab_alloc mm/slub.c:3095 [inline]
 slab_alloc_node mm/slub.c:3186 [inline]
 slab_alloc mm/slub.c:3228 [inline]
 __kmalloc_track_caller+0x1c7/0x300 mm/slub.c:4925
 copy_array kernel/bpf/verifier.c:778 [inline]
 copy_stack_state kernel/bpf/verifier.c:829 [inline]
 copy_func_state kernel/bpf/verifier.c:950 [inline]
 copy_verifier_state+0x840/0xc80 kernel/bpf/verifier.c:986
 push_stack+0x19d/0x4f0 kernel/bpf/verifier.c:1057
 check_cond_jmp_op kernel/bpf/verifier.c:9341 [inline]
 do_check+0xceb7/0xf310 kernel/bpf/verifier.c:11472
 do_check_common+0x844/0x1070 kernel/bpf/verifier.c:13485
 do_check_main kernel/bpf/verifier.c:13548 [inline]
 bpf_check+0xcb96/0x12d40 kernel/bpf/verifier.c:14119
 bpf_prog_load+0x12b3/0x1b60 kernel/bpf/syscall.c:2345
 __sys_bpf+0x343/0x670 kernel/bpf/syscall.c:4648
 __do_sys_bpf kernel/bpf/syscall.c:4752 [inline]
 __se_sys_bpf kernel/bpf/syscall.c:4750 [inline]
 __x64_sys_bpf+0x78/0x90 kernel/bpf/syscall.c:4750
 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
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
 __pagevec_release+0x80/0xf0 mm/swap.c:983
 pagevec_release include/linux/pagevec.h:81 [inline]
 truncate_inode_pages_range+0x48b/0x1290 mm/truncate.c:329
 gfs2_find_jhead+0xfa8/0x10c0 fs/gfs2/lops.c:605
 check_journal_clean+0x18d/0x350 fs/gfs2/util.c:75
 init_journal+0x1830/0x23c0 fs/gfs2/ops_fstype.c:832
 init_inodes+0xdc/0x310 fs/gfs2/ops_fstype.c:891
 gfs2_fill_super+0x1c2c/0x2750 fs/gfs2/ops_fstype.c:1249
 get_tree_bdev+0x3fe/0x620 fs/super.c:1325
 gfs2_get_tree+0x50/0x210 fs/gfs2/ops_fstype.c:1332
 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

Memory state around the buggy address:
 ffff88805ab9bc80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88805ab9bd00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff88805ab9bd80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
                            ^
 ffff88805ab9be00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff88805ab9be80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/04/15 22:48 linux-5.15.y f7347f400572 a95239b1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Read in reiserfs_xattr_get
2025/02/20 03:49 linux-5.15.y c16c81c81336 50668798 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Read in reiserfs_xattr_get
2025/02/01 18:45 linux-5.15.y c16c81c81336 aa47157c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: slab-out-of-bounds Read in reiserfs_xattr_get
* Struck through repros no longer work on HEAD.