mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-28 15:13:55 +08:00
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>
This commit is contained in:
parent
3ca1a42a52
commit
4a009cb04a
@ -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
|
* is untouched. Otherwise it is extended. Returns zero on
|
||||||
* success. The skb is freed on error if @free_on_error is true.
|
* 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,
|
static inline int __must_check __skb_put_padto(struct sk_buff *skb,
|
||||||
bool free_on_error)
|
unsigned int len,
|
||||||
|
bool free_on_error)
|
||||||
{
|
{
|
||||||
unsigned int size = skb->len;
|
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
|
* is untouched. Otherwise it is extended. Returns zero on
|
||||||
* success. The skb is freed on error.
|
* 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);
|
return __skb_put_padto(skb, len, true);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user