Skip to content

Commit

Permalink
net: fix pointer check in skb_pp_cow_data routine
Browse files Browse the repository at this point in the history
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 <[email protected]>
Closes: https://lore.kernel.org/netdev/[email protected]/T/#m7d189b0015a7281ed9221903902490c03ed19a7a
Fixes: e6d5dbd ("xdp: add multi-buff support for xdp running in generic mode")
Signed-off-by: Lorenzo Bianconi <[email protected]>
Reviewed-by: Simon Horman <[email protected]>
Reviewed-by: Ilias Apalodimas <[email protected]>
Link: https://lore.kernel.org/r/25512af3e09befa9dcb2cf3632bdc45b807cf330.1708167716.git.lorenzo@kernel.org
Signed-off-by: Jakub Kicinski <[email protected]>
  • Loading branch information
LorenzoBianconi authored and kuba-moo committed Feb 21, 2024
1 parent 4934446 commit c6a28ac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/core/skbuff.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit c6a28ac

Please sign in to comment.