From patchwork Mon Aug 17 15:15:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 266143 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=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham 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 C902BC433DF for ; Mon, 17 Aug 2020 18:49:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A111D20578 for ; Mon, 17 Aug 2020 18:49:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597690198; bh=lxJmkJbciIbSE8r9qbKuRDh+Fx1MAM8KlWvJ5hIi8lc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=mrwICyAhbofZPaUjqFh+9C0DBaLKZbtrlrmMTlkFa3wLj1DzPLYYRzAilCG6CYcJA wOJVgxtBARecfBPra1l6D0VaJJ+C28U2ih5ICkX6GJE9ejr7wrOD+mjvTfZBOhxS6Z VX/AXckm24vk6I83j9MxjSVbBMa3A7vUSsy6T6Jo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403875AbgHQSty (ORCPT ); Mon, 17 Aug 2020 14:49:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:41460 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387635AbgHQPyI (ORCPT ); Mon, 17 Aug 2020 11:54:08 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 58FD620729; Mon, 17 Aug 2020 15:54:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597679647; bh=lxJmkJbciIbSE8r9qbKuRDh+Fx1MAM8KlWvJ5hIi8lc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MgJYRovB8wAzOebIVuZ/YEhFPySuNKPU2YTe4jXFAlF/JxginwNFm8PSf8K89+umO 08r3zkSUXlAS9stcSSyN6U716NfYVx8LSYZpZhZa/3dSpTJGL1ygSocBRlvMCRf4Fx 3Q40815F/3drmzNuxaOOnI8EvjqhTTauG6qhHIT0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Demi M. Obenour" , Florian Westphal , Pablo Neira Ayuso , Sasha Levin Subject: [PATCH 5.7 285/393] netfilter: nft_meta: fix iifgroup matching Date: Mon, 17 Aug 2020 17:15:35 +0200 Message-Id: <20200817143833.447081629@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143819.579311991@linuxfoundation.org> References: <20200817143819.579311991@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Florian Westphal [ Upstream commit 78470d9d0d9f2f8d16f28382a4071568e839c0d5 ] iifgroup matching erroneously checks the output interface. Fixes: 8724e819cc9a ("netfilter: nft_meta: move all interface related keys to helper") Reported-by: Demi M. Obenour Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso Signed-off-by: Sasha Levin --- net/netfilter/nft_meta.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/netfilter/nft_meta.c b/net/netfilter/nft_meta.c index 951b6e87ed5d9..7bc6537f3ccb5 100644 --- a/net/netfilter/nft_meta.c +++ b/net/netfilter/nft_meta.c @@ -253,7 +253,7 @@ static bool nft_meta_get_eval_ifname(enum nft_meta_keys key, u32 *dest, return false; break; case NFT_META_IIFGROUP: - if (!nft_meta_store_ifgroup(dest, nft_out(pkt))) + if (!nft_meta_store_ifgroup(dest, nft_in(pkt))) return false; break; case NFT_META_OIFGROUP: