netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next-2.6] [TPROXY] fixes a possible read from an unmapped location in the socket match
@ 2008-12-07 10:16 Balazs Scheidler
  2008-12-08  7:54 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Balazs Scheidler @ 2008-12-07 10:16 UTC (permalink / raw)
  To: davem, netdev

	TIME_WAIT sockets need to be handled specially, and the socket match
	casted inet_timewait_sock instances to inet_sock, which are not
	compatible. Handle this special case by checking sk->sk_state.
---
 net/netfilter/xt_socket.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/netfilter/xt_socket.c b/net/netfilter/xt_socket.c
index 0e03922..1d521a5 100644
--- a/net/netfilter/xt_socket.c
+++ b/net/netfilter/xt_socket.c
@@ -144,7 +144,7 @@ socket_mt(const struct sk_buff *skb, const struct xt_match_param *par)
 	sk = nf_tproxy_get_sock_v4(dev_net(skb->dev), protocol,
 				   saddr, daddr, sport, dport, par->in, false);
 	if (sk != NULL) {
-		bool wildcard = (inet_sk(sk)->rcv_saddr == 0);
+		bool wildcard = (sk->sk_state != TCP_TIME_WAIT && inet_sk(sk)->rcv_saddr == 0);
 
 		nf_tproxy_put_sock(sk);
 		if (wildcard)
-- 
1.5.6.3



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

* Re: [PATCH net-next-2.6] [TPROXY] fixes a possible read from an unmapped location in the socket match
  2008-12-07 10:16 [PATCH net-next-2.6] [TPROXY] fixes a possible read from an unmapped location in the socket match Balazs Scheidler
@ 2008-12-08  7:54 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2008-12-08  7:54 UTC (permalink / raw)
  To: bazsi; +Cc: netdev

From: Balazs Scheidler <bazsi@balabit.hu>
Date: Sun, 7 Dec 2008 11:16:53 +0100

> 	TIME_WAIT sockets need to be handled specially, and the socket match
> 	casted inet_timewait_sock instances to inet_sock, which are not
> 	compatible. Handle this special case by checking sk->sk_state.

There is no need to send this seperate version of the patch,
the bug fix will propagate automatically when I next merge
net-2.6 into net-next-2.6

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

end of thread, other threads:[~2008-12-08  7:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-07 10:16 [PATCH net-next-2.6] [TPROXY] fixes a possible read from an unmapped location in the socket match Balazs Scheidler
2008-12-08  7:54 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).