Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp3143483pxb; Mon, 18 Apr 2022 17:09:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzbgTL+T12kuA82vKv5GB6GbF3GLG9KSc/2Z0xMfrOmV1GfsBcnN2hU2BYaE/8U1maSxRa5 X-Received: by 2002:a05:6a00:c8d:b0:50a:51fe:e462 with SMTP id a13-20020a056a000c8d00b0050a51fee462mr13421688pfv.43.1650326968541; Mon, 18 Apr 2022 17:09:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650326968; cv=none; d=google.com; s=arc-20160816; b=vE8aeOVzVL2ffmjya+19a2/BK/lHYCwZ+Dy95L6nfseZRqy8i1I9lHznSjolwLhHHF V+nLUkpQHNl0NeELjJjlPeYL7qKk/+y3lkqmyC2Cf0FmNNkGIPY1UHDExSHp4HMGL5ps dPMyfH01L5aWv+wwFHeFWsNaGCNoad3R7IybRh+yeNsCUhWe4Vx9w59OQnFUZOIPrpw5 iVeJbA7I4O/x2JORLyTzqbhZFtK4++wKEwOiAcphyKsaALxxB70PBsPNKd0gke03gSjL tyT5UbR9f8ij1pVvDuc0xKJ83CjkkiZOH6Zc85ym5KfJwi6n8QHylLJFu3vPalcXuZqw 3Y2Q== 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=5p7NcFWi/KnK2EMpbHspuR2gfNVN54Rq/sK151XlQwk=; b=rp6fO8HZf7FkILpzvUAiN35gyWQVJOvqD2ZsSqjlq0mQ6sGT49aaJB6s3GU8eBFBii c4z2LvuPn52PWg6Qna55HtwCtrgo07QAKApgGQ6N0gD28GAVDd+SsbdNvwVLC0tAMN0M 9yq8uxC6Kn/ps4WUKYmcB+iM7+fLpzh+RYRTD5jfUn6vttXehTs+lj908QXOMdDvlYpP sQbfZDl3HA4jqEPMsUGOz0fOas5VnZPZGmZjloF9tBsiDAwPmzFRK6MQ+ceuC8NJL9ut TeHt3VAJhbt0lqbdBxMUP01x7csdXb3EC5U/yaZ/UdLxmvxViv29kStGEiuGJiIdhlX6 NPvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ll1OIU8R; 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 y73-20020a638a4c000000b0039d54720b7fsi10419001pgd.778.2022.04.18.17.09.10; Mon, 18 Apr 2022 17:09:28 -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=ll1OIU8R; 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 S239941AbiDRMiS (ORCPT + 99 others); Mon, 18 Apr 2022 08:38:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239595AbiDRMdP (ORCPT ); Mon, 18 Apr 2022 08:33:15 -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 5586E114F; Mon, 18 Apr 2022 05:24: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 dfw.source.kernel.org (Postfix) with ESMTPS id ABFFB60FC4; Mon, 18 Apr 2022 12:24:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9C5E7C385A7; Mon, 18 Apr 2022 12:24:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650284695; bh=vvHpU+KgIweUqNvKAilXjclDlU910lIZwZVqcIdTsFQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ll1OIU8R/6L0DEIeVSE/ZfBtFGMUt8Oooq4WNgOIOt3gZ0ZyG5xW+S1ZxZPmhUd5C oArVB+Y6xdl3BmV8msV6uVBGZ4tFc+KLblsNw9abyIiR973cHwR7PtSbz0wZK8/GQD dU7rBLU3QhIyNO9W7eje0bIav191IcHnhPWTSiwY= 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.17 198/219] ipv6: fix panic when forwarding a pkt with no in6 dev Date: Mon, 18 Apr 2022 14:12:47 +0200 Message-Id: <20220418121212.414825641@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121203.462784814@linuxfoundation.org> References: <20220418121203.462784814@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 @@ -485,7 +485,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;