Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp1026115pxb; Fri, 15 Apr 2022 18:47:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyAD/HyXtdKEFF8ZTM8PvPPKKgRu8SRxtu9ih5nwEeSg7yVXSUbdeMbzQWoEKZBNbesFmtV X-Received: by 2002:a17:90b:255:b0:1cf:39e7:a7aa with SMTP id fz21-20020a17090b025500b001cf39e7a7aamr1679725pjb.137.1650073640164; Fri, 15 Apr 2022 18:47:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650073640; cv=none; d=google.com; s=arc-20160816; b=ms/i1Ydj+YxRTb70FPHOBbJREqVUm6latM3CZ8cEkIbHGeAtbAyjGU8XonCg1tVA1Y CcOgoJG5zPMIPT88Zg7zwvKKQK+Q7iooEz/e4K7Q/2lWpW7kh1gnUbsH2c61XpBRr+JR jgBI6OFPx2qhvVQKF4sCbNZGoljSRkjNrSbNDhRAX2zRBE6jQPnwnSzNlI4FNsqs8f6D /+9IuWhREWNpFmS5Epnpmn6MFjMXa/DL8qNNnkAQoOSGEqcdQm5v9DMYTd+aBWCx3moA SoDGSHCGmuIE5lRHAHjE0HWUWSlSAwLcMkieEMtXfkb9k6qOgqhLi2mrWR5QWvqD2lAS MfMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Q4kreATfvq0PCaErDqGIK51qsHXx4Hc2V23ylLftIFw=; b=YOtF4EONFIkboKt6mDHGk6B156vP7zoDL0CANMwYitr79/poyO/w+NkmYJN2t0CDM6 wlcEVjiGMvV1RDcht7jQZWOHWcDbmDgctz4ra24YNgVXHTx3Uxa60tTCJbTogJShKV6O no3TdDFtAok6iBmWRFAz/ulNT2rj+dy+O+mYdjE9GC0iwqv+XunybMM+AbtYdjDmsGiz qpFFLrJbmBGnkkbOt0uH8HW9kZCLK8HCtgdbrnYBoaSGFAOrsHWG2VZ4IBHlEvKHtzvE eFQL6rVMYjiUuCD8mo6APB4BZfa43rKMcn2TksuBMZWxWDffguQ8CPARq9ip8XLB6cwd ULKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=S2p8PHRm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id m18-20020a17090ab79200b001cabc409081si2841090pjr.67.2022.04.15.18.47.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Apr 2022 18:47:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=S2p8PHRm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1AEC917E374; Fri, 15 Apr 2022 18:10:32 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346091AbiDNUL0 (ORCPT + 99 others); Thu, 14 Apr 2022 16:11:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234182AbiDNULZ (ORCPT ); Thu, 14 Apr 2022 16:11:25 -0400 Received: from mail-qk1-x72b.google.com (mail-qk1-x72b.google.com [IPv6:2607:f8b0:4864:20::72b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47223E72BD; Thu, 14 Apr 2022 13:08:59 -0700 (PDT) Received: by mail-qk1-x72b.google.com with SMTP id e128so2859444qkd.7; Thu, 14 Apr 2022 13:08:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=Q4kreATfvq0PCaErDqGIK51qsHXx4Hc2V23ylLftIFw=; b=S2p8PHRmvbHylIwf9EywH65p/YVOMq5tltG2DuWda+hJlblQT/P1SMnQp2tGUzNuvm Gv/FQgW8wFml5y6o1zrKALK3f02vG55M9QvKUR2SxskMpptmKDABXJ41/sgmZxyaq2eh SQw2bTObHrIIvXIOTw+SMrk41IYc0WdNwpR/oNYu+HfGLJfI0WF7St2kGTVmRxcJcNgn /BFcyPTOHQay1afj1FBn6RfMUu15WZcO51MnwSKRxI0fjlTsWv165PsZ18SGoU/DD27f cduV/vxpiPGoeNWQAtAGWc0bvlD0k4EMEYgyWWMIEf2OMn/2n9IcwxpT0IrPb/gWAazm oVvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Q4kreATfvq0PCaErDqGIK51qsHXx4Hc2V23ylLftIFw=; b=g8zezIlydSgMHUfejlD9Uw1Z9rRf1xHm8/veHWtRicMP+OojGtfpODgpF1L2T7aZUr r/q/XkwvxHVsg+gma6ZCB7ysPx/Jt06+pjWmoUPMaH7GpByovzRjc+2HZjVPD7mFHKz3 sXuQIpfhciE7jQkS1zzKPCzXt+zCfqsItUBWtMjyySRSwcnf0MmIflUTLD73pcsHcqzW z6/fpy2Q01OkauqzvhN42ekP+qEuW3RURmwrun3qFs3ZpGdiayG7qY47MlBgeyevJZNX 7QWhNrSqZCRK4/D3Vyk7fXeBEtjp5moa2KXJ35EPsD0yHK/k2z3Y2xQuUXJnflzawmtA eWYA== X-Gm-Message-State: AOAM5312Kckuccq6CdHmlR0DjhSXuxlvxEOmZ9dfZLoIrLCmEBl5tVr6 Ah3KUpvCvEKY9yqB01I15Q== X-Received: by 2002:a37:4c3:0:b0:69c:84ca:5923 with SMTP id 186-20020a3704c3000000b0069c84ca5923mr1983372qke.503.1649966938325; Thu, 14 Apr 2022 13:08:58 -0700 (PDT) Received: from bytedance (ec2-13-57-97-131.us-west-1.compute.amazonaws.com. [13.57.97.131]) by smtp.gmail.com with ESMTPSA id q17-20020a05622a031100b002f1d478c218sm1939035qtw.62.2022.04.14.13.08.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Apr 2022 13:08:57 -0700 (PDT) Date: Thu, 14 Apr 2022 13:08:54 -0700 From: Peilin Ye To: Jakub Kicinski Cc: "David S. Miller" , Hideaki YOSHIFUJI , David Ahern , Peilin Ye , Cong Wang , Feng Zhou , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net 2/2] ip6_gre: Fix skb_under_panic in __gre6_xmit() Message-ID: <20220414200854.GA2729@bytedance> References: <9cd9ca4ac2c19be288cb8734a86eb30e4d9e2050.1649715555.git.peilin.ye@bytedance.com> <20220414131424.744aa842@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220414131424.744aa842@kernel.org> X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jakub, On Thu, Apr 14, 2022 at 01:14:24PM +0200, Jakub Kicinski wrote: > On Mon, 11 Apr 2022 15:33:00 -0700 Peilin Ye wrote: > > I couldn't find a proper Fixes: tag for this fix; please comment if you > > have any sugguestions. Thanks! > > What's wrong with > > Fixes: 6712abc168eb ("ip6_gre: add ip6 gre and gretap collect_md mode") > > ? Thanks! I will add this in v2 soon. > > diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c > > index b43a46449130..976236736146 100644 > > --- a/net/ipv6/ip6_gre.c > > +++ b/net/ipv6/ip6_gre.c > > @@ -733,9 +733,6 @@ static netdev_tx_t __gre6_xmit(struct sk_buff *skb, > > else > > fl6->daddr = tunnel->parms.raddr; > > > > - if (skb_cow_head(skb, dev->needed_headroom ?: tunnel->hlen)) > > - return -ENOMEM; > > - > > /* Push GRE header. */ > > protocol = (dev->type == ARPHRD_ETHER) ? htons(ETH_P_TEB) : proto; > > > > @@ -763,6 +760,9 @@ static netdev_tx_t __gre6_xmit(struct sk_buff *skb, > > (TUNNEL_CSUM | TUNNEL_KEY | TUNNEL_SEQ); > > We should also reject using SEQ with collect_md, but that's a separate > issue. Could you explain this a bit more? It seems that commit 77a5196a804e ("gre: add sequence number for collect md mode.") added this intentionally. Thanks, Peilin Ye