Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp3861060pxb; Tue, 19 Apr 2022 11:16:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwHnMnFTeN2O44j+Z+vZyWIshNh8I7EPx+BPZ93K3nORjmBptPGex7uleyfMvSUzG9uHEvi X-Received: by 2002:a50:99c7:0:b0:419:225:80b6 with SMTP id n7-20020a5099c7000000b00419022580b6mr19123328edb.240.1650392173947; Tue, 19 Apr 2022 11:16:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650392173; cv=none; d=google.com; s=arc-20160816; b=tNwYpOiCZC1T6BRRvkv6b4XlBINwp7vs2lR08vZbLBOTqx7RNUc3q9ycWRPRyZY4oJ HWU9UaJ5RK8UVfxCqy8UmhkqBF915hI25x3NEvPCHppB2/y7WA+ZpxIVLAPT+izt91FO Jb3vWzLSPr2aq4i6ZhIqCiOiags6y8H8yvgA1dwuvWMuAUuYeYzJGuf9RYRhxHIyUoAW /7VC+A4he05xkP85G5BaAzb7f+n0zh03z1MB8qYgmDjyRK9F8UP/StwN+rOeBnhODCSH 2sLmNCzFw3+p7XoO9DZiCWprPVcik0l7vuA2ZmwOfqUMHsIodFTykyBovoo+utqeGSrR eu+w== 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=Mn3gUB6VD+71lKpr0tr4qgtfAIVsuDz+GJq+44l3/yg=; b=jExZrjMkXCcv6ZpxeUhHh1V239rmgeF2bw/uTYfeQ6Mga7C0/PuXxvbSB4S8u6FxRU IDk9vIK5QEIfRivtUqsGU+5aD4Kzl6w6uk7Jd8/nnE1h2w0x5uX0EdEMoZSTrWJMmylD owwl4koacsGxs4HkhQ1RQpux5OebptxoS3oI3Pw1Stnx87U3p0JLNUrD7QD92qF8upEJ WGm8BBS3n+c4lyY7areEgHBIkHbbEdhO/PVQX+PPvF495sN2kazzIc8ZOQtV5C+Dkglp 8mPN0m5vseXo+SyOHBwwrDuHi8hoY+cc6ZuXDUxw1B3seWYSXFVJ5+FMD54F+xW750oU e40Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=cG+RDOg2; 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 ck19-20020a170906c45300b006e88d2e4fe2si9188918ejb.967.2022.04.19.11.15.49; Tue, 19 Apr 2022 11:16:13 -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=cG+RDOg2; 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 S242832AbiDRNdF (ORCPT + 99 others); Mon, 18 Apr 2022 09:33:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241033AbiDRNG1 (ORCPT ); Mon, 18 Apr 2022 09:06:27 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B472F205EA; Mon, 18 Apr 2022 05:46:59 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 5292160FB6; Mon, 18 Apr 2022 12:46:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5E148C385A7; Mon, 18 Apr 2022 12:46:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286018; bh=zBJNy/Kf5/ebqjjWgmhv1exfCehm8Yb1pAzLqAw/ax4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cG+RDOg2nm7uF3OPp9Duil3RkFRmqiWoL90yCHj1II0/0VJ84Yvyi8otgVaqOfvM8 lEwFlgCQMX6T54Sjg8SeWdYMkJNqxOjMEcKm20mCBI7K+lFqNilc2EgUJvv0WgNbqb F++7yBHmOR7ksjxITRjcK09zsGk3DTRlzRYszFEU= 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 4.19 29/32] ipv6: fix panic when forwarding a pkt with no in6 dev Date: Mon, 18 Apr 2022 14:14:09 +0200 Message-Id: <20220418121127.975944518@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121127.127656835@linuxfoundation.org> References: <20220418121127.127656835@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 @@ -460,7 +460,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;