From: Eric Dumazet Date: Wed, 9 Sep 2020 08:27:40 +0000 (-0700) Subject: net: add __must_check to skb_put_padto() X-Git-Tag: v4.4.238~77 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c17c9e3e7cadfbdf11d6d340d0e37254a7e94ece;p=thirdparty%2Fkernel%2Fstable.git net: add __must_check to skb_put_padto() [ Upstream commit 4a009cb04aeca0de60b73f37b102573354214b52 ] skb_put_padto() and __skb_put_padto() callers must check return values or risk use-after-free. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 735ff1525f485..2528f712b8c0b 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -2651,7 +2651,7 @@ static inline int skb_padto(struct sk_buff *skb, unsigned int len) * is untouched. Otherwise it is extended. Returns zero on * success. The skb is freed on error. */ -static inline int skb_put_padto(struct sk_buff *skb, unsigned int len) +static inline int __must_check skb_put_padto(struct sk_buff *skb, unsigned int len) { unsigned int size = skb->len;