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

login
register
mail settings
Submitter Brad Figg
Date Feb. 25, 2013, 5:45 p.m.
Message ID <1361814341-13102-1-git-send-email-brad.figg@canonical.com>
Download mbox | patch
Permalink /patch/222981/
State New
Headers show

Comments

Brad Figg - Feb. 25, 2013, 5:45 p.m.
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(+)

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;