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

Commit 4edd87ad authored by Herbert Xu's avatar Herbert Xu Committed by David S. Miller
Browse files

net: BUG instead of corrupting memory in pskb_expand_head



If the caller of pskb_expand_head specifies a negative nhead
we'll silently overwrite other people's memory.  This patch
makes it BUG instead.

Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 12a169e7
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -738,6 +738,8 @@ int pskb_expand_head(struct sk_buff *skb, int nhead, int ntail,
#endif
	long off;

	BUG_ON(nhead < 0);

	if (skb_shared(skb))
		BUG();