From patchwork Thu Apr 11 10:52:57 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: 13625730 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 C352A2EAE5; Thu, 11 Apr 2024 10:53:43 +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=1712832826; cv=none; b=T6ff7Y9+KQzjlz4EC+HqZQJEF/hdcyTZKKofpE0UL8MHsGko6XvnVqHQnvwJHeCodmTWlalimmCiVj3WfH3ByJTragGeVs69AMe5mDYpC9nQPL4wPPFKjs3fJMfvZsHORoezLEv9UsAfpUiA7qb3PLC+H5id1LZB+aERA39EN5s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712832826; c=relaxed/simple; bh=hA4bLqry0f38bkJtkBZ2E//5jq8jhyAZdUEvMOe9BL8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=bvHAwYkWcbTzAN85H23yAwTkRHV24TZYJMmHu+wLmNxnzNBi7bhAnIxfY2BiwA0YMVFccdBGkJUeZmATgbLl64W/mKjBFFnqHCMicjB4oBmDwJIjuA14Toiz4BEuhTGluyxXiM6Q5f9Bke/HY2y27Hf1mkgzK6zcV0pA1Uvv2m4= 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=UYmPND8P; 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="UYmPND8P" Received: from x201s (193-104-135-243.ip4.fiberby.net [193.104.135.243]) by mail1.fiberby.net (Postfix) with ESMTPSA id 55E8D600A2; Thu, 11 Apr 2024 10:53:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fiberby.net; s=202008; t=1712832815; bh=hA4bLqry0f38bkJtkBZ2E//5jq8jhyAZdUEvMOe9BL8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UYmPND8PWvAcLq6omI3g5jtVViO9/dxL2Wk03v6XNMtrT6XHlbH7nu/7jW8noNUqZ 3S1kQrrriI9Ad6vdVoYnonijbCx+at6UB2jobo2ts6p8cdx2vQncrIVUL35wvVZA/u EeT6I03o5GcgzvQNa+PY1cFSYHEIygkTznzWTDXoJbnqivS7xBf1wrwTuHJrw2Drf0 6nXPkb9zD9Iukr24ssq/Epw7wVLLaQzIMvVdFCxjPGCRQFRciZFEp7L5x7QeKrAncf G+O6S5xjV0u7EGJfvc5T3cRmTVBdXk8Ukr8SJgbaGz17PX4QG3LNIypPr1YT/YlzYp MN89YGRRQ/Vzg== Received: by x201s (Postfix, from userid 1000) id B250620EF3B; Thu, 11 Apr 2024 10:53:18 +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 v3 4/4] net: dsa: microchip: ksz9477: flower: validate control flags Date: Thu, 11 Apr 2024 10:52:57 +0000 Message-ID: <20240411105302.112091-5-ast@fiberby.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240411105302.112091-1-ast@fiberby.net> References: <20240411105302.112091-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,