[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230829222418.GB1473980@medusa>
Date: Tue, 29 Aug 2023 15:24:18 -0700
From: Mohamed Khalfella <mkhalfella@...estorage.com>
To: Eric Dumazet <edumazet@...gle.com>
Cc: willemjdebruijn <willemdebruijn.kernel@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Willem de Bruijn <willemb@...gle.com>,
Alexander Duyck <alexanderduyck@...com>,
David Howells <dhowells@...hat.com>,
Jesper Dangaard Brouer <brouer@...hat.com>,
Kees Cook <keescook@...omium.org>,
"open list:NETWORKING [GENERAL]" <netdev@...r.kernel.org>,
open list <linux-kernel@...r.kernel.org>,
"open list:BPF [MISC]" <bpf@...r.kernel.org>
Subject: Re: [PATCH] skbuff: skb_segment, Update nfrags after calling zero
copy functions
On 2023-08-29 12:09:15 +0200, Eric Dumazet wrote:
> Another way to test this path for certain (without tcpdump having to race)
> is to add a temporary/debug patch like this one:
>
> diff --git a/net/core/skbuff.c b/net/core/skbuff.c
> index a298992060e6efdecb87c7ffc8290eafe330583f..20cc42be5e81cdca567515f2a886af4ada0fbe0a
> 100644
> --- a/net/core/skbuff.c
> +++ b/net/core/skbuff.c
> @@ -1749,7 +1749,8 @@ int skb_copy_ubufs(struct sk_buff *skb, gfp_t gfp_mask)
> int i, order, psize, new_frags;
> u32 d_off;
>
> - if (skb_shared(skb) || skb_unclone(skb, gfp_mask))
> + if (skb_shared(skb) ||
> + pskb_expand_head(skb, 0, 0, gfp_mask))
> return -EINVAL;
>
> if (!num_frags)
>
> Note that this might catch other bugs :/
I was not able to make it allocate a new frags by running tcpdump while
reproing the problem. However, I was able to do it with your patch.
Powered by blists - more mailing lists