diff mbox

[Quantal/Raring,1/1,CVE-2013-1763] sock_diag: Fix out-of-bounds access to sock_diag_handlers[]

Message ID 1361814341-13102-1-git-send-email-brad.figg@canonical.com
State New
Headers show

Commit Message

Brad Figg Feb. 25, 2013, 5:45 p.m. UTC
From: Mathias Krause <minipli@googlemail.com>

CVE-2013-1763

BugLink: http://bugs.launchpad.net/bugs/1132896

Signed-off-by: Mathias Krause <minipli@googlemail.com>

Signed-off-by: Brad Figg <brad.figg@canonical.com>
Signed-off-by: Steve Conklin <sconklin@canonical.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
---
 net/core/sock_diag.c |    3 +++
 1 file changed, 3 insertions(+)
diff mbox

Patch

diff --git a/net/core/sock_diag.c b/net/core/sock_diag.c
index 5fd1467..964a92c 100644
--- a/net/core/sock_diag.c
+++ b/net/core/sock_diag.c
@@ -126,6 +126,9 @@  static int __sock_diag_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
 	if (nlmsg_len(nlh) < sizeof(*req))
 		return -EINVAL;
 
+	if (req->sdiag_family >= AF_MAX)
+		return -EINVAL;
+
 	hndl = sock_diag_lock_handler(req->sdiag_family);
 	if (hndl == NULL)
 		err = -ENOENT;