Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp3417453pxb; Tue, 19 Apr 2022 01:54:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5rC+etM0X6NWh3HJZsfUixAd6Te8XHRE9siN76/BIfsjx7JlN1by88ePaaGXN7SDhNO0c X-Received: by 2002:aa7:8094:0:b0:505:b544:d1ca with SMTP id v20-20020aa78094000000b00505b544d1camr16885813pff.26.1650358470546; Tue, 19 Apr 2022 01:54:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650358470; cv=none; d=google.com; s=arc-20160816; b=p3/tDaE3hgB6R+v2/CaRDdeA5cQG+cpZxGhci/YVUIr5CkgmiX+4zjhEulsRpHyF/0 ZP95q46Bk7s+UeBqN3k7dvhcx773wTD1oxYQ93//OqvAdVXM9D5Go4VG6U/QB2AQQAnw 2KNTjaz7euHGdl2n5kdvlD4/Nhxq7sLnkix7HZajck71hPojIUh5ZuWisxplH2WJ4+Wv gHamX8OKetIbNq5QNCORhNoDFvgrQ/4Oe+uyM3XtdAdBr4E3YJzonDBsg0wCaLg1P26L ufrXKXS7GD/5YoY6p9bOUovZ2a3NgP2lxTWkGd68ATecE23I98mwQx3Rjs5PWVDWCKI9 Pp4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=XnvUrgG2eMUeam2xfMhP3F1Bnt2hFxm0Veje31qJ4J0=; b=a2CAAncsayztuhWdYO60P7MYTRp2JHhsmCEkSWLpSltCyit4XLZ/ntsEWdpqGJF70r Eg51hSXjM/FzaoP2qGxqURdQptaqs9VuWoeK763AWm4yjkXAsmSbZQsARVjeu3yPsrEt J+R9YQrQelBEoXdJXmaf4uiXNyOj5uTlyi1752e0ry21CPepA7lmUqPgpGkJj4zGBqzx qIfI+d2qdJ5+9h1a0DWvB7YR8mWXxl3tqn4flAMqCWvxGjO5MxH7nTVz/L/UFj8I+Hry I+jlbj6aohzV/oBc6Xv4KB4nUu/QdKZ2yDB2YisrXkTLg9BSegVU07MAc4uKcKP1psCb CAQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pcwffEIB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k4-20020a170902c40400b0015909f985f8si3866654plk.149.2022.04.19.01.54.16; Tue, 19 Apr 2022 01:54:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pcwffEIB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242215AbiDRNSY (ORCPT + 99 others); Mon, 18 Apr 2022 09:18:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242360AbiDRM7u (ORCPT ); Mon, 18 Apr 2022 08:59:50 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2017C201BB; Mon, 18 Apr 2022 05:40:56 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 53002B80EC3; Mon, 18 Apr 2022 12:40:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9F3D2C385A1; Mon, 18 Apr 2022 12:40:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650285654; bh=U6HJbILbFH/jDdPNi6UJqdpoL9mzb5+SE4t1nR22814=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pcwffEIBtbbgB2GSQG4b2TB3JhirTPHq7SviNptScrMSLTpr2cfAQa0ldGy8f8Nwv W5+dhTifypsdVJfLkZrZ2Lx760jaaltPdC6IEapiT98vcmfTq0GQ/Q03PKupxXenXB ec9ReTEksP1HjyHXRYIR8j9NjSFbtQNkov/m8eiE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, kongweibin , Nicolas Dichtel , David Ahern , "David S. Miller" Subject: [PATCH 5.10 085/105] ipv6: fix panic when forwarding a pkt with no in6 dev Date: Mon, 18 Apr 2022 14:13:27 +0200 Message-Id: <20220418121149.047517945@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121145.140991388@linuxfoundation.org> References: <20220418121145.140991388@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 From: Nicolas Dichtel commit e3fa461d8b0e185b7da8a101fe94dfe6dd500ac0 upstream. kongweibin reported a kernel panic in ip6_forward() when input interface has no in6 dev associated. The following tc commands were used to reproduce this panic: tc qdisc del dev vxlan100 root tc qdisc add dev vxlan100 root netem corrupt 5% CC: stable@vger.kernel.org Fixes: ccd27f05ae7b ("ipv6: fix 'disable_policy' for fwd packets") Reported-by: kongweibin Signed-off-by: Nicolas Dichtel Reviewed-by: David Ahern Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/ipv6/ip6_output.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c @@ -508,7 +508,7 @@ int ip6_forward(struct sk_buff *skb) goto drop; if (!net->ipv6.devconf_all->disable_policy && - !idev->cnf.disable_policy && + (!idev || !idev->cnf.disable_policy) && !xfrm6_policy_check(NULL, XFRM_POLICY_FWD, skb)) { __IP6_INC_STATS(net, idev, IPSTATS_MIB_INDISCARDS); goto drop;