From: Pavel Emelyanov Date: Mon, 22 Nov 2010 03:26:12 +0000 (+0000) Subject: netns: Don't leak others' openreq-s in proc X-Git-Tag: v3.12-rc1~7905^2~93 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8475ef9fd16cadbfc692f78e608d1941a340beb2;p=kernel%2Fkernel-generic.git netns: Don't leak others' openreq-s in proc The /proc/net/tcp leaks openreq sockets from other namespaces. Signed-off-by: Pavel Emelyanov Signed-off-by: David S. Miller --- diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 69ccbc1..e13da6d 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c @@ -2043,7 +2043,9 @@ get_req: } get_sk: sk_nulls_for_each_from(sk, node) { - if (sk->sk_family == st->family && net_eq(sock_net(sk), net)) { + if (!net_eq(sock_net(sk), net)) + continue; + if (sk->sk_family == st->family) { cur = sk; goto out; }