Hello,
syzbot found the following issue on:
HEAD commit: f6e38ae624cf Linux 6.1.158
git tree: linux-6.1.y
console output:
https://syzkaller.appspot.com/x/log.txt?x=11d5a532580000
kernel config:
https://syzkaller.appspot.com/x/.config?x=7eb38bd5021fec61
dashboard link:
https://syzkaller.appspot.com/bug?extid=0a0a24a8d9eb27203929
compiler: Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8
Unfortunately, I don't have any reproducer for this issue yet.
Downloadable assets:
disk image:
https://storage.googleapis.com/syzbot-assets/0d8305ca1c94/disk-f6e38ae6.raw.xz
vmlinux:
https://storage.googleapis.com/syzbot-assets/8bc85383c07b/vmlinux-f6e38ae6.xz
kernel image:
https://storage.googleapis.com/syzbot-assets/d337081bce56/bzImage-f6e38ae6.xz
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by:
syzbot+0a0a24...@syzkaller.appspotmail.com
==================================================================
BUG: KASAN: slab-out-of-bounds in stack_map_get_build_id_offset+0x7fc/0x9c0 kernel/bpf/stackmap.c:148
Write of size 8 at addr ffff888059beca48 by task syz.0.6610/24869
CPU: 0 PID: 24869 Comm: syz.0.6610 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/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/0x210 mm/kasan/report.c:420
kasan_report+0x10b/0x140 mm/kasan/report.c:524
stack_map_get_build_id_offset+0x7fc/0x9c0 kernel/bpf/stackmap.c:148
__bpf_get_stackid+0x55d/0x920 kernel/bpf/stackmap.c:250
____bpf_get_stackid_raw_tp kernel/trace/bpf_trace.c:1855 [inline]
bpf_get_stackid_raw_tp+0x175/0x1b0 kernel/trace/bpf_trace.c:1844
bpf_prog_b724608cae728045+0x1e/0x22
bpf_dispatcher_nop_func include/linux/bpf.h:1012 [inline]
__bpf_prog_run include/linux/filter.h:603 [inline]
bpf_prog_run include/linux/filter.h:610 [inline]
__bpf_trace_run kernel/trace/bpf_trace.c:2285 [inline]
bpf_trace_run2+0x1cd/0x3b0 kernel/trace/bpf_trace.c:2324
__bpf_trace_kfree+0x6e/0x90 include/trace/events/kmem.h:94
trace_kfree include/trace/events/kmem.h:94 [inline]
kfree+0xf6/0x190 mm/slab_common.c:975
ida_alloc_range+0x798/0x830 lib/idr.c:460
proc_alloc_inum fs/proc/generic.c:206 [inline]
proc_register+0x3b/0x730 fs/proc/generic.c:389
proc_create_net_single+0x11c/0x170 fs/proc/proc_net.c:219
can_init_proc+0x2b1/0x350 net/can/proc.c:467
can_pernet_init+0x294/0x2b0 net/can/af_can.c:809
ops_init+0x355/0x5f0 net/core/net_namespace.c:138
setup_net+0x4e1/0xbb0 net/core/net_namespace.c:336
copy_net_ns+0x348/0x5b0 net/core/net_namespace.c:508
create_new_namespaces+0x3d3/0x6f0 kernel/nsproxy.c:110
copy_namespaces+0x3b0/0x410 kernel/nsproxy.c:178
copy_process+0x199c/0x4020 kernel/fork.c:2354
kernel_clone+0x225/0x8b0 kernel/fork.c:2757
__do_sys_clone kernel/fork.c:2898 [inline]
__se_sys_clone kernel/fork.c:2882 [inline]
__x64_sys_clone+0x17c/0x1d0 kernel/fork.c:2882
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:0x7f5f2778f6c9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 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:00007f5f2863bfe8 EFLAGS: 00000206 ORIG_RAX: 0000000000000038
RAX: ffffffffffffffda RBX: 00007f5f279e5fa0 RCX: 00007f5f2778f6c9
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 00000000638c1000
RBP: 00007f5f27811f91 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000000000
R13: 00007f5f279e6038 R14: 00007f5f279e5fa0 R15: 00007ffcd22bcbf8
</TASK>
Allocated by task 24878:
kasan_save_stack mm/kasan/common.c:45 [inline]
kasan_set_track+0x4b/0x70 mm/kasan/common.c:52
____kasan_kmalloc mm/kasan/common.c:374 [inline]
__kasan_kmalloc+0x8e/0xa0 mm/kasan/common.c:383
kasan_kmalloc include/linux/kasan.h:211 [inline]
__do_kmalloc_node mm/slab_common.c:936 [inline]
__kmalloc_node+0xb0/0x240 mm/slab_common.c:943
kmalloc_node include/linux/slab.h:589 [inline]
__bpf_map_area_alloc kernel/bpf/syscall.c:328 [inline]
bpf_map_area_alloc+0x47/0xe0 kernel/bpf/syscall.c:341
prealloc_elems_and_freelist+0x86/0x1c0 kernel/bpf/stackmap.c:51
stack_map_alloc+0x390/0x520 kernel/bpf/stackmap.c:117
find_and_alloc_map kernel/bpf/syscall.c:133 [inline]
map_create+0x534/0x1000 kernel/bpf/syscall.c:1149
__sys_bpf+0x2f3/0x6d0 kernel/bpf/syscall.c:5009
__do_sys_bpf kernel/bpf/syscall.c:5131 [inline]
__se_sys_bpf kernel/bpf/syscall.c:5129 [inline]
__x64_sys_bpf+0x78/0x90 kernel/bpf/syscall.c:5129
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
Last potentially related work creation:
kasan_save_stack+0x3a/0x60 mm/kasan/common.c:45
__kasan_record_aux_stack+0xb2/0xc0 mm/kasan/generic.c:486
insert_work+0x54/0x3c0 kernel/workqueue.c:1361
__queue_work+0xba3/0xfb0 kernel/workqueue.c:1520
queue_work_on+0x11d/0x1d0 kernel/workqueue.c:1548
__bpf_free_used_maps kernel/bpf/core.c:2570 [inline]
bpf_free_used_maps kernel/bpf/core.c:2576 [inline]
bpf_prog_free_deferred+0x140/0x5e0 kernel/bpf/core.c:2615
process_one_work+0x898/0x1160 kernel/workqueue.c:2292
worker_thread+0xaa2/0x1250 kernel/workqueue.c:2439
kthread+0x29d/0x330 kernel/kthread.c:376
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295
Second to last potentially related work creation:
kasan_save_stack+0x3a/0x60 mm/kasan/common.c:45
__kasan_record_aux_stack+0xb2/0xc0 mm/kasan/generic.c:486
kvfree_call_rcu+0x108/0x870 kernel/rcu/tree.c:3405
drop_sysctl_table+0x2fa/0x430 fs/proc/proc_sysctl.c:1731
unregister_sysctl_table+0x85/0x130 fs/proc/proc_sysctl.c:1769
neigh_sysctl_unregister+0x74/0x90 net/core/neighbour.c:3877
addrconf_sysctl_unregister net/ipv6/addrconf.c:7207 [inline]
addrconf_ifdown+0x1711/0x1a10 net/ipv6/addrconf.c:3951
addrconf_notify+0x405/0xf40 net/ipv6/addrconf.c:-1
notifier_call_chain kernel/notifier.c:87 [inline]
raw_notifier_call_chain+0xcb/0x160 kernel/notifier.c:455
call_netdevice_notifiers_extack net/core/dev.c:2039 [inline]
call_netdevice_notifiers net/core/dev.c:2053 [inline]
unregister_netdevice_many+0xfdc/0x1840 net/core/dev.c:10990
unregister_netdevice_queue+0x31c/0x360 net/core/dev.c:10921
unregister_netdevice include/linux/netdevice.h:3075 [inline]
__tun_detach+0xd4a/0x1500 drivers/net/tun.c:685
tun_detach drivers/net/tun.c:701 [inline]
tun_chr_close+0x109/0x1b0 drivers/net/tun.c:3492
__fput+0x22c/0x920 fs/file_table.c:320
task_work_run+0x1ca/0x250 kernel/task_work.c:203
exit_task_work include/linux/task_work.h:39 [inline]
do_exit+0x93e/0x2400 kernel/exit.c:880
do_group_exit+0x217/0x2d0 kernel/exit.c:1022
get_signal+0x1272/0x1350 kernel/signal.c:2871
arch_do_signal_or_restart+0xb7/0x1240 arch/x86/kernel/signal.c:871
exit_to_user_mode_loop+0x70/0x110 kernel/entry/common.c:174
exit_to_user_mode_prepare+0xee/0x180 kernel/entry/common.c:210
__syscall_exit_to_user_mode_work kernel/entry/common.c:292 [inline]
syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:303
ret_from_fork+0x15/0x30 arch/x86/entry/entry_64.S:288
The buggy address belongs to the object at ffff888059bec800
which belongs to the cache kmalloc-cg-1k of size 1024
The buggy address is located 584 bytes inside of
1024-byte region [ffff888059bec800, ffff888059becc00)
The buggy address belongs to the physical page:
page:ffffea000166fa00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x59be8
head:ffffea000166fa00 order:3 compound_mapcount:0 compound_pincount:0
memcg:ffff88805a435a01
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 ffffea00015aee00 dead000000000002 ffff88801744c000
raw: 0000000000000000 0000000080100010 00000001ffffffff ffff88805a435a01
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd60c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_RETRY_MAYFAIL|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 4278, tgid 4278 (syz-executor), ts 60849718588, free_ts 13285806256
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
alloc_slab_page+0x5d/0x160 mm/slub.c:1799
allocate_slab mm/slub.c:1944 [inline]
new_slab+0x87/0x2c0 mm/slub.c:1997
___slab_alloc+0xbc6/0x1230 mm/slub.c:3154
__slab_alloc mm/slub.c:3240 [inline]
slab_alloc_node mm/slub.c:3325 [inline]
__kmem_cache_alloc_node+0x1a0/0x260 mm/slub.c:3398
__do_kmalloc_node mm/slab_common.c:935 [inline]
__kmalloc_node+0xa0/0x240 mm/slab_common.c:943
kmalloc_node include/linux/slab.h:589 [inline]
kvmalloc_node+0x6c/0x180 mm/util.c:581
kvmalloc include/linux/slab.h:716 [inline]
kvzalloc include/linux/slab.h:724 [inline]
netif_alloc_netdev_queues net/core/dev.c:10015 [inline]
alloc_netdev_mqs+0x7e9/0xf00 net/core/dev.c:10790
rtnl_create_link+0x2fb/0xb80 net/core/rtnetlink.c:3295
rtnl_newlink_create net/core/rtnetlink.c:3412 [inline]
__rtnl_newlink net/core/rtnetlink.c:3642 [inline]
rtnl_newlink+0x13ca/0x1ff0 net/core/rtnetlink.c:3655
rtnetlink_rcv_msg+0x79b/0xed0 net/core/rtnetlink.c:6150
netlink_rcv_skb+0x1de/0x420 net/netlink/af_netlink.c:2511
netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline]
netlink_unicast+0x74d/0x8d0 net/netlink/af_netlink.c:1344
netlink_sendmsg+0x89e/0xbc0 net/netlink/af_netlink.c:1872
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+0x2e/0x3f0 mm/page_alloc.c:3479
free_contig_range+0x9d/0x150 mm/page_alloc.c:9574
destroy_args+0x100/0xa31 mm/debug_vm_pgtable.c:1031
debug_vm_pgtable+0x32a/0x37e mm/debug_vm_pgtable.c:1359
do_one_initcall+0x214/0x7a0 init/main.c:1310
do_initcall_level+0x137/0x1e4 init/main.c:1383
do_initcalls+0x4b/0x8a init/main.c:1399
kernel_init_freeable+0x3fa/0x5ac init/main.c:1638
kernel_init+0x19/0x1b0 init/main.c:1526
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295
Memory state around the buggy address:
ffff888059bec900: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff888059bec980: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff888059beca00: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
^
ffff888059beca80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888059becb00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc