Skip to content

Commit c8fae68

Browse files
author
Guillaume Nault
committed
net: Fix a data-race around gro_normal_batch.
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2160073 Upstream Status: linux.git commit 8db24af Author: Kuniyuki Iwashima <kuniyu@amazon.com> Date: Tue Aug 23 10:46:58 2022 -0700 net: Fix a data-race around gro_normal_batch. While reading gro_normal_batch, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader. Fixes: 323ebb6 ("net: use listified RX for handling GRO_NORMAL skbs") Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com> Acked-by: Edward Cree <ecree.xilinx@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Guillaume Nault <gnault@redhat.com>
1 parent fec8ca6 commit c8fae68

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/net/gro.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ static inline void gro_normal_one(struct napi_struct *napi, struct sk_buff *skb,
434434
{
435435
list_add_tail(&skb->list, &napi->rx_list);
436436
napi->rx_count += segs;
437-
if (napi->rx_count >= gro_normal_batch)
437+
if (napi->rx_count >= READ_ONCE(gro_normal_batch))
438438
gro_normal_list(napi);
439439
}
440440

0 commit comments

Comments
 (0)