Skip to contentSkip to conversation

netns: Don't leak others' openreq-s in proc

PATCH Applied Pavel Emelyanov 2 participants 2 messages Nov 22, 2010 – Nov 28, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 netns: Don't leak others' openreq-s in proc

The /proc/net/tcp leaks openreq sockets from other namespaces.

---

net/ipv4/tcp_ipv4.c +3 -1
index 69ccbc1..e13da6d 100644
@@ -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;
 		}