summaryrefslogtreecommitdiffstats
path: root/net/netrom/nr_route.c
diff options
context:
space:
mode:
authorJason Xing <kernelxing@tencent.com>2024-03-04 09:20:35 +0100
committerPaolo Abeni <pabeni@redhat.com>2024-03-07 10:36:58 +0100
commit958d6145a6d9ba9e075c921aead8753fb91c9101 (patch)
treef4c1221797eaad09a98d94b12e3a771c9ccd9ab4 /net/netrom/nr_route.c
parentMerge tag 'ipsec-2024-03-06' of git://git.kernel.org/pub/scm/linux/kernel/git... (diff)
downloadlinux-958d6145a6d9ba9e075c921aead8753fb91c9101.tar.xz
linux-958d6145a6d9ba9e075c921aead8753fb91c9101.zip
netrom: Fix a data-race around sysctl_netrom_default_path_quality
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> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'net/netrom/nr_route.c')
-rw-r--r--net/netrom/nr_route.c2
1 files changed, 1 insertions, 1 deletions
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++;