diff options
author | Kuniyuki Iwashima <kuniyu@amazon.com> | 2022-07-13 22:51:59 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-07-15 12:49:55 +0200 |
commit | 08a75f10679470552a3a443f9aefd1399604d31d (patch) | |
tree | fd9b511dd71501ff5aacc4a0c3a842800c86fbbd /include/net/inet_hashtables.h | |
parent | tcp/dccp: Fix a data-race around sysctl_tcp_fwmark_accept. (diff) | |
download | linux-08a75f10679470552a3a443f9aefd1399604d31d.tar.xz linux-08a75f10679470552a3a443f9aefd1399604d31d.zip |
tcp: Fix data-races around sysctl_tcp_l3mdev_accept.
While reading sysctl_tcp_l3mdev_accept, it can be changed concurrently.
Thus, we need to add READ_ONCE() to its readers.
Fixes: 6dd9a14e92e5 ("net: Allow accepted sockets to be bound to l3mdev domain")
Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/inet_hashtables.h')
-rw-r--r-- | include/net/inet_hashtables.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h index ebfa3df6f8dc..fd6b510d114b 100644 --- a/include/net/inet_hashtables.h +++ b/include/net/inet_hashtables.h @@ -179,7 +179,7 @@ static inline bool inet_sk_bound_dev_eq(struct net *net, int bound_dev_if, int dif, int sdif) { #if IS_ENABLED(CONFIG_NET_L3_MASTER_DEV) - return inet_bound_dev_eq(!!net->ipv4.sysctl_tcp_l3mdev_accept, + return inet_bound_dev_eq(!!READ_ONCE(net->ipv4.sysctl_tcp_l3mdev_accept), bound_dev_if, dif, sdif); #else return inet_bound_dev_eq(true, bound_dev_if, dif, sdif); |