sock_diag: Fix out-of-bounds access to sock_diag_handlers[]
authorMathias Krause <minipli@googlemail.com>
Sat, 23 Feb 2013 01:13:47 +0000 (01:13 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sat, 23 Feb 2013 18:51:54 +0000 (13:51 -0500)
commit6e601a53566d84e1ffd25e7b6fe0b6894ffd79c0
treefb4a77a604c2cd35d53ec2600b9bf612a47407ef
parentc9b20a5effcb29acf0f8a2a31c875073b2a0c74e
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