aboutsummaryrefslogtreecommitdiff
path: root/net/ipv4/igmp.c
diff options
context:
space:
mode:
authorGravatar Kuniyuki Iwashima <kuniyu@amazon.com> 2022-07-15 10:17:43 -0700
committerGravatar David S. Miller <davem@davemloft.net> 2022-07-18 12:21:53 +0100
commit6ae0f2e553737b8cce49a1372573c81130ffa80e (patch)
treeed097342e1a58c0ad98745decdc2a8616580a197 /net/ipv4/igmp.c
parentigmp: Fix a data-race around sysctl_igmp_max_memberships. (diff)
downloadlinux-6ae0f2e553737b8cce49a1372573c81130ffa80e.tar.gz
linux-6ae0f2e553737b8cce49a1372573c81130ffa80e.tar.bz2
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.c2
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;
}