Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1f18b717 authored by Mariusz Kozlowski's avatar Mariusz Kozlowski Committed by David S. Miller
Browse files

net: Fix header size check for GSO case in recvmsg (af_packet)



Parameter 'len' is size_t type so it will never get negative.

Signed-off-by: default avatarMariusz Kozlowski <mk@lab.zgora.pl>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7c13a0d9
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1610,9 +1610,11 @@ static int packet_recvmsg(struct kiocb *iocb, struct socket *sock,

		err = -EINVAL;
		vnet_hdr_len = sizeof(vnet_hdr);
		if ((len -= vnet_hdr_len) < 0)
		if (len < vnet_hdr_len)
			goto out_free;

		len -= vnet_hdr_len;

		if (skb_is_gso(skb)) {
			struct skb_shared_info *sinfo = skb_shinfo(skb);