/[packages]/backports/8/kernel/current/SOURCES/net-fix-a-data-race-around-netdev_budget.patch
ViewVC logotype

Contents of /backports/8/kernel/current/SOURCES/net-fix-a-data-race-around-netdev_budget.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1881590 - (show annotations) (download)
Mon Aug 29 03:49:40 2022 UTC (19 months, 3 weeks ago) by tmb
File size: 1202 byte(s)
- add current -stable queue
- io_uring: fix issue with io_write() not always undoing sb_start_write()
- HID: input: fix uclogic tablets


1 From b33f86643b2928077ff7c409c9da2979aa300837 Mon Sep 17 00:00:00 2001
2 From: Sasha Levin <sashal@kernel.org>
3 Date: Tue, 23 Aug 2022 10:46:53 -0700
4 Subject: net: Fix a data-race around netdev_budget.
5
6 From: Kuniyuki Iwashima <kuniyu@amazon.com>
7
8 [ Upstream commit 2e0c42374ee32e72948559d2ae2f7ba3dc6b977c ]
9
10 While reading netdev_budget, it can be changed concurrently.
11 Thus, we need to add READ_ONCE() to its reader.
12
13 Fixes: 51b0bdedb8e7 ("[NET]: Separate two usages of netdev_max_backlog.")
14 Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
15 Signed-off-by: David S. Miller <davem@davemloft.net>
16 Signed-off-by: Sasha Levin <sashal@kernel.org>
17 ---
18 net/core/dev.c | 2 +-
19 1 file changed, 1 insertion(+), 1 deletion(-)
20
21 diff --git a/net/core/dev.c b/net/core/dev.c
22 index 34282b93c3f60..a330f93629314 100644
23 --- a/net/core/dev.c
24 +++ b/net/core/dev.c
25 @@ -6647,7 +6647,7 @@ static __latent_entropy void net_rx_action(struct softirq_action *h)
26 struct softnet_data *sd = this_cpu_ptr(&softnet_data);
27 unsigned long time_limit = jiffies +
28 usecs_to_jiffies(netdev_budget_usecs);
29 - int budget = netdev_budget;
30 + int budget = READ_ONCE(netdev_budget);
31 LIST_HEAD(list);
32 LIST_HEAD(repoll);
33
34 --
35 2.35.1
36

  ViewVC Help
Powered by ViewVC 1.1.30