diff mbox series

[net-next] net: fix pointer check in skb_pp_cow_data routine

Message ID 25512af3e09befa9dcb2cf3632bdc45b807cf330.1708167716.git.lorenzo@kernel.org (mailing list archive)
State Accepted
Commit c6a28acb1a27eb42970b959ff7af3a8a077f8cce
Delegated to: Netdev Maintainers
Headers show
Series [net-next] net: fix pointer check in skb_pp_cow_data routine | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 942 this patch: 942
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 7 of 7 maintainers
netdev/build_clang success Errors and warnings before: 958 this patch: 958
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 959 this patch: 959
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-02-21--00-00 (tests: 1452)

Commit Message

Lorenzo Bianconi Feb. 17, 2024, 11:12 a.m. UTC
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>
---
 net/core/skbuff.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Simon Horman Feb. 19, 2024, 5:38 p.m. UTC | #1
On Sat, Feb 17, 2024 at 12:12:14PM +0100, Lorenzo Bianconi wrote:
> 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>
Ilias Apalodimas Feb. 20, 2024, 8:33 a.m. UTC | #2
On Sat, 17 Feb 2024 at 13:12, Lorenzo Bianconi <lorenzo@kernel.org> wrote:
>
> 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>
> ---
>  net/core/skbuff.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/core/skbuff.c b/net/core/skbuff.c
> index 0d9a489e6ae1..6a810c6554eb 100644
> --- a/net/core/skbuff.c
> +++ b/net/core/skbuff.c
> @@ -950,7 +950,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;
>                 }
> --
> 2.43.2
>

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
patchwork-bot+netdevbpf@kernel.org Feb. 21, 2024, 2:50 a.m. UTC | #3
Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Sat, 17 Feb 2024 12:12:14 +0100 you wrote:
> 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>
> 
> [...]

Here is the summary with links:
  - [net-next] net: fix pointer check in skb_pp_cow_data routine
    https://git.kernel.org/netdev/net-next/c/c6a28acb1a27

You are awesome, thank you!
diff mbox series

Patch

diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 0d9a489e6ae1..6a810c6554eb 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -950,7 +950,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;
 		}