Hello,
syzbot found the following issue on:
HEAD commit: 666539eecdf4 Merge tag 'assoc-array-fixes-v2'
git tree: upstream
console output:
https://syzkaller.appspot.com/x/log.txt?x=1325594d580000
kernel config:
https://syzkaller.appspot.com/x/.config?x=b949a9d3c1d44ceb
dashboard link:
https://syzkaller.appspot.com/bug?extid=3812d1cc59d0b30cb5f0
compiler: Debian clang version 22.1.8 (1~deb13u4), Debian LLD 22.1.8
CC: [
da...@davemloft.net edum...@kernel.org ho...@kernel.org ku...@kernel.org linux-...@vger.kernel.org net...@vger.kernel.org pab...@redhat.com willemdebr...@gmail.com]
Unfortunately, I don't have any reproducer for this issue yet.
Downloadable assets:
disk image:
https://storage.googleapis.com/syzbot-assets/a943b9915869/disk-666539ee.raw.xz
vmlinux:
https://storage.googleapis.com/syzbot-assets/9bfd839d7ea5/vmlinux-666539ee.xz
kernel image:
https://storage.googleapis.com/syzbot-assets/0f20b9720a71/bzImage-666539ee.xz
AI-generated root cause summary:
Commit 378b7708194f ("sched: Make migrate_{en,dis}able() inline") moved
__migrate_disable() and __migrate_enable() from kernel/sched/core.c to
include/linux/sched.h. In kernel/sched/, KCSAN sanitization was disabled
(KCSAN_SANITIZE := n), but moving the helpers inline into the header exposed
plain C accesses of p->migration_disabled to KCSAN instrumentation at callsites
throughout the kernel (such as BPF helpers). In __migrate_disable(),
guard(preempt)() disables preemption but leaves hardware interrupts enabled; an
interrupt on the same CPU can trigger softirq processing (e.g. net_rx_action ->
packet_rcv -> bpf_prog_run_clear_cb) under the same current task, causing an
unannotated read of p->migration_disabled while the interrupted task is in the
middle of writing to it.
full analysis:
https://syzkaller.appspot.com/x/ai_root_cause?x=3812d1cc59d0b30cb5f0
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by:
syzbot+3812d1...@syzkaller.appspotmail.com
==================================================================
BUG: KCSAN: data-race in bpf_prog_run_clear_cb / trace_call_bpf
read to 0xffff88810244ebf8 of 2 bytes by interrupt on cpu 0:
__migrate_disable include/linux/sched.h:2483 [inline]
migrate_disable include/linux/sched.h:2512 [inline]
bpf_prog_run_pin_on_cpu include/linux/filter.h:836 [inline]
bpf_prog_run_clear_cb+0x53/0x290 include/linux/filter.h:1119
run_filter net/packet/af_packet.c:2111 [inline]
packet_rcv+0x26e/0xba0 net/packet/af_packet.c:2184
deliver_skb+0x10b/0x170 net/core/dev.c:2564
deliver_ptype_list_skb net/core/dev.c:2579 [inline]
__netif_receive_skb_core+0x13e0/0x19a0 net/core/dev.c:6391
__netif_receive_skb_list_core+0x112/0x520 net/core/dev.c:6522
__netif_receive_skb_list net/core/dev.c:6589 [inline]
netif_receive_skb_list_internal+0x471/0x5e0 net/core/dev.c:6680
gro_normal_list include/net/gro.h:539 [inline]
gro_flush_normal include/net/gro.h:547 [inline]
napi_complete_done+0x19c/0x410 net/core/dev.c:7048
virtqueue_napi_complete drivers/net/virtio_net.c:736 [inline]
virtnet_poll+0x1a9a/0x1f60 drivers/net/virtio_net.c:3048
__napi_poll+0x73/0x350 net/core/dev.c:7997
napi_poll net/core/dev.c:8060 [inline]
net_rx_action+0x33f/0x850 net/core/dev.c:8217
handle_softirqs+0x109/0x310 kernel/softirq.c:669
__do_softirq kernel/softirq.c:703 [inline]
invoke_softirq kernel/softirq.c:542 [inline]
__irq_exit_rcu+0x40/0xf0 kernel/softirq.c:786
common_interrupt+0x83/0x90 arch/x86/kernel/irq.c:273
asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:665
__preempt_count_add arch/x86/include/asm/preempt.h:98 [inline]
delay_tsc+0x4b/0xa0 arch/x86/lib/delay.c:77
udelay include/asm-generic/delay.h:64 [inline]
delay_access kernel/kcsan/core.c:332 [inline]
kcsan_setup_watchpoint+0x255/0x3f0 kernel/kcsan/core.c:622
__migrate_disable include/linux/sched.h:2496 [inline]
migrate_disable include/linux/sched.h:2512 [inline]
bpf_prog_run_array include/linux/bpf.h:2796 [inline]
trace_call_bpf+0xee/0x420 kernel/trace/bpf_trace.c:147
perf_trace_run_bpf_submit+0x4e/0x110 kernel/events/core.c:11549
do_perf_trace_kmalloc include/trace/events/kmem.h:57 [inline]
perf_trace_kmalloc+0xec/0x130 include/trace/events/kmem.h:57
__do_trace_kmalloc include/trace/events/kmem.h:57 [inline]
trace_kmalloc include/trace/events/kmem.h:57 [inline]
__do_kmalloc_node mm/slub.c:5532 [inline]
__kmalloc_node_noprof+0x45d/0x4d0 mm/slub.c:5543
_kmalloc_node_noprof include/linux/slab.h:1200 [inline]
__vmalloc_area_node mm/vmalloc.c:3930 [inline]
__vmalloc_node_range_noprof+0x458/0x10b0 mm/vmalloc.c:4152
__vmalloc_node_noprof mm/vmalloc.c:4213 [inline]
vzalloc_noprof+0x82/0xb0 mm/vmalloc.c:4291
alloc_counters net/ipv4/netfilter/arp_tables.c:672 [inline]
copy_entries_to_user net/ipv4/netfilter/arp_tables.c:693 [inline]
get_entries net/ipv4/netfilter/arp_tables.c:788 [inline]
do_arpt_get_ctl+0x64a/0xaf0 net/ipv4/netfilter/arp_tables.c:1014
nf_getsockopt+0x190/0x1b0 net/netfilter/nf_sockopt.c:116
ip_getsockopt+0x137/0x180 net/ipv4/ip_sockglue.c:1785
tcp_getsockopt+0xad/0xe0 net/ipv4/tcp.c:4885
sock_common_getsockopt+0x60/0x70 net/core/sock.c:4096
do_sock_getsockopt+0x2ce/0x350 net/socket.c:2505
__sys_getsockopt net/socket.c:2536 [inline]
__do_sys_getsockopt net/socket.c:2543 [inline]
__se_sys_getsockopt net/socket.c:2540 [inline]
__x64_sys_getsockopt+0x11d/0x1a0 net/socket.c:2540
x64_sys_call+0x1032/0x2550 arch/x86/include/generated/asm/syscalls_64.h:56
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0x11e/0x3a0 arch/x86/entry/syscall_64.c:89
entry_SYSCALL_64_after_hwframe+0x77/0x7f
write to 0xffff88810244ebf8 of 2 bytes by task 3710 on cpu 0:
__migrate_disable include/linux/sched.h:2496 [inline]
migrate_disable include/linux/sched.h:2512 [inline]
bpf_prog_run_array include/linux/bpf.h:2796 [inline]
trace_call_bpf+0xee/0x420 kernel/trace/bpf_trace.c:147
perf_trace_run_bpf_submit+0x4e/0x110 kernel/events/core.c:11549
do_perf_trace_kmalloc include/trace/events/kmem.h:57 [inline]
perf_trace_kmalloc+0xec/0x130 include/trace/events/kmem.h:57
__do_trace_kmalloc include/trace/events/kmem.h:57 [inline]
trace_kmalloc include/trace/events/kmem.h:57 [inline]
__do_kmalloc_node mm/slub.c:5532 [inline]
__kmalloc_node_noprof+0x45d/0x4d0 mm/slub.c:5543
_kmalloc_node_noprof include/linux/slab.h:1200 [inline]
__vmalloc_area_node mm/vmalloc.c:3930 [inline]
__vmalloc_node_range_noprof+0x458/0x10b0 mm/vmalloc.c:4152
__vmalloc_node_noprof mm/vmalloc.c:4213 [inline]
vzalloc_noprof+0x82/0xb0 mm/vmalloc.c:4291
alloc_counters net/ipv4/netfilter/arp_tables.c:672 [inline]
copy_entries_to_user net/ipv4/netfilter/arp_tables.c:693 [inline]
get_entries net/ipv4/netfilter/arp_tables.c:788 [inline]
do_arpt_get_ctl+0x64a/0xaf0 net/ipv4/netfilter/arp_tables.c:1014
nf_getsockopt+0x190/0x1b0 net/netfilter/nf_sockopt.c:116
ip_getsockopt+0x137/0x180 net/ipv4/ip_sockglue.c:1785
tcp_getsockopt+0xad/0xe0 net/ipv4/tcp.c:4885
sock_common_getsockopt+0x60/0x70 net/core/sock.c:4096
do_sock_getsockopt+0x2ce/0x350 net/socket.c:2505
__sys_getsockopt net/socket.c:2536 [inline]
__do_sys_getsockopt net/socket.c:2543 [inline]
__se_sys_getsockopt net/socket.c:2540 [inline]
__x64_sys_getsockopt+0x11d/0x1a0 net/socket.c:2540
x64_sys_call+0x1032/0x2550 arch/x86/include/generated/asm/syscalls_64.h:56
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0x11e/0x3a0 arch/x86/entry/syscall_64.c:89
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Reported by Kernel Concurrency Sanitizer on:
CPU: 0 UID: 0 PID: 3710 Comm: syz-executor Not tainted syzkaller #0 PREEMPT(lazy)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026
==================================================================
---
This report is generated by a bot. It may contain errors.
See
https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at
syzk...@googlegroups.com.
syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title
If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)
If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report
If you want to undo deduplication, reply with:
#syz undup