From: Jason Xing <kerneljasonxing@gmail•com>
To: ralf@linux-mips•org, davem@davemloft•net, edumazet@google•com,
kuba@kernel•org, pabeni@redhat•com
Cc: linux-hams@vger•kernel.org, netdev@vger•kernel.org,
kerneljasonxing@gmail•com, Jason Xing <kernelxing@tencent•com>
Subject: [PATCH net 01/12] netrom: Fix a data-race around sysctl_netrom_default_path_quality
Date: Mon, 4 Mar 2024 16:20:35 +0800 [thread overview]
Message-ID: <20240304082046.64977-2-kerneljasonxing@gmail.com> (raw)
In-Reply-To: <20240304082046.64977-1-kerneljasonxing@gmail.com>
From: Jason Xing <kernelxing@tencent•com>
We need to protect the reader reading sysctl_netrom_default_path_quality
because the value can be changed concurrently.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Jason Xing <kernelxing@tencent•com>
---
net/netrom/nr_route.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/netrom/nr_route.c b/net/netrom/nr_route.c
index baea3cbd76ca..6f709fdffc11 100644
--- a/net/netrom/nr_route.c
+++ b/net/netrom/nr_route.c
@@ -153,7 +153,7 @@ static int __must_check nr_add_node(ax25_address *nr, const char *mnemonic,
nr_neigh->digipeat = NULL;
nr_neigh->ax25 = NULL;
nr_neigh->dev = dev;
- nr_neigh->quality = sysctl_netrom_default_path_quality;
+ nr_neigh->quality = READ_ONCE(sysctl_netrom_default_path_quality);
nr_neigh->locked = 0;
nr_neigh->count = 0;
nr_neigh->number = nr_neigh_no++;
--
2.37.3
next prev parent reply other threads:[~2024-03-04 8:20 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-04 8:20 [PATCH net 00/12] netrom: Fix all the data-races around sysctls Jason Xing
2024-03-04 8:20 ` Jason Xing [this message]
2024-03-04 8:20 ` [PATCH net 02/12] netrom: Fix a data-race around sysctl_netrom_obsolescence_count_initialiser Jason Xing
2024-03-04 8:20 ` [PATCH net 03/12] netrom: Fix data-races around sysctl_netrom_network_ttl_initialiser Jason Xing
2024-03-04 8:20 ` [PATCH net 04/12] netrom: Fix a data-race around sysctl_netrom_transport_timeout Jason Xing
2024-03-04 8:20 ` [PATCH net 05/12] netrom: Fix a data-race around sysctl_netrom_transport_maximum_tries Jason Xing
2024-03-04 8:20 ` [PATCH net 06/12] netrom: Fix a data-race around sysctl_netrom_transport_acknowledge_delay Jason Xing
2024-03-04 8:20 ` [PATCH net 07/12] netrom: Fix a data-race around sysctl_netrom_transport_busy_delay Jason Xing
2024-03-04 8:20 ` [PATCH net 08/12] netrom: Fix a data-race around sysctl_netrom_transport_requested_window_size Jason Xing
2024-03-04 8:20 ` [PATCH net 09/12] netrom: Fix a data-race around sysctl_netrom_transport_no_activity_timeout Jason Xing
2024-03-04 8:20 ` [PATCH net 10/12] netrom: Fix a data-race around sysctl_netrom_routing_control Jason Xing
2024-03-04 8:20 ` [PATCH net 11/12] netrom: Fix a data-race around sysctl_netrom_link_fails_count Jason Xing
2024-03-04 8:20 ` [PATCH net 12/12] netrom: Fix data-races around sysctl_net_busy_read Jason Xing
2024-03-07 9:36 ` [PATCH net 00/12] netrom: Fix all the data-races around sysctls Paolo Abeni
2024-03-07 9:43 ` Jason Xing
2024-03-07 10:00 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240304082046.64977-2-kerneljasonxing@gmail.com \
--to=kerneljasonxing@gmail$(echo .)com \
--cc=davem@davemloft$(echo .)net \
--cc=edumazet@google$(echo .)com \
--cc=kernelxing@tencent$(echo .)com \
--cc=kuba@kernel$(echo .)org \
--cc=linux-hams@vger$(echo .)kernel.org \
--cc=netdev@vger$(echo .)kernel.org \
--cc=pabeni@redhat$(echo .)com \
--cc=ralf@linux-mips$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox