Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: annotate a data-race in __dev_xmit_skb()

q->limit is read locklessly, add a READ_ONCE().

Fixes: 100dfa74cad9 ("net: dev_queue_xmit() llist adoption")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20251121083256.674562-12-edumazet@google.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>

authored by

Eric Dumazet and committed by
Paolo Abeni
4792c3a4 b2e9821c

+1 -1
+1 -1
net/core/dev.c
··· 4194 4194 do { 4195 4195 if (first_n && !defer_count) { 4196 4196 defer_count = atomic_long_inc_return(&q->defer_count); 4197 - if (unlikely(defer_count > q->limit)) { 4197 + if (unlikely(defer_count > READ_ONCE(q->limit))) { 4198 4198 kfree_skb_reason(skb, SKB_DROP_REASON_QDISC_DROP); 4199 4199 return NET_XMIT_DROP; 4200 4200 }