Thread (15 messages) 15 messages, 4 authors, 2023-09-01

Re: [PATCH] skbuff: skb_segment, Update nfrags after calling zero copy functions

From: Eric Dumazet <edumazet@google.com>
Date: 2023-08-30 03:45:22
Also in: bpf, lkml

On Wed, Aug 30, 2023 at 12:24 AM Mohamed Khalfella
[off-list ref] wrote:
On 2023-08-29 12:09:15 +0200, Eric Dumazet wrote:
quoted
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.
I am glad this worked, and looking forward to a v2 of your patch, thanks !
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help