Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp96704lqt; Thu, 18 Apr 2024 09:18:59 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXteBd5D8ttTMCFYaAdkuC4aMO2841+maG025FZa6elWU8xk2RPvi4TQtp/STktBkfIy96116CHpoSXHZAMHLuEpogw83Cvukj9J8vO8g== X-Google-Smtp-Source: AGHT+IE8JrB+/Q6P2RrZ4fyrmmfPSWJ8LSWfGbO5uXX/7v6+hA+tMYeQ2jJCVJzSVKPgWTiOj+r3 X-Received: by 2002:a05:6102:dcb:b0:47b:b8a6:6915 with SMTP id e11-20020a0561020dcb00b0047bb8a66915mr3349232vst.25.1713457139227; Thu, 18 Apr 2024 09:18:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713457139; cv=pass; d=google.com; s=arc-20160816; b=zyOiEOtnJuheU3mFW+PJjl9IyTeKaRKAldY2eUO5aCX8jhaxNOYcyv9NoZ6zd8Dvvh g0yudCjAQeUtvjvd4XCXD/BrXwUPFju1HvzfqlZfrWQfznKiTD5YEIoz+AbVkecKSm6J qDpqLpJ/B4efYPGtwBfwFtgPWZrjEDpETfespG0hepGsSqf13Z8UBSxmHNLbinmRJ7ly 6S4YM4Y4OMH/U/zjImAGyVfKtj6RDq5968exD9fUzUULU/NGVFfvypHreUFh9bMF5Z6c RtP4WbVNLDFFj6EyiLto4qUdb/m8snPuVlHybT5hpoIz1QK1ebJa1QvWfy8xz9ANp89n OJYQ== 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=auQUwacmtvTkZg7YE9yjkUFClr6LU+def6QBO/QOIik=; fh=NLcapzOC3tMwPQ8A6VG9ObR/sjkWvOBGr+rS/x9m+Sw=; b=wq508QPztTFcu/ovhU/Oi4t9RPVaifHxnNSNRCIpDQHbxJWxrjZUlOPedLBHEGdAYB u1JM7/YzQX45PB+xWYE9R5TrOsMp3/e8NL8ruCsZDd4NZ8BAKHcFeI3hlq/EaqZe8R// fzNSh01Xx1FeEniC2Pm0lU4bNqpaANqgKRXlprIMjGw6RJOHdJ8il1F6HIpMZxYekT4x J+TeghiyL3f0v65acV4HcaDgTqRVmb7hzs8Oz/99Y6ePx3zc3ZG9ntd5CGoILdp0MfCd W4vSS6rkAdbNziWneUkEAMurfiMAR+oQqw5/hL9rTuWBGLB2vyaIqxw9z+5uduxdQ3tG 0EFA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@fiberby.net header.s=202008 header.b=Rly0IjLw; 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-150472-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-150472-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. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id i9-20020a0561020a4900b0047b92ce1468si410593vss.27.2024.04.18.09.18.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 09:18:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-150472-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@fiberby.net header.s=202008 header.b=Rly0IjLw; 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-150472-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-150472-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 C175E1C21576 for ; Thu, 18 Apr 2024 16:18:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 635D416F90D; Thu, 18 Apr 2024 16:18:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fiberby.net header.i=@fiberby.net header.b="Rly0IjLw" 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 F368879EA; Thu, 18 Apr 2024 16:18:46 +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=1713457130; cv=none; b=daPeZmt/R6WIfkyBzXn2IQxz+kzvKxJc6+/ea5dxdVWMt8m/kXwmdz3GFXupMqzmOXqHVOPy3dYA5Go++ZVTcU122ikZV/ALzmrgx+4aEtc4yjAg7IKvNH2Hbuv3KpxtPpS/Zo+u8OaM4MbE+RHMO+R5ESZcY4Mr4B4MfMJ3gw4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713457130; c=relaxed/simple; bh=zMJB6MjfEiqsXe9D7KG5qHReQgyAiQ2kyC/RVG+ge1U=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=MNifU6Zh38jvlp7jJonypTM0CH862K8ptHsC8swG4Y5eZiQsop9fBTtqtbHqoI7R6j48YctzLgX/BnUht78Ci2QbWMTL4RXdfzswumKLvmi1SezzFKrcayFbaC51+dx35H0y9MxZwzbC0k9K9fgxdFIqNAvK5nbMQ460jP4F+Ik= 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=Rly0IjLw; 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 C2645600A7; Thu, 18 Apr 2024 16:18:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fiberby.net; s=202008; t=1713457119; bh=zMJB6MjfEiqsXe9D7KG5qHReQgyAiQ2kyC/RVG+ge1U=; h=From:To:Cc:Subject:Date:From; b=Rly0IjLwkwalnkhIni7FJ5Pp/DqFl/iMetAeWPzcg6fWByQxSFJz10jCMSHN2qvQ+ +2+eyjeb42C144sCcQ3yvESwMs33BZI9c/I0haDuqmogtE/NDzVKCOcQmkqX0LyLzz kb8wRDx2B6WOfmMXxzwnYNrWnpq91Mb2Mv2ZTZtga6l/h/ZmW3T40flQI1ULZpWoST XsWGJs4beYeky2MHw8ZYhNoPY904bxJybzX0+2wZZX8eGhkv/+rZJGyTQAKAZgF3rT ZPncp83z834USiyzhC6GIDl5ETSdCNknmFKTgCKwF1bXgUYxlMhaNz61M13Dk9ffVN Sj+33rquFOfjQ== Received: by x201s (Postfix, from userid 1000) id 70B5E20EF3B; Thu, 18 Apr 2024 16:18:03 +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 , Ioana Ciornei Subject: [PATCH net-next] dpaa2-switch: flower: validate control flags Date: Thu, 18 Apr 2024 16:18:01 +0000 Message-ID: <20240418161802.189247-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/freescale/dpaa2/dpaa2-switch-flower.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch-flower.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch-flower.c index b6a534a3e0b1..701a87370737 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch-flower.c +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch-flower.c @@ -33,6 +33,9 @@ static int dpaa2_switch_flower_parse_key(struct flow_cls_offload *cls, acl_h = &acl_key->match; acl_m = &acl_key->mask; + if (flow_rule_match_has_control_flags(rule, extack)) + return -EOPNOTSUPP; + if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_BASIC)) { struct flow_match_basic match; @@ -548,6 +551,9 @@ static int dpaa2_switch_flower_parse_mirror_key(struct flow_cls_offload *cls, return -EOPNOTSUPP; } + if (flow_rule_match_has_control_flags(rule, extack)) + return -EOPNOTSUPP; + if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_VLAN)) { struct flow_match_vlan match; -- 2.43.0