Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2354167lqt; Mon, 22 Apr 2024 08:29:30 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVQQOJcHSIAuKHk95hrT1U5FgvjwTHc8kcxgNXYaM7JUMY/KUohGbAXbeKnVUXH9VhINOjwjMZfMpc+55/TSZ8KbSqecHiqU/P1Vao2nA== X-Google-Smtp-Source: AGHT+IGB5CqmS4j/wgzmI8ndcXVytd1ILO7z6ZKbCGnrG62I+nMSk4V1MetvaGYltPbFQ5YGQjd/ X-Received: by 2002:aca:1911:0:b0:3c5:fcff:3979 with SMTP id l17-20020aca1911000000b003c5fcff3979mr11134196oii.48.1713799769940; Mon, 22 Apr 2024 08:29:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713799769; cv=pass; d=google.com; s=arc-20160816; b=NuAil6448H/M3JPpNnFZ6VanVS+x4UmkdKhZ/PV2Fr7Eo+NnNG9Gdcss/T/ddRdPiz +EGH5uoi32YGryzVHDnnUBGmwE3saiCqx23AA59IMdnJUvmP5TbXYBjkdoSYH6M338/F FAHsvtSdanqL9MseK4si/l7cRcR2G4qOIzcDINiX8osSzgGH7/hc0NKCnSspbQ8EDNV8 XirK1/kI7zNeAwLgpoYgt7vd7c7jvNh+BzfXBQ+doAzF2QAhs54GDVUJlCKuIMhUbNjV H2hbXb9+5YzcxlkdUh3I/Tdj0ICggfsedpapVYxCpkNDmTBW4+2pNn/0A3CaL4kWCKUP pD9Q== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=ypYCFxe0maX64bg3Qd1bcyFGoPUT5jAFxZw3tgQLTvA=; fh=HxL4Gje+eMrJW7UjRhm/kyE9fEiFu95zKFQv+Suo27k=; b=XAWdWAfjbcKMlQjXXH/p+2/gb2vlLtbBQJsVZvR6Nog5TPHPEb2uU8FXf3w1GhOYci dAsdwFl2XCwljZPa7nE8GwX3EsyIbhN9FQic1a/cmtKZSMj5x1b01xJLCQmylOGfRx6/ rWTYHQejQu2fuCixXsgwIKdYAuAVoNKmub1gZRVIig6zBKY4iD7miPN+YXvpIj2J9djt KRtOpccC9d+y4NCMxztFIg+Lr7xbLvuz3hlttIxVAaaxa8XXRLfuPcDPkEiwTfZ9vucP OO5uwMNefe2X0fCpVxlNiVUzsY9gUJEOolH33deS7WLCvazRWBQQYh+CnVBDi07Wu/u2 a4VQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@fiberby.net header.s=202008 header.b=EmWtq4BC; 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-153633-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-153633-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=fiberby.net Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id k5-20020ad45be5000000b006a085defe5asi952480qvc.297.2024.04.22.08.29.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Apr 2024 08:29:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-153633-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@fiberby.net header.s=202008 header.b=EmWtq4BC; 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-153633-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-153633-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id A67791C21990 for ; Mon, 22 Apr 2024 15:29:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 92CA2153BE6; Mon, 22 Apr 2024 15:28:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fiberby.net header.i=@fiberby.net header.b="EmWtq4BC" 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 1C73C153BD4; Mon, 22 Apr 2024 15:28:09 +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=1713799691; cv=none; b=S+jgDTsW86SlLfNezdXoCgqokOAImp+LMpBCeFFHMbhpvnuMRkmm9PG6RVH3Zr3Xro70GjIaapafti/y7J78ajQ4L5fR6oSu83gcPWMfIP3Sbnx78siu9TeL6NyKQJU8bk6E8sdD2R/PM1rww8ChQfvKOitj5TVErQILsCw6+ng= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713799691; c=relaxed/simple; bh=hQh9FuW56vkudkOGmDgSrmvY96HwoJBQhUhM8CETBGY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=G3n+0EoNorbRB3VUG3OPqwNd6q03SlkNPNC2uToufd1bk2UYlpg6xd/vE4mufGHEtcZRjkqj5DGwA25X/Th4foHjhwlVLxPY02gSzOSqNVyY8J+wgDDradrjlcPmx9+7H3yyQFa96q7E6fO2s+fkUWVcshxBii2KZiduuFI5LQc= 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=EmWtq4BC; 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 BF78C600C8; Mon, 22 Apr 2024 15:27:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fiberby.net; s=202008; t=1713799688; bh=hQh9FuW56vkudkOGmDgSrmvY96HwoJBQhUhM8CETBGY=; h=From:To:Cc:Subject:Date:From; b=EmWtq4BCL95M1z5XhDVo5QGLbrHWa8XJWZPrPmHIY7ioV0JekFUnCn5fAoZWb0Z2J FtTjlIipqnY7hA4qlK6QbmGH1Jf9YUqIBzPjtlQqrgBUTHBwCy65yhclxdgyuQUIon JmqXql7VZEhasPzeJ/s0LZBe8nKLPN7Sy1Imb/lfifgCXRGMLLvTbjNtCoYdZCq7Ur 5BRiqFgJQjchggtTVHQ2Bwi/14jwi35HKZyh/qHFdaA1gXVg4tHGAKBj0eYSZm0vD5 soh0oHlKeC7/KkXAP6tYhWOo9N0IjGcRiwzlk8ly/eh1UrI6Jsf9Jk4DcXKqhICVyw AzKmqK4i0Slqg== Received: by x201s (Postfix, from userid 1000) id CA433207A4D; Mon, 22 Apr 2024 15:26:56 +0000 (UTC) From: =?UTF-8?q?Asbj=C3=B8rn=20Sloth=20T=C3=B8nnesen?= To: netdev@vger.kernel.org Cc: =?UTF-8?q?Asbj=C3=B8rn=20Sloth=20T=C3=B8nnesen?= , linux-kernel@vger.kernel.org, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Siddharth Vadapalli , Ravi Gunasekaran , Roger Quadros , linux-omap@vger.kernel.org Subject: [PATCH net-next] net: ethernet: ti: cpsw: flower: validate control flags Date: Mon, 22 Apr 2024 15:26:55 +0000 Message-ID: <20240422152656.175627-1-ast@fiberby.net> X-Mailer: git-send-email 2.43.0 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 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/ethernet/ti/cpsw_priv.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ethernet/ti/cpsw_priv.c b/drivers/net/ethernet/ti/cpsw_priv.c index 764ed298b570..6fe4edabba44 100644 --- a/drivers/net/ethernet/ti/cpsw_priv.c +++ b/drivers/net/ethernet/ti/cpsw_priv.c @@ -1404,6 +1404,9 @@ static int cpsw_qos_clsflower_add_policer(struct cpsw_priv *priv, return -EOPNOTSUPP; } + if (flow_rule_match_has_control_flags(rule, extack)) + return -EOPNOTSUPP; + if (!flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_ETH_ADDRS)) { NL_SET_ERR_MSG_MOD(extack, "Not matching on eth address"); return -EOPNOTSUPP; -- 2.43.0