public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [syzbot] [net?] KCSAN: data-race in pfifo_fast_dequeue / pfifo_fast_enqueue (6)
@ 2026-03-12 15:26 syzbot
  2026-03-12 15:30 ` Eric Dumazet
  0 siblings, 1 reply; 2+ messages in thread
From: syzbot @ 2026-03-12 15:26 UTC (permalink / raw)
  To: davem, edumazet, horms, jhs, jiri, kuba, linux-kernel, netdev,
	pabeni, syzkaller-bugs

Hello,

syzbot found the following issue on:

HEAD commit:    37a93dd5c49b Merge tag 'net-next-7.0' of git://git.kernel...
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=1244fa52580000
kernel config:  https://syzkaller.appspot.com/x/.config?x=ec543385a37b9f17
dashboard link: https://syzkaller.appspot.com/bug?extid=b44f2bbe286b9355c563
compiler:       Debian clang version 21.1.8 (++20251221033036+2078da43e25a-1~exp1~20251221153213.50), Debian LLD 21.1.8

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/5c78f22cfb6c/disk-37a93dd5.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/77c2f419bced/vmlinux-37a93dd5.xz
kernel image: https://storage.googleapis.com/syzbot-assets/5640d838c887/bzImage-37a93dd5.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+b44f2bbe286b9355c563@syzkaller.appspotmail.com

==================================================================
BUG: KCSAN: data-race in pfifo_fast_dequeue / pfifo_fast_enqueue

write to 0xffff88811d5ccc00 of 8 bytes by interrupt on cpu 0:
 __ptr_ring_zero_tail include/linux/ptr_ring.h:259 [inline]
 __ptr_ring_discard_one include/linux/ptr_ring.h:291 [inline]
 __ptr_ring_consume include/linux/ptr_ring.h:311 [inline]
 __skb_array_consume include/linux/skb_array.h:98 [inline]
 pfifo_fast_dequeue+0x770/0x8f0 net/sched/sch_generic.c:770
 dequeue_skb net/sched/sch_generic.c:297 [inline]
 qdisc_restart net/sched/sch_generic.c:402 [inline]
 __qdisc_run+0x189/0xc80 net/sched/sch_generic.c:420
 qdisc_run include/net/pkt_sched.h:120 [inline]
 net_tx_action+0x379/0x590 net/core/dev.c:5793
 handle_softirqs+0xb9/0x280 kernel/softirq.c:622
 do_softirq+0x45/0x60 kernel/softirq.c:523
 __local_bh_enable_ip+0x70/0x80 kernel/softirq.c:450
 local_bh_enable include/linux/bottom_half.h:33 [inline]
 bpf_test_run+0x2db/0x620 net/bpf/test_run.c:426
 bpf_prog_test_run_skb+0x9a4/0xef0 net/bpf/test_run.c:1159
 bpf_prog_test_run+0x204/0x340 kernel/bpf/syscall.c:4721
 __sys_bpf+0x52e/0x7e0 kernel/bpf/syscall.c:6246
 __do_sys_bpf kernel/bpf/syscall.c:6341 [inline]
 __se_sys_bpf kernel/bpf/syscall.c:6339 [inline]
 __x64_sys_bpf+0x41/0x50 kernel/bpf/syscall.c:6339
 x64_sys_call+0x10cb/0x3020 arch/x86/include/generated/asm/syscalls_64.h:322
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0x12c/0x370 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

read to 0xffff88811d5ccc00 of 8 bytes by task 22632 on cpu 1:
 __ptr_ring_produce include/linux/ptr_ring.h:106 [inline]
 ptr_ring_produce include/linux/ptr_ring.h:129 [inline]
 skb_array_produce include/linux/skb_array.h:44 [inline]
 pfifo_fast_enqueue+0xd5/0x2c0 net/sched/sch_generic.c:741
 dev_qdisc_enqueue net/core/dev.c:4144 [inline]
 __dev_xmit_skb net/core/dev.c:4188 [inline]
 __dev_queue_xmit+0x6a4/0x1f20 net/core/dev.c:4795
 dev_queue_xmit include/linux/netdevice.h:3384 [inline]
 __bpf_tx_skb net/core/filter.c:2153 [inline]
 __bpf_redirect_common net/core/filter.c:2197 [inline]
 __bpf_redirect+0x862/0x990 net/core/filter.c:2204
 ____bpf_clone_redirect net/core/filter.c:2487 [inline]
 bpf_clone_redirect+0x20c/0x290 net/core/filter.c:2450
 bpf_prog_53f18857bc887b09+0x22/0x2a
 bpf_dispatcher_nop_func include/linux/bpf.h:1402 [inline]
 __bpf_prog_run include/linux/filter.h:723 [inline]
 bpf_prog_run include/linux/filter.h:730 [inline]
 bpf_test_run+0x29d/0x620 net/bpf/test_run.c:423
 bpf_prog_test_run_skb+0x9a4/0xef0 net/bpf/test_run.c:1159
 bpf_prog_test_run+0x204/0x340 kernel/bpf/syscall.c:4721
 __sys_bpf+0x52e/0x7e0 kernel/bpf/syscall.c:6246
 __do_sys_bpf kernel/bpf/syscall.c:6341 [inline]
 __se_sys_bpf kernel/bpf/syscall.c:6339 [inline]
 __x64_sys_bpf+0x41/0x50 kernel/bpf/syscall.c:6339
 x64_sys_call+0x10cb/0x3020 arch/x86/include/generated/asm/syscalls_64.h:322
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0x12c/0x370 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

value changed: 0xffff888104a93a00 -> 0x0000000000000000

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 UID: 0 PID: 22632 Comm: syz.0.4135 Tainted: G        W           syzkaller #0 PREEMPT(full) 
Tainted: [W]=WARN
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/24/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 syzkaller@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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [syzbot] [net?] KCSAN: data-race in pfifo_fast_dequeue / pfifo_fast_enqueue (6)
  2026-03-12 15:26 [syzbot] [net?] KCSAN: data-race in pfifo_fast_dequeue / pfifo_fast_enqueue (6) syzbot
@ 2026-03-12 15:30 ` Eric Dumazet
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Dumazet @ 2026-03-12 15:30 UTC (permalink / raw)
  To: syzbot, Michael S. Tsirkin
  Cc: davem, horms, jhs, jiri, kuba, linux-kernel, netdev, pabeni,
	syzkaller-bugs

On Thu, Mar 12, 2026 at 4:26 PM syzbot
<syzbot+b44f2bbe286b9355c563@syzkaller.appspotmail.com> wrote:
>
> Hello,
>
> syzbot found the following issue on:
>
> HEAD commit:    37a93dd5c49b Merge tag 'net-next-7.0' of git://git.kernel...
> git tree:       upstream
> console output: https://syzkaller.appspot.com/x/log.txt?x=1244fa52580000
> kernel config:  https://syzkaller.appspot.com/x/.config?x=ec543385a37b9f17
> dashboard link: https://syzkaller.appspot.com/bug?extid=b44f2bbe286b9355c563
> compiler:       Debian clang version 21.1.8 (++20251221033036+2078da43e25a-1~exp1~20251221153213.50), Debian LLD 21.1.8
>
> Unfortunately, I don't have any reproducer for this issue yet.
>
> Downloadable assets:
> disk image: https://storage.googleapis.com/syzbot-assets/5c78f22cfb6c/disk-37a93dd5.raw.xz
> vmlinux: https://storage.googleapis.com/syzbot-assets/77c2f419bced/vmlinux-37a93dd5.xz
> kernel image: https://storage.googleapis.com/syzbot-assets/5640d838c887/bzImage-37a93dd5.xz
>
> IMPORTANT: if you fix the issue, please add the following tag to the commit:
> Reported-by: syzbot+b44f2bbe286b9355c563@syzkaller.appspotmail.com
>
> ==================================================================
> BUG: KCSAN: data-race in pfifo_fast_dequeue / pfifo_fast_enqueue
>
> write to 0xffff88811d5ccc00 of 8 bytes by interrupt on cpu 0:
>  __ptr_ring_zero_tail include/linux/ptr_ring.h:259 [inline]
>  __ptr_ring_discard_one include/linux/ptr_ring.h:291 [inline]
>  __ptr_ring_consume include/linux/ptr_ring.h:311 [inline]
>  __skb_array_consume include/linux/skb_array.h:98 [inline]
>  pfifo_fast_dequeue+0x770/0x8f0 net/sched/sch_generic.c:770
>  dequeue_skb net/sched/sch_generic.c:297 [inline]
>  qdisc_restart net/sched/sch_generic.c:402 [inline]
>  __qdisc_run+0x189/0xc80 net/sched/sch_generic.c:420
>  qdisc_run include/net/pkt_sched.h:120 [inline]
>  net_tx_action+0x379/0x590 net/core/dev.c:5793
>  handle_softirqs+0xb9/0x280 kernel/softirq.c:622
>  do_softirq+0x45/0x60 kernel/softirq.c:523
>  __local_bh_enable_ip+0x70/0x80 kernel/softirq.c:450
>  local_bh_enable include/linux/bottom_half.h:33 [inline]
>  bpf_test_run+0x2db/0x620 net/bpf/test_run.c:426
>  bpf_prog_test_run_skb+0x9a4/0xef0 net/bpf/test_run.c:1159
>  bpf_prog_test_run+0x204/0x340 kernel/bpf/syscall.c:4721
>  __sys_bpf+0x52e/0x7e0 kernel/bpf/syscall.c:6246
>  __do_sys_bpf kernel/bpf/syscall.c:6341 [inline]
>  __se_sys_bpf kernel/bpf/syscall.c:6339 [inline]
>  __x64_sys_bpf+0x41/0x50 kernel/bpf/syscall.c:6339
>  x64_sys_call+0x10cb/0x3020 arch/x86/include/generated/asm/syscalls_64.h:322
>  do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
>  do_syscall_64+0x12c/0x370 arch/x86/entry/syscall_64.c:94
>  entry_SYSCALL_64_after_hwframe+0x77/0x7f
>
> read to 0xffff88811d5ccc00 of 8 bytes by task 22632 on cpu 1:
>  __ptr_ring_produce include/linux/ptr_ring.h:106 [inline]
>  ptr_ring_produce include/linux/ptr_ring.h:129 [inline]
>  skb_array_produce include/linux/skb_array.h:44 [inline]
>  pfifo_fast_enqueue+0xd5/0x2c0 net/sched/sch_generic.c:741
>  dev_qdisc_enqueue net/core/dev.c:4144 [inline]
>  __dev_xmit_skb net/core/dev.c:4188 [inline]
>  __dev_queue_xmit+0x6a4/0x1f20 net/core/dev.c:4795
>  dev_queue_xmit include/linux/netdevice.h:3384 [inline]
>  __bpf_tx_skb net/core/filter.c:2153 [inline]
>  __bpf_redirect_common net/core/filter.c:2197 [inline]
>  __bpf_redirect+0x862/0x990 net/core/filter.c:2204
>  ____bpf_clone_redirect net/core/filter.c:2487 [inline]
>  bpf_clone_redirect+0x20c/0x290 net/core/filter.c:2450
>  bpf_prog_53f18857bc887b09+0x22/0x2a
>  bpf_dispatcher_nop_func include/linux/bpf.h:1402 [inline]
>  __bpf_prog_run include/linux/filter.h:723 [inline]
>  bpf_prog_run include/linux/filter.h:730 [inline]
>  bpf_test_run+0x29d/0x620 net/bpf/test_run.c:423
>  bpf_prog_test_run_skb+0x9a4/0xef0 net/bpf/test_run.c:1159
>  bpf_prog_test_run+0x204/0x340 kernel/bpf/syscall.c:4721
>  __sys_bpf+0x52e/0x7e0 kernel/bpf/syscall.c:6246
>  __do_sys_bpf kernel/bpf/syscall.c:6341 [inline]
>  __se_sys_bpf kernel/bpf/syscall.c:6339 [inline]
>  __x64_sys_bpf+0x41/0x50 kernel/bpf/syscall.c:6339
>  x64_sys_call+0x10cb/0x3020 arch/x86/include/generated/asm/syscalls_64.h:322
>  do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
>  do_syscall_64+0x12c/0x370 arch/x86/entry/syscall_64.c:94
>  entry_SYSCALL_64_after_hwframe+0x77/0x7f
>
> value changed: 0xffff888104a93a00 -> 0x0000000000000000
>
> Reported by Kernel Concurrency Sanitizer on:
> CPU: 1 UID: 0 PID: 22632 Comm: syz.0.4135 Tainted: G        W           syzkaller #0 PREEMPT(full)
> Tainted: [W]=WARN
> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/24/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 syzkaller@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

CC Michael for this KCSAN report.

I suggested

diff --git a/include/linux/ptr_ring.h b/include/linux/ptr_ring.h
index 534531807d95d0d2a9aa1afea918bfce49a67b32..21b49c55cfcf82ddfcb5df98e324dd12c47f9a9d
100644
--- a/include/linux/ptr_ring.h
+++ b/include/linux/ptr_ring.h
@@ -103,7 +103,7 @@ static inline bool ptr_ring_full_bh(struct ptr_ring *r)
  */
 static inline int __ptr_ring_produce(struct ptr_ring *r, void *ptr)
 {
-       if (unlikely(!r->size) || r->queue[r->producer])
+       if (unlikely(!r->size) || READ_ONCE(r->queue[r->producer]))
                return -ENOSPC;

        /* Make sure the pointer we are storing points to a valid data. */
@@ -194,7 +194,7 @@ static inline void *__ptr_ring_peek(struct ptr_ring *r)
 static inline bool __ptr_ring_empty(struct ptr_ring *r)
 {
        if (likely(r->size))
-               return !r->queue[READ_ONCE(r->consumer_head)];
+               return !READ_ONCE(r->queue[READ_ONCE(r->consumer_head)]);
        return true;
 }

@@ -256,7 +256,7 @@ static inline void __ptr_ring_zero_tail(struct
ptr_ring *r, int consumer_head)
         * besides the first one until we write out all entries.
         */
        while (likely(head > r->consumer_tail))
-               r->queue[--head] = NULL;
+               WRITE_ONCE(r->queue[--head], NULL);

        r->consumer_tail = consumer_head;
 }

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-03-12 15:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-12 15:26 [syzbot] [net?] KCSAN: data-race in pfifo_fast_dequeue / pfifo_fast_enqueue (6) syzbot
2026-03-12 15:30 ` Eric Dumazet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox