From patchwork Wed Apr 10 09:32:25 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: 13623979 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 6965D1553BF; Wed, 10 Apr 2024 09:33:00 +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=1712741582; cv=none; b=g8Mwv2ayFSWyhupN/G4hvWewjZ16qsSTVnxg0PrnSxoCVBrOYv+eOhsQxjd0gzGNsbW9lSrTHVmCCeIwETbxc6PHMqocqXWrQysWYXBzkygLPMfhWBL4q60k45V43ukZIpTOfhwRfqAnL++oOL42FswFlT7Jk+uB9C2wmw6g9m8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712741582; c=relaxed/simple; bh=hA4bLqry0f38bkJtkBZ2E//5jq8jhyAZdUEvMOe9BL8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=uuVygXZsEE3TZlQ32eKgDYXItY+S7XEZ49W0pytTaQT4FAfJGXXxYp3kqrzi8SdPIYxu/sIB3D67TDHdbe7310glUkWUKequX9O/gEtBYlZxH37apLga3QLYdU9DttHiBaqhV66uSnwns4f+c5lMpZUiplqnR3DRR+ZW9aPW+0o= 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=rvXwihWs; 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="rvXwihWs" Received: from x201s (193-104-135-243.ip4.fiberby.net [193.104.135.243]) by mail1.fiberby.net (Postfix) with ESMTPSA id BE144600A5; Wed, 10 Apr 2024 09:32:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fiberby.net; s=202008; t=1712741573; bh=hA4bLqry0f38bkJtkBZ2E//5jq8jhyAZdUEvMOe9BL8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rvXwihWsjNXni7NbXHMR9ICfhE8s8uPB1KSTg0lut/EYzsej2+uSJ+V66MFVrZ+lK Knv+5QhvAJAbLmomOS/RWkcqyEU7D7tYjMMn8KNvPfPPAI64Kp1MLK2sDYbggs4VsG rRxX9oovEnJoV7ujbylHg1C1zYDvzPpEvYM9gxiBX7VLCTQvxUunW0YfmcQdc4Ce+r QJoDUa/i4Dp4SLyy19xnL2NFIWvS0wfszjVI/Ansi9sEv+IHVCI1MSYdK3TY7VpbvZ tYrKYYq60Sx8qbxzpEdC8fqL7nrIqGYWRd34Ji7tLhFteu8LzX3a++bF2np15s4Joo V9RlAu/QVud/w== Received: by x201s (Postfix, from userid 1000) id D245720BDE6; Wed, 10 Apr 2024 09:32:41 +0000 (UTC) From: =?utf-8?q?Asbj=C3=B8rn_Sloth_T=C3=B8nnesen?= To: netdev@vger.kernel.org Cc: =?utf-8?q?Asbj=C3=B8rn_Sloth_T=C3=B8nnesen?= , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-kernel@vger.kernel.org, Louis Peens , Yanguo Li , oss-drivers@corigine.com, Taras Chornyi , Woojung Huh , UNGLinuxDriver@microchip.com, Andrew Lunn , Florian Fainelli , Vladimir Oltean , Edward Cree , Jamal Hadi Salim , Cong Wang , Jiri Pirko Subject: [PATCH net-next v2 4/4] net: dsa: microchip: ksz9477: flower: validate control flags Date: Wed, 10 Apr 2024 09:32:25 +0000 Message-ID: <20240410093235.5334-5-ast@fiberby.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240410093235.5334-1-ast@fiberby.net> References: <20240410093235.5334-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..ca7830ab168ac 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_has_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,