* [PATCH] netlink: validate addr_len on bind
@ 2012-12-16 1:42 Hannes Frederic Sowa
2012-12-18 4:52 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Hannes Frederic Sowa @ 2012-12-16 1:42 UTC (permalink / raw)
To: netdev
Otherwise an out of bounds read could happen.
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
---
net/netlink/af_netlink.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index fdb7494..5321bab 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -669,6 +669,9 @@ static int netlink_bind(struct socket *sock, struct sockaddr *addr,
struct sockaddr_nl *nladdr = (struct sockaddr_nl *)addr;
int err;
+ if (addr_len < sizeof(struct sockaddr_nl))
+ return -EINVAL;
+
if (nladdr->nl_family != AF_NETLINK)
return -EINVAL;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] netlink: validate addr_len on bind
2012-12-16 1:42 [PATCH] netlink: validate addr_len on bind Hannes Frederic Sowa
@ 2012-12-18 4:52 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2012-12-18 4:52 UTC (permalink / raw)
To: hannes; +Cc: netdev
From: Hannes Frederic Sowa <hannes@stressinduktion.org>
Date: Sun, 16 Dec 2012 02:42:19 +0100
> Otherwise an out of bounds read could happen.
>
> Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-12-18 4:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-16 1:42 [PATCH] netlink: validate addr_len on bind Hannes Frederic Sowa
2012-12-18 4:52 ` 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).