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: 42d, last: 23d
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 85d 85d 0/3 upstream: reported on 2024/12/20 06:16
upstream KASAN: slab-out-of-bounds Read in reiserfs_xattr_get (2) reiserfs 1 412d 408d 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 546d 1432d 0/28 auto-obsoleted due to no activity on 2023/12/25 15:39

Sample crash report:
loop3: 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 ffff88805cfd1798 by task syz.3.7381/21574

CPU: 1 PID: 21574 Comm: syz.3.7381 Not tainted 5.15.178-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 12/27/2024
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:0x7fe59e6b3750
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:00007fe59c51ddf0 EFLAGS: 00000293 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 0000000000010000 RCX: 00007fe59e6b3750
RDX: 0000000000010000 RSI: 0000400000000080 RDI: 00000000ffffff9c
RBP: 0000400000000080 R08: 0000000000000000 R09: 000000000101c002
R10: 0000000000000000 R11: 0000000000000293 R12: 0000400000000080
R13: 00007fe59c51deb0 R14: 00000000000061c3 R15: 0000400000000a00
 </TASK>

Allocated by task 20442:
 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]
 __kmalloc+0x168/0x300 mm/slub.c:4407
 kmalloc include/linux/slab.h:596 [inline]
 kzalloc include/linux/slab.h:721 [inline]
 new_dir fs/proc/proc_sysctl.c:952 [inline]
 get_subdir fs/proc/proc_sysctl.c:997 [inline]
 __register_sysctl_table+0x9f1/0x1220 fs/proc/proc_sysctl.c:1346
 neigh_sysctl_register+0x455/0x530 net/core/neighbour.c:3714
 devinet_sysctl_register+0x9d/0x1a0 net/ipv4/devinet.c:2640
 inetdev_init+0x282/0x4a0 net/ipv4/devinet.c:277
 inetdev_event+0x29b/0x1490 net/ipv4/devinet.c:1543
 notifier_call_chain kernel/notifier.c:83 [inline]
 raw_notifier_call_chain+0xd0/0x170 kernel/notifier.c:391
 call_netdevice_notifiers_info net/core/dev.c:2018 [inline]
 call_netdevice_notifiers_extack net/core/dev.c:2030 [inline]
 call_netdevice_notifiers+0x145/0x1b0 net/core/dev.c:2044
 register_netdevice+0x12e8/0x1720 net/core/dev.c:10396
 ip6_tnl_create2 net/ipv6/ip6_tunnel.c:263 [inline]
 ip6_tnl_newlink+0x506/0x8f0 net/ipv6/ip6_tunnel.c:2066
 __rtnl_newlink net/core/rtnetlink.c:3521 [inline]
 rtnl_newlink+0x14e1/0x2070 net/core/rtnetlink.c:3569
 rtnetlink_rcv_msg+0x993/0xee0 net/core/rtnetlink.c:5647
 netlink_rcv_skb+0x1cf/0x410 net/netlink/af_netlink.c:2489
 netlink_unicast_kernel net/netlink/af_netlink.c:1311 [inline]
 netlink_unicast+0x7b6/0x980 net/netlink/af_netlink.c:1337
 netlink_sendmsg+0xa30/0xd60 net/netlink/af_netlink.c:1905
 sock_sendmsg_nosec net/socket.c:704 [inline]
 __sock_sendmsg net/socket.c:716 [inline]
 ____sys_sendmsg+0x59e/0x8f0 net/socket.c:2436
 ___sys_sendmsg+0x252/0x2e0 net/socket.c:2490
 __sys_sendmsg net/socket.c:2519 [inline]
 __do_sys_sendmsg net/socket.c:2528 [inline]
 __se_sys_sendmsg+0x19a/0x260 net/socket.c:2526
 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

Last potentially related work creation:
 kasan_save_stack+0x36/0x60 mm/kasan/common.c:38
 kasan_record_aux_stack+0xba/0x100 mm/kasan/generic.c:348
 kvfree_call_rcu+0x118/0x8a0 kernel/rcu/tree.c:3596
 drop_sysctl_table+0x317/0x460 fs/proc/proc_sysctl.c:1678
 drop_sysctl_table+0x329/0x460 fs/proc/proc_sysctl.c:1681
 unregister_sysctl_table+0x88/0x130 fs/proc/proc_sysctl.c:1716
 __devinet_sysctl_unregister net/ipv4/devinet.c:2626 [inline]
 devinet_sysctl_unregister net/ipv4/devinet.c:2654 [inline]
 inetdev_destroy net/ipv4/devinet.c:326 [inline]
 inetdev_event+0x7ba/0x1490 net/ipv4/devinet.c:1611
 notifier_call_chain kernel/notifier.c:83 [inline]
 raw_notifier_call_chain+0xd0/0x170 kernel/notifier.c:391
 call_netdevice_notifiers_info net/core/dev.c:2018 [inline]
 call_netdevice_notifiers_extack net/core/dev.c:2030 [inline]
 call_netdevice_notifiers net/core/dev.c:2044 [inline]
 unregister_netdevice_many+0xf1b/0x18f0 net/core/dev.c:11102
 sit_exit_batch_net+0x43c/0x480 net/ipv6/sit.c:1952
 ops_exit_list net/core/net_namespace.c:177 [inline]
 cleanup_net+0x886/0xc90 net/core/net_namespace.c:618
 process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2310
 worker_thread+0xaca/0x1280 kernel/workqueue.c:2457
 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 ffff88805cfd1600
 which belongs to the cache kmalloc-256 of size 256
The buggy address is located 152 bytes to the right of
 256-byte region [ffff88805cfd1600, ffff88805cfd1700)
The buggy address belongs to the page:
page:ffffea000173f400 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x5cfd0
head:ffffea000173f400 order:1 compound_mapcount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 0000000000000000 0000000100000001 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 4680, ts 90402113733, free_ts 89714468920
 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:5465
 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:2353
 __sys_bpf+0x343/0x670 kernel/bpf/syscall.c:4656
 __do_sys_bpf kernel/bpf/syscall.c:4760 [inline]
 __se_sys_bpf kernel/bpf/syscall.c:4758 [inline]
 __x64_sys_bpf+0x78/0x90 kernel/bpf/syscall.c:4758
 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+0x95/0x2d0 mm/page_alloc.c:3396
 free_slab mm/slub.c:2015 [inline]
 discard_slab mm/slub.c:2021 [inline]
 __unfreeze_partials+0x1b7/0x210 mm/slub.c:2507
 put_cpu_partial+0x132/0x1a0 mm/slub.c:2587
 do_slab_free mm/slub.c:3487 [inline]
 ___cache_free+0xe3/0x100 mm/slub.c:3506
 qlist_free_all+0x36/0x90 mm/kasan/quarantine.c:176
 kasan_quarantine_reduce+0x162/0x180 mm/kasan/quarantine.c:283
 __kasan_slab_alloc+0x2f/0xc0 mm/kasan/common.c:444
 kasan_slab_alloc include/linux/kasan.h:254 [inline]
 slab_post_alloc_hook+0x53/0x380 mm/slab.h:519
 slab_alloc_node mm/slub.c:3220 [inline]
 slab_alloc mm/slub.c:3228 [inline]
 kmem_cache_alloc_trace+0xfb/0x290 mm/slub.c:3245
 kmalloc include/linux/slab.h:591 [inline]
 kzalloc include/linux/slab.h:721 [inline]
 copy_verifier_state+0x6a5/0xc80 kernel/bpf/verifier.c:981
 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:2353

Memory state around the buggy address:
 ffff88805cfd1680: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff88805cfd1700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff88805cfd1780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
                            ^
 ffff88805cfd1800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff88805cfd1880: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
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.