From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B15D3C71153 for ; Tue, 29 Aug 2023 22:25:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234037AbjH2WYh (ORCPT ); Tue, 29 Aug 2023 18:24:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239444AbjH2WYX (ORCPT ); Tue, 29 Aug 2023 18:24:23 -0400 Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com [IPv6:2607:f8b0:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08A62C2 for ; Tue, 29 Aug 2023 15:24:21 -0700 (PDT) Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-68bed286169so4229827b3a.1 for ; Tue, 29 Aug 2023 15:24:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=purestorage.com; s=google2022; t=1693347860; x=1693952660; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=+YYrVRvFGP8cHlPGoJT9wVJUhY8GN/rwR0tzqEGpip4=; b=HGN6wzE0Z+22ftS0x+nuWnCprmDpb/v0SZ86HyOgWputm+heKUXR2mnqzErStq72tE c4zpJAZLjtl3kqpneEua/+I1WrnSnldvcrdEQdT7A5hy/DT7Q29PJg5ZsJoNRAT7q9t5 0pNXHfsoylRRBs84O2jg2jQ44b0YU6QiALeVPzBfC77m+1icx0TiWZM2135zoO1fYz30 Gm9oV5xtAaqTC6GGk81p9SW1a+4NDotdsld40wB+14KpNtaDa2zplFhdZqkhACTXNKdX 846zMFSDYPBeCRHYzXhz0Q3MFtvLKbd7Qz/i6wN3kFU3FU+6W9fVtld63qMKc3qTQ68j 7KuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693347860; x=1693952660; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=+YYrVRvFGP8cHlPGoJT9wVJUhY8GN/rwR0tzqEGpip4=; b=R0DalTRUB8tY9UiISHYe2E0+FEiAnGsasvUubUaHI40T33C6knw9XOBRYqxC+6yTON xSdwhPC1WkOnxKwgeTaJ/QQ1tjftngivGcIoUKQozK480ebb5As7UcBtoCGhin5RvhEX i3sna8rL54gERabVGbCT7M5rWv8ogGnQncy12lwP9CQdraYdobuOxCOUx5JxZjDdBd/t e9KGP88TQT5ntmhj4Oc5DaHvQhSqLoqDSZQJRKJ6dPPisykgKNFox4Gby23wCd+U+Osl 2oDF8ZppuHcaANQIaXxPVnkZrbd3p+fjJKKhWb4+DoQtcRr2RyG4ztt4WUQ/tTPyV2mh t8/w== X-Gm-Message-State: AOJu0Yy9TzjPjB0DGVK3wpn3WT77ZQEG9gf+akPvtQuQQhMohJysYW7Y x690VRf+2VWH5PdLOtmgVBGE5A== X-Google-Smtp-Source: AGHT+IFPNsEXPkaJPGMeeiEFHipjnGseCng4DOTgYsmDDTAwZXJBdp93d1gYNXCJe3ucMHjD39GcnA== X-Received: by 2002:a05:6a20:9746:b0:148:656b:9a1f with SMTP id hs6-20020a056a20974600b00148656b9a1fmr654936pzc.20.1693347860454; Tue, 29 Aug 2023 15:24:20 -0700 (PDT) Received: from medusa.lab.kspace.sh (c-98-207-191-243.hsd1.ca.comcast.net. [98.207.191.243]) by smtp.googlemail.com with ESMTPSA id v12-20020a170902b7cc00b001993a1fce7bsm9798784plz.196.2023.08.29.15.24.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Aug 2023 15:24:20 -0700 (PDT) Date: Tue, 29 Aug 2023 15:24:18 -0700 From: Mohamed Khalfella To: Eric Dumazet Cc: willemjdebruijn , "David S. Miller" , Jakub Kicinski , Paolo Abeni , Willem de Bruijn , Alexander Duyck , David Howells , Jesper Dangaard Brouer , Kees Cook , "open list:NETWORKING [GENERAL]" , open list , "open list:BPF [MISC]" Subject: Re: [PATCH] skbuff: skb_segment, Update nfrags after calling zero copy functions Message-ID: <20230829222418.GB1473980@medusa> References: <20230828233210.36532-1-mkhalfella@purestorage.com> <64ed7188a2745_9cf208e1@penguin.notmuch> <20230829065010.GO4091703@medusa> <20230829093105.GA611013@medusa> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.