]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
net: add __must_check to skb_put_padto()
authorEric Dumazet <edumazet@google.com>
Wed, 9 Sep 2020 08:27:40 +0000 (01:27 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 1 Oct 2020 09:11:49 +0000 (11:11 +0200)
[ 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 <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/skbuff.h

index 735ff1525f485e4fc7fb1641830a3a870eb91cc5..2528f712b8c0beac19398a95877960939107b08b 100644 (file)
@@ -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;