All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] netns: Don't leak others' openreq-s in proc
@ 2010-11-22 13:26 Pavel Emelyanov
  2010-11-28  6:58 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Pavel Emelyanov @ 2010-11-22 13:26 UTC (permalink / raw)
  To: David Miller, Linux Netdev List

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

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>

---

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;
 		}

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] netns: Don't leak others' openreq-s in proc
  2010-11-22 13:26 [PATCH] netns: Don't leak others' openreq-s in proc Pavel Emelyanov
@ 2010-11-28  6:58 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2010-11-28  6:58 UTC (permalink / raw)
  To: xemul; +Cc: netdev

From: Pavel Emelyanov <xemul@parallels.com>
Date: Mon, 22 Nov 2010 16:26:12 +0300

> The /proc/net/tcp leaks openreq sockets from other namespaces.
> 
> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>

Applied to net-2.6, thanks!

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-11-28  6:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-22 13:26 [PATCH] netns: Don't leak others' openreq-s in proc Pavel Emelyanov
2010-11-28  6:58 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.