From patchwork Mon Apr 8 13:09:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Asbj=C3=B8rn_Sloth_T=C3=B8nnesen?= X-Patchwork-Id: 13621142 X-Patchwork-Delegate: kuba@kernel.org 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 113D38174E; 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=N7iE5tGtpAs8o0UR1Qcfpz6GwXnPsfRNZ7jbxZw1lifKZZo7bqWcjprMDvKovKMl7dEUTKbhUR3OazHcRGLboDy1ePAzWAYBt7+FtQ4ODe803M3t96qL7Rd/h7kofM4FvWr0ifaQXT+TfQ8o+mwtWV8FrZ3qVu7/Rj01tsANAsM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712582415; c=relaxed/simple; bh=bA6hKYZ82VB6o6udzZS2rqCWCcIdVnx+Qp8TMbmLPiA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=D8UAkKME1HP+PIbo7ZjvxlmajWBEoz75tBwchw9MLTehuFVGrePr4RbSlvaVPa5VnrGCeqCRx4eWmyZoylkB22/c+zRh498RWS0K1jDUBc10Yn4VWjk2SvcVM+PMU0Ov2yks3S/69j32T72syz8Q/QGjtOrIyGn9KXOiPDm+D1I= 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=F3Q1XRoh; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fiberby.net header.i=@fiberby.net header.b="F3Q1XRoh" Received: from x201s (193-104-135-243.ip4.fiberby.net [193.104.135.243]) by mail1.fiberby.net (Postfix) with ESMTPSA id 89A85600A7; 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=bA6hKYZ82VB6o6udzZS2rqCWCcIdVnx+Qp8TMbmLPiA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=F3Q1XRohx6nleEyeTdL+pgh9xmCk7cMb2eOrrlZDv2oAtbGAm14p7Cm+iyDtVRA/w ABiVn+gb2iVVem/6/Jf4VubV1slww0XYOKMuw5DdngbPtY4cb6+FDzg2qIWe2P9HDf FDU/mfObJ92rmEENQXZtPpGLl0khylNBKUhmDVyIO9pe1um0d2btvcD5tfBtEccjk3 IaCP9YhdxFJ9fxbrFwwLH9bBg5u2aUpKY6m3vNziwssM5BpCNxTdg4GMICotIrKAH5 p4UkEyY59z2QTka6nwMpaxWGD82W+b+25jKCAVHrsjGoTEicHj1kizzRtk05pGObdX FIqnEOx8KZoig== Received: by x201s (Postfix, from userid 1000) id 9C4C320BDE4; Mon, 08 Apr 2024 13:09:43 +0000 (UTC) From: =?utf-8?q?Asbj=C3=B8rn_Sloth_T=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_Sloth_T=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 6/6] net: dsa: microchip: ksz9477: flower: validate control flags Date: Mon, 8 Apr 2024 13:09:24 +0000 Message-ID: <20240408130927.78594-7-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: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org Add check for unsupported control flags. Only compile-tested, no access to HW. Signed-off-by: Asbjørn Sloth Tønnesen --- drivers/net/dsa/microchip/ksz9477_tc_flower.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/dsa/microchip/ksz9477_tc_flower.c b/drivers/net/dsa/microchip/ksz9477_tc_flower.c index 8b2f5be667e01..4823a876ad8ab 100644 --- a/drivers/net/dsa/microchip/ksz9477_tc_flower.c +++ b/drivers/net/dsa/microchip/ksz9477_tc_flower.c @@ -124,6 +124,9 @@ static int ksz9477_flower_parse_key(struct ksz_device *dev, int port, return -EOPNOTSUPP; } + if (!flow_rule_match_no_control_flags(rule, extack)) + return -EOPNOTSUPP; + if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_BASIC) || flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_ETH_ADDRS)) { ret = ksz9477_flower_parse_key_l2(dev, port, extack, rule,