diff options
author | Kuniyuki Iwashima <kuniyu@amazon.com> | 2022-07-15 19:17:43 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-07-18 13:21:53 +0200 |
commit | 6ae0f2e553737b8cce49a1372573c81130ffa80e (patch) | |
tree | ed097342e1a58c0ad98745decdc2a8616580a197 /net/ipv4/igmp.c | |
parent | igmp: Fix a data-race around sysctl_igmp_max_memberships. (diff) | |
download | linux-6ae0f2e553737b8cce49a1372573c81130ffa80e.tar.xz linux-6ae0f2e553737b8cce49a1372573c81130ffa80e.zip |
igmp: Fix data-races around sysctl_igmp_max_msf.
While reading sysctl_igmp_max_msf, it can be changed concurrently.
Thus, we need to add READ_ONCE() to its readers.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/igmp.c')
-rw-r--r-- | net/ipv4/igmp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c index 792ea1b56b9e..cd7839db34da 100644 --- a/net/ipv4/igmp.c +++ b/net/ipv4/igmp.c @@ -2384,7 +2384,7 @@ int ip_mc_source(int add, int omode, struct sock *sk, struct } /* else, add a new source to the filter */ - if (psl && psl->sl_count >= net->ipv4.sysctl_igmp_max_msf) { + if (psl && psl->sl_count >= READ_ONCE(net->ipv4.sysctl_igmp_max_msf)) { err = -ENOBUFS; goto done; } |