Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ipv4: use check_net()

Don't directly acess the namespace count. There's even a dedicated
helper for this.

Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christian Brauner <brauner@kernel.org>

+3 -3
+2 -2
net/ipv4/inet_timewait_sock.c
··· 329 329 TCPF_NEW_SYN_RECV)) 330 330 continue; 331 331 332 - if (refcount_read(&sock_net(sk)->ns.count)) 332 + if (check_net(sock_net(sk))) 333 333 continue; 334 334 335 335 if (unlikely(!refcount_inc_not_zero(&sk->sk_refcnt))) 336 336 continue; 337 337 338 - if (refcount_read(&sock_net(sk)->ns.count)) { 338 + if (check_net(sock_net(sk))) { 339 339 sock_gen_put(sk); 340 340 goto restart; 341 341 }
+1 -1
net/ipv4/tcp_metrics.c
··· 912 912 spin_lock_bh(&tcp_metrics_lock); 913 913 for (tm = deref_locked(*pp); tm; tm = deref_locked(*pp)) { 914 914 match = net ? net_eq(tm_net(tm), net) : 915 - !refcount_read(&tm_net(tm)->ns.count); 915 + !check_net(tm_net(tm)); 916 916 if (match) { 917 917 rcu_assign_pointer(*pp, tm->tcpm_next); 918 918 kfree_rcu(tm, rcu_head);