==================================================================
BUG: KASAN: slab-out-of-bounds in __bpf_get_stackid+0x868/0xcf0 kernel/bpf/stackmap.c:265
Write of size 8 at addr ffff888026baa258 by task syz-executor146/6143
CPU: 0 UID: 0 PID: 6143 Comm: syz-executor146 Not tainted 6.17.0-rc1-syzkaller-ge4414b01c1cd #0 PREEMPT(full)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025
Call Trace:
dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120
print_address_description mm/kasan/report.c:378 [inline]
print_report+0xca/0x240 mm/kasan/report.c:482
kasan_report+0x118/0x150 mm/kasan/report.c:595
__bpf_get_stackid+0x868/0xcf0 kernel/bpf/stackmap.c:265
____bpf_get_stackid_raw_tp kernel/trace/bpf_trace.c:1810 [inline]
bpf_get_stackid_raw_tp+0x196/0x210 kernel/trace/bpf_trace.c:1799
bpf_prog_b724608cae728045+0x27/0x2f
bpf_dispatcher_nop_func include/linux/bpf.h:1332 [inline]
__bpf_prog_run include/linux/filter.h:718 [inline]
bpf_prog_run include/linux/filter.h:725 [inline]
__bpf_trace_run kernel/trace/bpf_trace.c:2257 [inline]
bpf_trace_run2+0x284/0x4b0 kernel/trace/bpf_trace.c:2298
__do_trace_kfree include/trace/events/kmem.h:94 [inline]
trace_kfree include/trace/events/kmem.h:94 [inline]
kfree+0x3a0/0x440 mm/slub.c:4866
slab_free_after_rcu_debug+0x60/0x2a0 mm/slub.c:4717
rcu_do_batch kernel/rcu/tree.c:2605 [inline]
rcu_core+0xca8/0x1770 kernel/rcu/tree.c:2861
handle_softirqs+0x283/0x870 kernel/softirq.c:579
__do_softirq kernel/softirq.c:613 [inline]
invoke_softirq kernel/softirq.c:453 [inline]
__irq_exit_rcu+0xca/0x1f0 kernel/softirq.c:680
irq_exit_rcu+0x9/0x30 kernel/softirq.c:696
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1050 [inline]
sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1050
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
RIP: 0010:raw_spin_rq_unlock_irq+0x13/0x90 kernel/sched/sched.h:1532
Code: cc e8 c1 08 e7 09 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 41 57 41 56 53 66 90 e8 64 9f e9 09 e8 ef 26 35 00 fb 5b <41> 5e 41 5f e9 84 ed e9 09 cc f3 0f 1e fa 49 be 00 00 00 00 00 fc
RSP: 0018:ffffc900043e7908 EFLAGS: 00000286
RAX: 9ca712f55922db00 RBX: ffff8880b8639f80 RCX: 9ca712f55922db00
RDX: 0000000000000000 RSI: ffffffff8d9b6d6c RDI: ffffffff8be33380
RBP: ffffc900043e7b30 R08: ffffffff8fa37e37 R09: 1ffffffff1f46fc6
R10: dffffc0000000000 R11: fffffbfff1f46fc7 R12: dffffc0000000000
R13: 0000000000000008 R14: ffff888031db1e00 R15: 1ffff110170c7551
__schedule+0x19e0/0x4cc0 kernel/sched/core.c:6969
preempt_schedule_notrace+0xd1/0x110 kernel/sched/core.c:7238
preempt_schedule_notrace_thunk+0x16/0x30 arch/x86/entry/thunk.S:13
rcu_is_watching+0x7f/0xb0 kernel/rcu/tree.c:752
trace_lock_acquire include/trace/events/lock.h:24 [inline]
lock_acquire+0x5f/0x360 kernel/locking/lockdep.c:5831
sched_submit_work kernel/sched/core.c:6999 [inline]
schedule+0xb1/0x360 kernel/sched/core.c:7057
ptrace_stop+0x575/0x940 kernel/signal.c:2474
ptrace_do_notify kernel/signal.c:2511 [inline]
ptrace_notify+0x20f/0x2c0 kernel/signal.c:2523
ptrace_report_syscall include/linux/ptrace.h:415 [inline]
ptrace_report_syscall_exit include/linux/ptrace.h:477 [inline]
syscall_exit_work+0xc6/0x1d0 kernel/entry/syscall-common.c:111
syscall_exit_to_user_mode_work include/linux/entry-common.h:173 [inline]
syscall_exit_to_user_mode include/linux/entry-common.h:210 [inline]
do_syscall_64+0x2ad/0x3b0 arch/x86/entry/syscall_64.c:100
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f41d3f6e6a9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 c1 17 00 00 90 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fff11380548 EFLAGS: 00000246 ORIG_RAX: 000000000000012a
RAX: 0000000000000007 RBX: 0000000000000000 RCX: 00007f41d3f6e6a9
RDX: ffffffffffffffff RSI: 0000000000000000 RDI: 00002000000003c0
RBP: 0000000000021c68 R08: 0000000000000003 R09: 00007fff1138056c
R10: ffffffffffffffff R11: 0000000000000246 R12: 00007fff1138056c
R13: 431bde82d7b634db R14: 00007fff11380590 R15: 00007fff11380570
Allocated by task 6143:
kasan_save_stack mm/kasan/common.c:47 [inline]
kasan_save_track+0x3e/0x80 mm/kasan/common.c:68
poison_kmalloc_redzone mm/kasan/common.c:388 [inline]
__kasan_kmalloc+0x93/0xb0 mm/kasan/common.c:405
kasan_kmalloc include/linux/kasan.h:260 [inline]
__do_kmalloc_node mm/slub.c:4365 [inline]
__kmalloc_node_noprof+0x276/0x4e0 mm/slub.c:4371
kmalloc_node_noprof include/linux/slab.h:932 [inline]
__bpf_map_area_alloc kernel/bpf/syscall.c:393 [inline]
bpf_map_area_alloc+0x64/0x180 kernel/bpf/syscall.c:406
prealloc_elems_and_freelist+0x86/0x1d0 kernel/bpf/stackmap.c:51
stack_map_alloc+0x33f/0x4c0 kernel/bpf/stackmap.c:114
map_create+0xaa0/0x14d0 kernel/bpf/syscall.c:1480
__sys_bpf+0x60f/0x870 kernel/bpf/syscall.c:6011
__do_sys_bpf kernel/bpf/syscall.c:6139 [inline]
__se_sys_bpf kernel/bpf/syscall.c:6137 [inline]
__x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:6137
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
The buggy address belongs to the object at ffff888026baa000
which belongs to the cache kmalloc-1k of size 1024
The buggy address is located 24 bytes to the right of
allocated 576-byte region [ffff888026baa000, ffff888026baa240)
The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x26ba8
head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 00fff00000000040 ffff88801a441dc0 dead000000000100 dead000000000122
raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
head: 00fff00000000040 ffff88801a441dc0 dead000000000100 dead000000000122
head: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
head: 00fff00000000003 ffffea00009aea01 00000000ffffffff 00000000ffffffff
head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000008
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0x252800(GFP_NOWAIT|__GFP_NORETRY|__GFP_COMP|__GFP_THISNODE), pid 13, tgid 13 (kworker/u8:1), ts 11391258389, free_ts 0
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x240/0x2a0 mm/page_alloc.c:1851
prep_new_page mm/page_alloc.c:1859 [inline]
get_page_from_freelist+0x21e4/0x22c0 mm/page_alloc.c:3858
__alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:5148
alloc_slab_page mm/slub.c:2489 [inline]
allocate_slab+0x65/0x370 mm/slub.c:2655
new_slab mm/slub.c:2709 [inline]
___slab_alloc+0xbeb/0x1410 mm/slub.c:3891
__slab_alloc mm/slub.c:3981 [inline]
__slab_alloc_node mm/slub.c:4056 [inline]
slab_alloc_node mm/slub.c:4217 [inline]
__do_kmalloc_node mm/slub.c:4364 [inline]
__kmalloc_node_noprof+0x2fd/0x4e0 mm/slub.c:4371
kmalloc_node_noprof include/linux/slab.h:932 [inline]
blk_alloc_flush_queue+0xe2/0x230 block/blk-flush.c:490
blk_mq_alloc_hctx block/blk-mq.c:4041 [inline]
blk_mq_alloc_and_init_hctx+0x679/0xd60 block/blk-mq.c:4504
__blk_mq_realloc_hw_ctxs+0x169/0x400 block/blk-mq.c:4535
blk_mq_realloc_hw_ctxs block/blk-mq.c:4562 [inline]
blk_mq_init_allocated_queue+0x400/0x1490 block/blk-mq.c:4594
blk_mq_alloc_queue+0x191/0x280 block/blk-mq.c:4404
scsi_alloc_sdev+0x767/0xb40 drivers/scsi/scsi_scan.c:339
scsi_probe_and_add_lun+0x1c5/0x4580 drivers/scsi/scsi_scan.c:1211
__scsi_scan_target+0x1dd/0xd10 drivers/scsi/scsi_scan.c:1776
scsi_scan_channel drivers/scsi/scsi_scan.c:1864 [inline]
scsi_scan_host_selected+0x372/0x690 drivers/scsi/scsi_scan.c:1893
do_scsi_scan_host drivers/scsi/scsi_scan.c:2032 [inline]
do_scan_async+0x124/0x760 drivers/scsi/scsi_scan.c:2042
page_owner free stack trace missing
Memory state around the buggy address:
ffff888026baa100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff888026baa180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff888026baa200: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
^
ffff888026baa280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888026baa300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================
----------------
Code disassembly (best guess):
0: cc int3
1: e8 c1 08 e7 09 call 0x9e708c7
6: 90 nop
7: 90 nop
8: 90 nop
9: 90 nop
a: 90 nop
b: 90 nop
c: 90 nop
d: 90 nop
e: 90 nop
f: 90 nop
10: 90 nop
11: 90 nop
12: 90 nop
13: 90 nop
14: 90 nop
15: 90 nop
16: 90 nop
17: 41 57 push %r15
19: 41 56 push %r14
1b: 53 push %rbx
1c: 66 90 xchg %ax,%ax
1e: e8 64 9f e9 09 call 0x9e99f87
23: e8 ef 26 35 00 call 0x352717
28: fb sti
29: 5b pop %rbx
* 2a: 41 5e pop %r14 <-- trapping instruction
2c: 41 5f pop %r15
2e: e9 84 ed e9 09 jmp 0x9e9edb7
33: cc int3
34: f3 0f 1e fa endbr64
38: 49 rex.WB
39: be 00 00 00 00 mov $0x0,%esi
3e: 00 fc add %bh,%ah