diff options
author | Paolo Abeni | 2024-03-07 10:37:00 +0100 |
---|---|---|
committer | Paolo Abeni | 2024-03-07 10:37:01 +0100 |
commit | 6d673e86cd6514eda76529d2cab9c4fda7bbd5be (patch) | |
tree | ad0a8a154549588ac2cd43df7a51461b54fbb856 /net/netrom/nr_in.c | |
parent | 811b3f9b2ab529d1b9605290c2231be7f447d59b (diff) | |
parent | d380ce70058a4ccddc3e5f5c2063165dc07672c6 (diff) |
Merge branch 'netrom-fix-all-the-data-races-around-sysctls'
Jason Xing says:
====================
netrom: Fix all the data-races around sysctls
As the title said, in this patchset I fix the data-race issues because
the writer and the reader can manipulate the same value concurrently.
====================
Link: https://lore.kernel.org/r/20240304082046.64977-1-kerneljasonxing@gmail.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; |