Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp1339045lqe; Mon, 8 Apr 2024 06:24:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXq9LY5c9mi1GuCG5lEOaNAIfJlMWY/Bub8k/3BA1yxbVAwzBnbDxS0ybJ1DiQgwKm68nTtZVHa00ciQUb2InuT1AEXqj5wXWBmxQ7o3g== X-Google-Smtp-Source: AGHT+IGUdXcZZsxpb0kSBOQCmbKN79pQcpk2SXw61AGtlgwYT8eWl2tYck/o7kNps7IO3f28x8Kq X-Received: by 2002:a17:907:1c26:b0:a51:d7c8:300c with SMTP id nc38-20020a1709071c2600b00a51d7c8300cmr1910601ejc.17.1712582644005; Mon, 08 Apr 2024 06:24:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712582643; cv=pass; d=google.com; s=arc-20160816; b=Fu/o6mloH4TbNkPLf7CW9+BdkgxkpvzsvD4wC3clHWaIIAHkhbvdOnWlrNKcxzn+Yn 6DD/jwuAh/RgVyA27iTybPUX+Yew9q8gWR4ezBo+B1gKHhkuDYVqj09UW8ZUB4CLhA2P sxGZQn7XXSW1qk3kbI09o3bUoD7x6hPGvOMxqnNo48hKGvYupH/xMIpemAlbAu4/SzJ3 nRKKBprHVmxzCxVDqYhvsgOvZPkIzuA69lQx/czSYN/J8dU9X8R021fROq6JY59Hc/G7 0YdovTexld/R/QhNRNSQUe1OvMUnJi8NqGSstUV+Iws3X1+UAPGzHsVrU8h84eHJk2V5 HaKQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=DmAqsaZYPqCkdOARwgX+8PXFr2t5Ay36/7FGk9Qn5bY=; fh=938viA9k1ccK6J5qK5wK1J5SmYAIRtzf5Iyc8Ouj03s=; b=VctVKfMMlLmTSDevqaGawiaNYMKjDb91vzWoWi0Yvqs3akDMkHp5JO9QH7rci7NGvq Hh37MbCL7pP5kl8LdOqJMelcEHQ9IPepOYW5ViDljfn+/gN9hjoKkFHNaLBk3VAcNwQX IBcDaQ+cxKfTrxPM87ectJV+U2NWbOAfBo6ExCinu0BFNMcm6mIFiGdOObMDvRpVjg2f qpR2OXiILI+L5RnYJM3Swo0XRrlYSNpXjBmqWTAqKS3ArxgPn1TVYM/Z8cS6VO4VNpyG E4hDSbfGWzJmERmDVYBwd926AGnwwjHvbemSjweqxIvnzxmjgCmXMubRjIrE0aGsWyFw XSvQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@fiberby.net header.s=202008 header.b=Gkp+lPA1; arc=pass (i=1 spf=pass spfdomain=fiberby.net dkim=pass dkdomain=fiberby.net dmarc=pass fromdomain=fiberby.net); spf=pass (google.com: domain of linux-kernel+bounces-135424-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-135424-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=fiberby.net Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id dc7-20020a170906c7c700b00a48a7fccad6si3793259ejb.679.2024.04.08.06.24.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Apr 2024 06:24:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-135424-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@fiberby.net header.s=202008 header.b=Gkp+lPA1; arc=pass (i=1 spf=pass spfdomain=fiberby.net dkim=pass dkdomain=fiberby.net dmarc=pass fromdomain=fiberby.net); spf=pass (google.com: domain of linux-kernel+bounces-135424-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-135424-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=fiberby.net Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id B77821F22D32 for ; Mon, 8 Apr 2024 13:24:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3DF43823CE; Mon, 8 Apr 2024 13:20:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fiberby.net header.i=@fiberby.net header.b="Gkp+lPA1" Received: from mail1.fiberby.net (mail1.fiberby.net [193.104.135.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1144E81754; Mon, 8 Apr 2024 13:20:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.104.135.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712582415; cv=none; b=uydI1X2bS4ds1Al7uDVqLIGffnlRR2TIQA9emJ8J0i+Oq8UjzrINHHCr3hOSyhIAJns+HTJNyM9XY+lNCSTPvagpbZ2jCFOUye3BMOF/YMza6RBIUY6ojbK9615L+OpNCzqZ2ZeHHZYC7K4oLLNHN9gwSnPm+rM0yMstXT/MhlY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712582415; c=relaxed/simple; bh=NQlO1jgsVllyqjrKVAx0V+IBXpfLP2/7zeKLGvcmncY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Ygur8/1PQR+bpnyrp/gSgO8EJpFQm1cSE5neAHWbrswD9lVpobLHjvtrWke3VM6+IoYQtxrBcjcO6QmE5RmfKgzGYiqLt0GOuwOsObdOgJ3XTRBOXgiMw8OgF3IEwzZMGES4IHf0rj1QNtyyBJ5EMXvQnLv0+cpZreXKRkfxzCo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=fiberby.net; spf=pass smtp.mailfrom=fiberby.net; dkim=pass (2048-bit key) header.d=fiberby.net header.i=@fiberby.net header.b=Gkp+lPA1; arc=none smtp.client-ip=193.104.135.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=fiberby.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fiberby.net Received: from x201s (193-104-135-243.ip4.fiberby.net [193.104.135.243]) by mail1.fiberby.net (Postfix) with ESMTPSA id 8E9C0600AF; Mon, 8 Apr 2024 13:10:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fiberby.net; s=202008; t=1712581838; bh=NQlO1jgsVllyqjrKVAx0V+IBXpfLP2/7zeKLGvcmncY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Gkp+lPA16aDUfsw0EDjURxoxWbcqt1X/Sf1wfddELRWDfzqvTQ5/WhCiOJHS/SLXI YsANT4PVAnjTBzu20h/0Ex/RX2HHVSrguydZepBs9gbh+j1sJxOuHArPzeFmE+wYO/ kaR2fA2kGH/CouPssyceK5eumXTQb/zzgQGl7NyvE5Wd+PC4s56NGxxPlHLqc10T1i UPfRYL06BJaXTHeJRuoNMlwJCsdwa9jflF/NuJuuZtKguh27H31Z6dhM8VXiLuTHyh KzKTCtoeJkgoBmhcDxqIYLnfH36wlc53dcMcOCLzm6h/CH5cgSfySCjFQyJeuBsO+m FOVEwS3cX/L7Q== Received: by x201s (Postfix, from userid 1000) id EC22120B99F; Mon, 08 Apr 2024 13:09:40 +0000 (UTC) From: =?UTF-8?q?Asbj=C3=B8rn=20Sloth=20T=C3=B8nnesen?= To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Louis Peens , Taras Chornyi , Woojung Huh , UNGLinuxDriver@microchip.com Cc: =?UTF-8?q?Asbj=C3=B8rn=20Sloth=20T=C3=B8nnesen?= , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Yanguo Li , oss-drivers@corigine.com, Andrew Lunn , Florian Fainelli , Vladimir Oltean , Edward Cree , Jamal Hadi Salim , Cong Wang , Jiri Pirko Subject: [PATCH net-next 4/6] net: prestera: flower: validate control flags Date: Mon, 8 Apr 2024 13:09:22 +0000 Message-ID: <20240408130927.78594-5-ast@fiberby.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240408130927.78594-1-ast@fiberby.net> References: <20240408130927.78594-1-ast@fiberby.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add check for unsupported control flags. Only compile-tested, no access to HW. Signed-off-by: Asbjørn Sloth Tønnesen --- drivers/net/ethernet/marvell/prestera/prestera_flower.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/ethernet/marvell/prestera/prestera_flower.c b/drivers/net/ethernet/marvell/prestera/prestera_flower.c index 8b9455d8a4f7a..075aed847913d 100644 --- a/drivers/net/ethernet/marvell/prestera/prestera_flower.c +++ b/drivers/net/ethernet/marvell/prestera/prestera_flower.c @@ -229,6 +229,10 @@ static int prestera_flower_parse(struct prestera_flow_block *block, flow_rule_match_control(f_rule, &match); addr_type = match.key->addr_type; + + if (!flow_rule_no_control_flags(match.mask->flags, + f->common.extack)) + return -EOPNOTSUPP; } if (flow_rule_match_key(f_rule, FLOW_DISSECTOR_KEY_BASIC)) { -- 2.43.0