diff options
author | Lorenzo Bianconi <lorenzo@kernel.org> | 2024-02-17 14:12:14 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2024-02-21 05:26:25 +0300 |
commit | c6a28acb1a27eb42970b959ff7af3a8a077f8cce (patch) | |
tree | 903d77a508b1fd79e25826b8d5ff95d6decb4cd0 /net/core/skbuff.c | |
parent | 4934446297c292611d3b6cd388efb215f2ba5698 (diff) | |
download | linux-c6a28acb1a27eb42970b959ff7af3a8a077f8cce.tar.xz |
net: fix pointer check in skb_pp_cow_data routine
Properly check page pointer returned by page_pool_dev_alloc routine in
skb_pp_cow_data() for non-linear part of the original skb.
Reported-by: Julian Wiedmann <jwiedmann.dev@gmail.com>
Closes: https://lore.kernel.org/netdev/cover.1707729884.git.lorenzo@kernel.org/T/#m7d189b0015a7281ed9221903902490c03ed19a7a
Fixes: e6d5dbdd20aa ("xdp: add multi-buff support for xdp running in generic mode")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Link: https://lore.kernel.org/r/25512af3e09befa9dcb2cf3632bdc45b807cf330.1708167716.git.lorenzo@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/core/skbuff.c')
-rw-r--r-- | net/core/skbuff.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 1434c422f76e..b9de3ee65ae6 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -968,7 +968,7 @@ int skb_pp_cow_data(struct page_pool *pool, struct sk_buff **pskb, truesize = size; page = page_pool_dev_alloc(pool, &page_off, &truesize); - if (!data) { + if (!page) { consume_skb(nskb); return -ENOMEM; } |