diff options
author | Pavel Emelyanov <xemul@parallels.com> | 2010-11-22 04:26:12 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-11-28 07:57:48 +0100 |
commit | 8475ef9fd16cadbfc692f78e608d1941a340beb2 (patch) | |
tree | 6e582cc6eed642094c87fd1075bc0d7eade41602 | |
parent | Net: ceph: Makefile: Remove unnessary code (diff) | |
download | linux-8475ef9fd16cadbfc692f78e608d1941a340beb2.tar.xz linux-8475ef9fd16cadbfc692f78e608d1941a340beb2.zip |
netns: Don't leak others' openreq-s in proc
The /proc/net/tcp leaks openreq sockets from other namespaces.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/ipv4/tcp_ipv4.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 69ccbc1dde9c..e13da6de1fc7 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; } |