net: sock: validate data_len before allocating skb in sock_alloc_send_pskb()
From: Jason Wang <jasowang@redhat.com>
CVE-2012-2136
BugLink: http://bugs.launchpad.net/bugs/1006622
We need to validate the number of pages consumed by data_len, otherwise frags
array could be overflowed by userspace. So this patch validate data_len and
return -EMSGSIZE when data_len may occupies more frags than MAX_SKB_FRAGS.
Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit cc9b17ad29ecaa20bfe426a8d4dbfb94b13ff1cc)
Signed-off-by: Brad Figg <brad.figg@canonical.com>
---
debian/binary-custom.d/xen/src/net/core/sock.c | 7 +++++--
net/core/sock.c | 7 +++++--
2 files changed, 10 insertions(+), 4 deletions(-)