Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp19770lqb; Tue, 16 Apr 2024 07:44:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUsx0KV0DEtcGwmI+cdNZk64j5+rBqAqaRqp0ZimVmmGayMufrSYKd93uQTJu3uK2KrXC54nZIQbUQCf3jlRM7vtxyVuFSbqKBwP2qGQw== X-Google-Smtp-Source: AGHT+IFs0bADKwXnlUzf0OIGGxO/4bkOiOjkSupqSU9udB57cCOR8AZIafNxuYZ5uo/xYn210AEb X-Received: by 2002:a17:902:da88:b0:1e3:e1ff:2e79 with SMTP id j8-20020a170902da8800b001e3e1ff2e79mr16545077plx.45.1713278689866; Tue, 16 Apr 2024 07:44:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713278689; cv=pass; d=google.com; s=arc-20160816; b=ZmETKov7K3ZrsiBqrPJSFA6Ycz2WWLiLktHk4qE2Z/jXeWpxJhgDXAz8Ek8eWbyn1o EBIvL0d6lxGSvqmFTaq3keIjRsXN7r7p2w11Co/gwKtMCY8MJWkGA9dlLqp9eeoAel8Y vdAMuTkSad9EshwsRYQj01w8Dd1pE8pSkI9oXQJvSkMd6BSvMh9mSu5WtS6rAm/Dz+/T rcdbO0wJqxzMXvCHPsgs04lnDOftaR182oCSSDx7wYXA7TpFoRgKOM7468AqMKOs97v8 V664AR8Z3h7FHqk84xyTHnXyGp2bdsTY3x1Y1vQ1j4flP4jgZlQyJBRNpv3CCOs4Mr1w 2A0g== 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=Rr9KBvQSnHanURBdPq1EhkGUqn4hQ5r/7Bl1eYx5b+E=; fh=KsS/tyS895TpQnEJ/zSJLDUfvMb/m6LJX/ZMCYU1cZg=; b=SzBlr1GtHiB56jqWEepxzRdUj3zqa3EdAPdlFfyoOq6jedP4AEuQQWaPtlAA2vN9Ox wHHFcRhXs9awtPruTdpWH4i/a5i89EN5jeex/xWKw+SRAOjLdaQVpEEgcrvtq9HQY3zb zZ1UoGBhB8AYKUCuavC+4XB7Zm6H8vVtP3XhPBjnqO4LdrxQ/QoEv+ASLtpcp3wkKYWJ Iq+FlgSHv2G9MjyWe19w8ypVrf4PfQ7ItG+2SI3tc8epklqsTpYNcZZdriIPJbIMnMV2 TmOAF4maq4niJMp2UXPleYOnrxZUPtN+OKiNa77bZvx4npYbGn2KJcS1O1qPdTD0tYXF vX3g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@fiberby.net header.s=202008 header.b="Kv5w/pgW"; 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-147048-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-147048-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=fiberby.net Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id x16-20020a170902ec9000b001e02aae12aesi9901464plg.401.2024.04.16.07.44.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 07:44:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-147048-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@fiberby.net header.s=202008 header.b="Kv5w/pgW"; 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-147048-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-147048-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 2EBD02843F7 for ; Tue, 16 Apr 2024 14:44:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 90021130A53; Tue, 16 Apr 2024 14:44:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fiberby.net header.i=@fiberby.net header.b="Kv5w/pgW" 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 66B5112E1F0; Tue, 16 Apr 2024 14:44:11 +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=1713278654; cv=none; b=J7CV5vJfnci7ZSoM+3Zp0oDvAtOjIoAUM6qAw5SPOBOg5ggtnpCCggkBtA+tbApJy76SdAePr37+GF2Q6HWbxjQRa833f7nA4DnqNX+cjXnsn6vVzv9CDXb2mnMFAHZX4OVAzxBTyqw+wrSL2LVo+uMc9kAGSa79z5aGCyInNX0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713278654; c=relaxed/simple; bh=S0cQ7yy/rMu5HoKW7QjhMOhVSEsLJ1FSOL4fQV1pzxo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=aud2nZqv7eKiG8dXa5lg7dKAgwd/RWEmSW+GGLLSx23Hu+yNJoEkkVD85fKp1e1i983I+38BcJs8C6oUF0n2cPbsqOVLTjC1p1A7PKJLCy/gIe5cuIo1Fb5Ap73sNmDva7+fkwbJejmoPFD3JlpbigdKIpt5EMNcuIEVvQRQ78k= 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=Kv5w/pgW; 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 7784A600A7; Tue, 16 Apr 2024 14:43:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fiberby.net; s=202008; t=1713278649; bh=S0cQ7yy/rMu5HoKW7QjhMOhVSEsLJ1FSOL4fQV1pzxo=; h=From:To:Cc:Subject:Date:From; b=Kv5w/pgWOCU8njSkEtNSiP3cjfdDInrYbOd0HEvl15KJubDJTXyUiQA3aiNckdPCX GKRKtN8jCmlRjR6PgDf6x/mg1ARpj6NvVewWLj86+azOfWGm59j/p7yofTdUUwwhwD 4cHmDoM0RZKndaRqm6E+ty9NlNvWytN9SJoKRNQ3RhuNgycEcI9pY9EuMjLtqrydjJ Bn6w2hV+oME2Qm2K2kRb6BkYqFptncsjVjDgB3b2SwXi3RuCw5qHKAjSwn05NMlUHC i2x3Dn7Rmi+QebwA8qB6RncFXhRJRkwDf62cUEfVvJoMFPEc1CyW74P+EYgTbBScAW PjvBYdlwBJCng== Received: by x201s (Postfix, from userid 1000) id 548EA20401F; Tue, 16 Apr 2024 14:43:31 +0000 (UTC) From: =?UTF-8?q?Asbj=C3=B8rn=20Sloth=20T=C3=B8nnesen?= To: intel-wired-lan@lists.osuosl.org Cc: =?UTF-8?q?Asbj=C3=B8rn=20Sloth=20T=C3=B8nnesen?= , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jesse Brandeburg , Tony Nguyen Subject: [PATCH iwl-next] ice: flower: validate control flags Date: Tue, 16 Apr 2024 14:43:30 +0000 Message-ID: <20240416144331.15336-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_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_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/intel/ice/ice_tc_lib.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/ethernet/intel/ice/ice_tc_lib.c b/drivers/net/ethernet/intel/ice/ice_tc_lib.c index 2f2fce285ecd..361abd7d7561 100644 --- a/drivers/net/ethernet/intel/ice/ice_tc_lib.c +++ b/drivers/net/ethernet/intel/ice/ice_tc_lib.c @@ -1673,6 +1673,10 @@ ice_parse_cls_flower(struct net_device *filter_dev, struct ice_vsi *vsi, flow_rule_match_control(rule, &match); addr_type = match.key->addr_type; + + if (flow_rule_has_control_flags(match.mask->flags, + fltr->extack)) + return -EOPNOTSUPP; } if (addr_type == FLOW_DISSECTOR_KEY_IPV4_ADDRS) { -- 2.43.0