From mboxrd@z Thu Jan 1 00:00:00 1970 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=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable 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 927F2C3A5A3 for ; Tue, 27 Aug 2019 07:55:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 58B5A2173E for ; Tue, 27 Aug 2019 07:55:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1566892528; bh=aimADWB5OgIOc5sLzaEkIzomgJn1WltzuzYQ57rN0PM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=XCFPlmQVN9zXHfoew1Hp6jSrfsMC8OerNKJObYvRc5fCKbgeowwFt/CHWg9I8GYTW 4twyztaZo2BpW+3kUmX91vkiYSLs2jxr82Itn3n2cNGL5rN+xOk7LnjkXWwEqwu9w3 Oo4QosRXR2wX1oigNLHq9kUxmUZthY9Ex+no2VgY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730342AbfH0Hz1 (ORCPT ); Tue, 27 Aug 2019 03:55:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:47208 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728984AbfH0HzZ (ORCPT ); Tue, 27 Aug 2019 03:55:25 -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 81BD0206BF; Tue, 27 Aug 2019 07:55:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1566892524; bh=aimADWB5OgIOc5sLzaEkIzomgJn1WltzuzYQ57rN0PM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Jf5NekpAIGTxH5B/jRQyNUA/vGm4OhFP7ofQLvXhLyAuLJRPGTCWasFzaGimXsnbT 6BymIpLz5Q91sgBIGs4Yvz4oSe6Id4X6nHtY0o97kntVJKTGMI4KvlByb3GV2+sllt cXe93HPSHx4v3gCmoDpWoPw2weKN442egVlK8WUg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chen Yi , Stefano Brivio , Jozsef Kadlecsik , Sasha Levin Subject: [PATCH 4.19 23/98] netfilter: ipset: Actually allow destination MAC address for hash:ip,mac sets too Date: Tue, 27 Aug 2019 09:50:02 +0200 Message-Id: <20190827072719.489972268@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190827072718.142728620@linuxfoundation.org> References: <20190827072718.142728620@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit b89d15480d0cacacae1a0fe0b3da01b529f2914f ] In commit 8cc4ccf58379 ("ipset: Allow matching on destination MAC address for mac and ipmac sets"), ipset.git commit 1543514c46a7, I removed the KADT check that prevents matching on destination MAC addresses for hash:mac sets, but forgot to remove the same check for hash:ip,mac set. Drop this check: functionality is now commented in man pages and there's no reason to restrict to source MAC address matching anymore. Reported-by: Chen Yi Fixes: 8cc4ccf58379 ("ipset: Allow matching on destination MAC address for mac and ipmac sets") Signed-off-by: Stefano Brivio Signed-off-by: Jozsef Kadlecsik Signed-off-by: Sasha Levin --- net/netfilter/ipset/ip_set_hash_ipmac.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/net/netfilter/ipset/ip_set_hash_ipmac.c b/net/netfilter/ipset/ip_set_hash_ipmac.c index fd87de3ed55b3..75c21c8b76514 100644 --- a/net/netfilter/ipset/ip_set_hash_ipmac.c +++ b/net/netfilter/ipset/ip_set_hash_ipmac.c @@ -95,10 +95,6 @@ hash_ipmac4_kadt(struct ip_set *set, const struct sk_buff *skb, struct hash_ipmac4_elem e = { .ip = 0, { .foo[0] = 0, .foo[1] = 0 } }; struct ip_set_ext ext = IP_SET_INIT_KEXT(skb, opt, set); - /* MAC can be src only */ - if (!(opt->flags & IPSET_DIM_TWO_SRC)) - return 0; - if (skb_mac_header(skb) < skb->head || (skb_mac_header(skb) + ETH_HLEN) > skb->data) return -EINVAL; -- 2.20.1