]> git.baikalelectronics.ru Git - kernel.git/commit
net: sock: validate data_len before allocating skb in sock_alloc_send_pskb()
authorJason Wang <jasowang@redhat.com>
Wed, 30 May 2012 21:18:10 +0000 (21:18 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 31 May 2012 22:22:45 +0000 (18:22 -0400)
commit331055cf8f2cb439f056fdceec414c1e00b4681b
treedbf402b10788ab22d1d9d8c14866a910be497c29
parent2b529b31daa388c9edf90fd457fa739629c238b3
net: sock: validate data_len before allocating skb in sock_alloc_send_pskb()

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>
net/core/sock.c