summaryrefslogtreecommitdiffstats
path: root/main/linux-grsec/0001-sock_diag-Fix-out-of-bounds-access-to-sock_diag_hand.patch
diff options
context:
space:
mode:
Diffstat (limited to 'main/linux-grsec/0001-sock_diag-Fix-out-of-bounds-access-to-sock_diag_hand.patch')
-rw-r--r--main/linux-grsec/0001-sock_diag-Fix-out-of-bounds-access-to-sock_diag_hand.patch36
1 files changed, 36 insertions, 0 deletions
diff --git a/main/linux-grsec/0001-sock_diag-Fix-out-of-bounds-access-to-sock_diag_hand.patch b/main/linux-grsec/0001-sock_diag-Fix-out-of-bounds-access-to-sock_diag_hand.patch
new file mode 100644
index 000000000..9124b975d
--- /dev/null
+++ b/main/linux-grsec/0001-sock_diag-Fix-out-of-bounds-access-to-sock_diag_hand.patch
@@ -0,0 +1,36 @@
+From ecc18050ef1ebd1dd63ebab44297d09a48360fc5 Mon Sep 17 00:00:00 2001
+From: Mathias Krause <minipli@googlemail.com>
+Date: Sat, 23 Feb 2013 01:13:47 +0000
+Subject: [PATCH 1/2] sock_diag: Fix out-of-bounds access to
+ sock_diag_handlers[]
+
+Userland can send a netlink message requesting SOCK_DIAG_BY_FAMILY
+with a family greater or equal then AF_MAX -- the array size of
+sock_diag_handlers[]. The current code does not test for this
+condition therefore is vulnerable to an out-of-bound access opening
+doors for a privilege escalation.
+
+Signed-off-by: Mathias Krause <minipli@googlemail.com>
+Acked-by: Eric Dumazet <edumazet@google.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ net/core/sock_diag.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/net/core/sock_diag.c b/net/core/sock_diag.c
+index 849f809..5e8d4a9 100644
+--- a/net/core/sock_diag.c
++++ b/net/core/sock_diag.c
+@@ -133,6 +133,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;
+--
+1.8.1.4
+