kernel/generic: add a few missing kernel config symbols
[openwrt/svn-archive/archive.git] / target / linux / generic / patches-3.3 / 090-CVE-2013-1763.patch
1 From 6e601a53566d84e1ffd25e7b6fe0b6894ffd79c0 Mon Sep 17 00:00:00 2001
2 From: Mathias Krause <minipli@googlemail.com>
3 Date: Sat, 23 Feb 2013 01:13:47 +0000
4 Subject: sock_diag: Fix out-of-bounds access to sock_diag_handlers[]
5
6 Userland can send a netlink message requesting SOCK_DIAG_BY_FAMILY
7 with a family greater or equal then AF_MAX -- the array size of
8 sock_diag_handlers[]. The current code does not test for this
9 condition therefore is vulnerable to an out-of-bound access opening
10 doors for a privilege escalation.
11
12 Signed-off-by: Mathias Krause <minipli@googlemail.com>
13 Acked-by: Eric Dumazet <edumazet@google.com>
14 Signed-off-by: David S. Miller <davem@davemloft.net>
15 ---
16 --- a/net/core/sock_diag.c
17 +++ b/net/core/sock_diag.c
18 @@ -126,6 +126,9 @@ static int __sock_diag_rcv_msg(struct sk
19 if (nlmsg_len(nlh) < sizeof(*req))
20 return -EINVAL;
21
22 + if (req->sdiag_family >= AF_MAX)
23 + return -EINVAL;
24 +
25 hndl = sock_diag_lock_handler(req->sdiag_family);
26 if (hndl == NULL)
27 err = -ENOENT;