summaryrefslogtreecommitdiff
path: root/net/netrom/nr_route.c
diff options
context:
space:
mode:
authorJason Xing <kernelxing@tencent.com>2024-03-04 11:20:35 +0300
committerSasha Levin <sashal@kernel.org>2024-03-15 17:48:16 +0300
commite041df5dc9e68adffcba5499ca28e1252bed6f4b (patch)
treea9b36ede3942abc44a2b9a967b1a29811d39fddc /net/netrom/nr_route.c
parentccd1108b16ab572d9bf635586b0925635dbd6bbc (diff)
downloadlinux-e041df5dc9e68adffcba5499ca28e1252bed6f4b.tar.xz
netrom: Fix a data-race around sysctl_netrom_default_path_quality
[ Upstream commit 958d6145a6d9ba9e075c921aead8753fb91c9101 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
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 78da5eab252a..94c4d4554b9c 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++;