From patchwork Wed Apr 17 14:44:06 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: 13633498 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 72966140E5E; Wed, 17 Apr 2024 14:44:37 +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=1713365078; cv=none; b=kK0WRYjTfMp3axc5Bwn67yfKbn4HwX8D6uYeDBSeQMBdqbMSzlGNQfn6GQWBMd4iKpzoU5Xz5CEIz7Y0GcRdC7WIIePqVLKvHiEmkgJQ91DTuJc60cNZlHMzgSGKZApsmmYcgJBlf6ZGesk43xsUWF8TQpvzlk8y3V45a4d3nnc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713365078; c=relaxed/simple; bh=eyPztPGpoTcAfA8TrZ2aBkQkDvbE2JrkMRHX1Zzaf+M=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=pqbtJYecnYNOMc76b2a8nWxXxlG2mQzJei7ng1NtLVE8jVkTfyN500OmY/gBPovV54xbTu7orJuCSzPvBPuPLPjzdEU8jGKOqE/OSC5BIBP1QBbAJtKKwAvuWI0591SwZJVcV2oopHGE7L9MOVYg4kAsMxNKu5Vl/b4M2hzZG5c= 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=IJdd2bTY; 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="IJdd2bTY" Received: from x201s (193-104-135-243.ip4.fiberby.net [193.104.135.243]) by mail1.fiberby.net (Postfix) with ESMTPSA id 35A16600A2; Wed, 17 Apr 2024 14:44:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fiberby.net; s=202008; t=1713365075; bh=eyPztPGpoTcAfA8TrZ2aBkQkDvbE2JrkMRHX1Zzaf+M=; h=From:To:Cc:Subject:Date:From; b=IJdd2bTYgL2RcCYJgrqL9cT1WC2KFNEtOT9s7v/I7gTpElCE1HiD9F9yIwZphQKch LHN5o5e1tgjxad7b5YBONDdQn6R9sy+QOSBQSAYRzkceakGq+XZAusNgLtjTKyx3Kg AGivZTv33klrZW2J/JanfMfv9euwsBPlRh0t/DIeZYKZGjv/Z7FMzpB48TDR1l/RFN 0xwqMdXmyErKO7538i8k4E9CIFZEwZ9of2Ki+MMxjUWMpHnQfXAMVwPJ7AuDK56SzY SjNkDckWMc/ahv/3yxlmZVe+6UwnGzrCFuS2jm8sbcRbi9XVvlDnKh32GuyW1dRMCl 8uKH/uASey2GA== Received: by x201s (Postfix, from userid 1000) id 8955720445E; Wed, 17 Apr 2024 14:44:07 +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?= , linux-kernel@vger.kernel.org, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Vladimir Oltean , Claudiu Manoil , Alexandre Belloni , UNGLinuxDriver@microchip.com, Andrew Lunn , Florian Fainelli Subject: [PATCH net-next] net: dsa: felix: flower: validate control flags Date: Wed, 17 Apr 2024 14:44:06 +0000 Message-ID: <20240417144407.104241-1-ast@fiberby.net> X-Mailer: git-send-email 2.43.0 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 This driver currently doesn't support any control flags. Use flow_rule_match_has_control_flags() to check for control flags, such as can be set through `tc flower ... ip_flags frag`. In case any control flags are masked, flow_rule_match_has_control_flags() sets a NL extended error message, and we return -EOPNOTSUPP. Only compile-tested. Signed-off-by: Asbjørn Sloth Tønnesen --- drivers/net/dsa/ocelot/felix_vsc9959.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/dsa/ocelot/felix_vsc9959.c b/drivers/net/dsa/ocelot/felix_vsc9959.c index 3c5509e75a54..85952d841f28 100644 --- a/drivers/net/dsa/ocelot/felix_vsc9959.c +++ b/drivers/net/dsa/ocelot/felix_vsc9959.c @@ -1755,6 +1755,9 @@ static int vsc9959_stream_identify(struct flow_cls_offload *f, BIT_ULL(FLOW_DISSECTOR_KEY_ETH_ADDRS))) return -EOPNOTSUPP; + if (flow_rule_match_has_control_flags(rule, f->common.extack)) + return -EOPNOTSUPP; + if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_ETH_ADDRS)) { struct flow_match_eth_addrs match;