summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKuniyuki Iwashima <kuniyu@amazon.com>2022-08-23 10:46:58 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-08-31 17:18:10 +0200
commit21c6c135354aca32676b0e94420b3b74c4194966 (patch)
tree8a4deb864c1368372e8138e7cf94ebb92e25704c /include
parentbdb33552e663f2aafa2678684c9b665cfac3e246 (diff)
downloadlinux-21c6c135354aca32676b0e94420b3b74c4194966.tar.gz
linux-21c6c135354aca32676b0e94420b3b74c4194966.tar.bz2
linux-21c6c135354aca32676b0e94420b3b74c4194966.zip
net: Fix a data-race around gro_normal_batch.
[ Upstream commit 8db24af3f02ebdbf302196006ebb270c4c3a2706 ] While reading gro_normal_batch, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader. Fixes: 323ebb61e32b ("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: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/net/gro.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/net/gro.h b/include/net/gro.h
index 867656b0739c..24003dea8fa4 100644
--- a/include/net/gro.h
+++ b/include/net/gro.h
@@ -439,7 +439,7 @@ static inline void gro_normal_one(struct napi_struct *napi, struct sk_buff *skb,
{
list_add_tail(&skb->list, &napi->rx_list);
napi->rx_count += segs;
- if (napi->rx_count >= gro_normal_batch)
+ if (napi->rx_count >= READ_ONCE(gro_normal_batch))
gro_normal_list(napi);
}