[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20120205220953.002657616@pcw.home.local>
Date: Sun, 05 Feb 2012 23:11:12 +0100
From: Willy Tarreau <w@....eu>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org
Cc: Marcus Meissner <meissner@...e.de>, Reinhard Max <max@...e.de>,
"David S. Miller" <davem@...emloft.net>,
Greg KH <gregkh@...uxfoundation.org>
Subject: [PATCH 83/91] net/ipv4: Check for mistakenly passed in non-IPv4 address
2.6.27-longterm review patch. If anyone has any objections, please let us know.
------------------
[ Upstream commit d0733d2e29b652b2e7b1438ececa732e4eed98eb ]
Check against mistakenly passing in IPv6 addresses (which would result
in an INADDR_ANY bind) or similar incompatible sockaddrs.
Signed-off-by: Marcus Meissner <meissner@...e.de>
Cc: Reinhard Max <max@...e.de>
Signed-off-by: David S. Miller <davem@...emloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@...e.de>
---
net/ipv4/af_inet.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
Index: longterm-2.6.27/net/ipv4/af_inet.c
===================================================================
--- longterm-2.6.27.orig/net/ipv4/af_inet.c 2012-02-05 22:34:32.462915223 +0100
+++ longterm-2.6.27/net/ipv4/af_inet.c 2012-02-05 22:34:46.727915859 +0100
@@ -458,6 +458,9 @@
if (addr_len < sizeof(struct sockaddr_in))
goto out;
+ if (addr->sin_family != AF_INET)
+ goto out;
+
chk_addr_ret = inet_addr_type(sock_net(sk), addr->sin_addr.s_addr);
/* Not specified by any standard per-se, however it breaks too
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists