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 X-Spam-Level: X-Spam-Status: No, score=-6.5 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CFCDCC432BE for ; Thu, 2 Sep 2021 04:48:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A5B45610C8 for ; Thu, 2 Sep 2021 04:48:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231153AbhIBEtb (ORCPT ); Thu, 2 Sep 2021 00:49:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229459AbhIBEta (ORCPT ); Thu, 2 Sep 2021 00:49:30 -0400 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B7B5FC061575; Wed, 1 Sep 2021 21:48:32 -0700 (PDT) Received: by mail-pj1-x1029.google.com with SMTP id u11-20020a17090adb4b00b00181668a56d6so572027pjx.5; Wed, 01 Sep 2021 21:48:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=RcBfOJG+plA9w2gh1ieESzMOZXJ0qVsChyqVj/Wv7Lc=; b=KxS/pt35ZJuE/8U6FwwbNUBm9nKLaAYOXbOcR0vwdU9gd1IpFnJmhbHRPo70wzfPoo Nzffhfv+XfUKe++zelGugfs/cx57xppm8MH9e5CdvozXNnYTUmwXsxZY6U7ZJZJKlCOE c54U8Ts51pTJL/xC+QpOUhyyoUeEn1q9+oMTDMc8ALz63aUgZ4sFgQY/0Vl1DQ6YdLy/ c9cnbQpO8N7O3On4c2WyGWe1IRbG8STsarS6dnq8oUFtq79O5AIF9yM4mVN+rUruH7uH FilaRs3MC4Ry/bbJ0zZBxLW6DInWu7uDglXrAEOcm7XCR5ZDxTpL/91QGtc2oRsMuhzU UNjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=RcBfOJG+plA9w2gh1ieESzMOZXJ0qVsChyqVj/Wv7Lc=; b=NTwDGrmPHIIjbJBR1ASD53zNTVwZZRJfAfXzQ+WV4h7RFlJHGhdmO+O58CcSVqCHdO Ow+eYd217m+SZPSvKHLnF9VPFng1ZUjNBTU9sTrmLb38LxMV4QkBXB7EP2ghyGt9L1Qn SzPTqTvlUVbKQUzMkpGDlRfiE/Aos1RcCutFHhqqqABwRyzdwodyX8oUJGuG8fNZ0Ttm P1K2LMwcLfCcPTLYmIbnJToiD5QNa7/zoNWBvqt+yYAfZY/r5KfDb6NsXdRvl+ivnaHB /0tOyRNWkT0A1W/HBIZ3gSWpfwpZsfwUJjpWzcR9EWqxgYIyuxBgEAIsipoxYtxO36Uj 6hGQ== X-Gm-Message-State: AOAM532l6XDgC3cBdDItLQyT9mP2Xokvs0lQPq5BgL5vud3K8tNr1Tx2 DbGzCsRrZc+8rICw5Ga/z6I= X-Google-Smtp-Source: ABdhPJxs7RhdOaZjA3Pr3iaEqZgDr0DQh0QuLoAMTKsA+t22xPEI3RrVdqu+5UkZeAnHgprzieTLiA== X-Received: by 2002:a17:90a:6289:: with SMTP id d9mr1687195pjj.234.1630558111961; Wed, 01 Sep 2021 21:48:31 -0700 (PDT) Received: from [192.168.86.235] (c-73-241-150-58.hsd1.ca.comcast.net. [73.241.150.58]) by smtp.gmail.com with ESMTPSA id f9sm574679pjq.36.2021.09.01.21.48.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 01 Sep 2021 21:48:31 -0700 (PDT) Subject: Re: [PATCH net-next v4] skb_expand_head() adjust skb->truesize incorrectly To: Vasily Averin , Christoph Paasch , "David S. Miller" Cc: Hideaki YOSHIFUJI , David Ahern , Jakub Kicinski , netdev , linux-kernel@vger.kernel.org, kernel@openvz.org, Alexey Kuznetsov , Julian Wiedmann References: From: Eric Dumazet Message-ID: <67740366-7f1b-c953-dfe1-d2085297bdf3@gmail.com> Date: Wed, 1 Sep 2021 21:48:29 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 9/1/21 9:32 PM, Eric Dumazet wrote: > > I think you missed netem case, in particular > skb_orphan_partial() which I already pointed out. > > You can setup a stack of virtual devices (tunnels), > with a qdisc on them, before ip6_xmit() is finally called... > > Socket might have been closed already. > > To test your patch, you could force a skb_orphan_partial() at the beginning > of skb_expand_head() (extending code coverage) > To clarify : It is ok to 'downgrade' an skb->destructor having a ref on sk->sk_wmem_alloc to something owning a ref on sk->refcnt. But the opposite operation (ref on sk->sk_refcnt --> ref on sk->sk_wmem_alloc) is not safe.