]> git.karo-electronics.de Git - karo-tx-linux.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)
committerOliver Wendt <ow@karo-electronics.de>
Mon, 30 Sep 2013 12:12:27 +0000 (14:12 +0200)
commitc84884b770de539e341d58ede555e1eeb7fdac95
tree44d366824bc78f31d2d108ca7504079b98777315
parent4b5014bcdce9dd51d6a084a15d2264be527ed2b0
net: sock: validate data_len before allocating skb in sock_alloc_send_pskb()

[ Upstream commit cc9b17ad29ecaa20bfe426a8d4dbfb94b13ff1cc ]

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/core/sock.c