Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp5223374ybl; Tue, 27 Aug 2019 01:04:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqxj5i+RCw8VKBl4f3ZI8GJg/zo9By5uOtPcaN3HnhK8I86lJoXmNCA31XxxZR9+4R6H6szC X-Received: by 2002:a17:902:169:: with SMTP id 96mr22129935plb.297.1566893068459; Tue, 27 Aug 2019 01:04:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566893068; cv=none; d=google.com; s=arc-20160816; b=wsF4ecks9xjHpHPiRjN0AsE8Cbo6bgweeGwTYXHWlHgVJPNPqxc97ey0SUQjmcCHzm O1MpB6xwNHDBN4yohzE9IwOwgMbup6N4uYvUbKt5YwWSyc5OTGXajvudJNu0eknHfmhI ito3rZLAruOk8I/U0Nzo6rAcbZGjNt88Md8QeToz9VTwiMfGRI3AMklgzGXRDTWfGH12 3wzXLdtErEcDoaf+JFEjCVFRrcNFgH1ZyUBHbxrcqx6ZE/QYUEWgyidrluz7Bp9mugzW cZL3/EpWa6LlI6sQqjjlUaXjUCXjHECYTvMk0mrOEUDeaPA8vFkz7ArvIpPU+jcxLaQF kjBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=iMMLTVnYpwdWzlYSMm4y2r+z45F4uC5GSxu9JkCN/wg=; b=vQuuGvTW/pzOC5m6eteGiVvGlIkT40KQauFFxAp6wK3lDZvqpcyMvL+ACkcbRUlj4i F06whTbumd/gWvSscbSTfw0lAC9NwfWfjAzfAt1FD3NBgWVVvgdh2MZciNODaiqO3WHf kDgUl3+H2VmKwzLpSdJDO7WW0aJuLruRxcyuUkQYLZniwqNtdZSjrJp3SH2QE73fWETk RnF04zqGXZNiM7cLgIHhJtJFr7E/ogBfwsMG7H9WWlP+oRX+TyNBlhOJ5TnJJmQHCWOp j7QnY9VLosI3HycRw5Bt9oLKZ/UlYMdi3sRSQoktYAjMaDZw0OlbXrT2zzCS57fzJueD Ct2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WkpvPEpM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b6si11019789pge.44.2019.08.27.01.04.12; Tue, 27 Aug 2019 01:04:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WkpvPEpM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731175AbfH0IBm (ORCPT + 99 others); Tue, 27 Aug 2019 04:01:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:57940 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730695AbfH0IBg (ORCPT ); Tue, 27 Aug 2019 04:01:36 -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 BC1E5206BA; Tue, 27 Aug 2019 08:01:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1566892895; bh=lpolk3mGplvQTYlSJ0kutQk3tJP6sDHc93EGxGC3MXo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WkpvPEpMrVxNH+VGw3OrKk956rwH95Yrk7kggwlV3xnOrcBKG/pfZOj8DHGd0fb2A G05iDg6R0vieEJEc7nU7Fpzirae7UZw7h87pa9ebWD0Ruz9CujxKumqxYmFPcbDHgG Vv1D1/voTimYJd9avmyL0u22uum+mXEFXgMGg+ms= 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 5.2 050/162] netfilter: ipset: Actually allow destination MAC address for hash:ip,mac sets too Date: Tue, 27 Aug 2019 09:49:38 +0200 Message-Id: <20190827072739.960706072@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190827072738.093683223@linuxfoundation.org> References: <20190827072738.093683223@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 faf59b6a998fe..eb14434083203 100644 --- a/net/netfilter/ipset/ip_set_hash_ipmac.c +++ b/net/netfilter/ipset/ip_set_hash_ipmac.c @@ -89,10 +89,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