diff options
author | Jason Xing <kernelxing@tencent.com> | 2024-03-04 11:20:46 +0300 |
---|---|---|
committer | Paolo Abeni <pabeni@redhat.com> | 2024-03-07 12:36:58 +0300 |
commit | d380ce70058a4ccddc3e5f5c2063165dc07672c6 (patch) | |
tree | ad0a8a154549588ac2cd43df7a51461b54fbb856 /net/netrom/nr_in.c | |
parent | bc76645ebdd01be9b9994dac39685a3d0f6f7985 (diff) | |
download | linux-d380ce70058a4ccddc3e5f5c2063165dc07672c6.tar.xz |
netrom: Fix data-races around sysctl_net_busy_read
We need to protect the reader reading the sysctl value 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_in.c')
-rw-r--r-- | net/netrom/nr_in.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/netrom/nr_in.c b/net/netrom/nr_in.c index 2f084b6f69d7..97944db6b5ac 100644 --- a/net/netrom/nr_in.c +++ b/net/netrom/nr_in.c @@ -97,7 +97,7 @@ static int nr_state1_machine(struct sock *sk, struct sk_buff *skb, break; case NR_RESET: - if (sysctl_netrom_reset_circuit) + if (READ_ONCE(sysctl_netrom_reset_circuit)) nr_disconnect(sk, ECONNRESET); break; @@ -128,7 +128,7 @@ static int nr_state2_machine(struct sock *sk, struct sk_buff *skb, break; case NR_RESET: - if (sysctl_netrom_reset_circuit) + if (READ_ONCE(sysctl_netrom_reset_circuit)) nr_disconnect(sk, ECONNRESET); break; @@ -262,7 +262,7 @@ static int nr_state3_machine(struct sock *sk, struct sk_buff *skb, int frametype break; case NR_RESET: - if (sysctl_netrom_reset_circuit) + if (READ_ONCE(sysctl_netrom_reset_circuit)) nr_disconnect(sk, ECONNRESET); break; |