diff options
author | Eric Dumazet <edumazet@google.com> | 2020-09-09 11:27:40 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-09-09 21:04:39 +0300 |
commit | 4a009cb04aeca0de60b73f37b102573354214b52 (patch) | |
tree | ba215a0109a91902809faed11a077eeb1ba5a7d7 /include/linux/skbuff.h | |
parent | 3ca1a42a52ca4b4f02061683851692ad65fefac8 (diff) | |
download | linux-4a009cb04aeca0de60b73f37b102573354214b52.tar.xz |
net: add __must_check to skb_put_padto()
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>
Diffstat (limited to 'include/linux/skbuff.h')
-rw-r--r-- | include/linux/skbuff.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index ed9bea924dc3..04a18e01b362 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -3223,8 +3223,9 @@ 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 if @free_on_error is true. */ -static inline int __skb_put_padto(struct sk_buff *skb, unsigned int len, - bool free_on_error) +static inline int __must_check __skb_put_padto(struct sk_buff *skb, + unsigned int len, + bool free_on_error) { unsigned int size = skb->len; @@ -3247,7 +3248,7 @@ static inline int __skb_put_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) { return __skb_put_padto(skb, len, true); } |