Received: by 2002:ab2:4a89:0:b0:1f4:a8b6:6e69 with SMTP id w9csp21078lqj; Wed, 10 Apr 2024 02:33:28 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUDAuTDdNxnmXHjkxeaJM9NJSr2A8ax1ZH/Pv0SghB5J/0NcipAa9GmtKNHytxq4h0azyk5LTWiu85DnqMXOLDgtRUCEDxcKh7uVtHKqw== X-Google-Smtp-Source: AGHT+IH/qoFOnof/wnedoF8FZnOeA55ag2aczGnJbxDVOHnvJTtjle6g4ZxtxF0dMbf4rRT3TB/K X-Received: by 2002:a05:6808:10c1:b0:3c5:d9a9:693a with SMTP id s1-20020a05680810c100b003c5d9a9693amr2734663ois.26.1712741608455; Wed, 10 Apr 2024 02:33:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712741608; cv=pass; d=google.com; s=arc-20160816; b=cxR1XfVsR63vpc7TEL4IWeX04uak77tcVbn+Mob7gjG4XLSqHBx/7F1mXS555kfSCN PkkMlzWhoFE4MfQXpuuDzy1VIa5NxDd2dZtVVjTpi5wLb8WqWU3pVyi6l4Fi+SWWSexf ElyFE4PyZc5XZomGno3hUwl34SIwLUw8nb6zsTv5/B/6wbIzpH9tolJJgsU8cVU1gRKn PU2ZycqsLdNU43amJXaKCj/DfYV8qVk5r3YSpZSCLKDi/fz40vcwHdFFa0NPJn5uyuCj W/hklstDDV9NewBl2BHizqVZL/se5Ne7CVJEb6HLI1BXZzxtew/UqA6k+OTguOVKV2M5 aMHA== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=1BqzSi8DcqXq+aCZC++KP5vhdcH72XT9errZlAtmZs0=; fh=ymilCVC6zcVXBsRWgTaQwNQko51561pjqSmDEoQse7M=; b=umsu4JxYl6yTrjajNvMIqie/4X5HhZK2p8DdpCU/loXcB6Uvf8PiQb8L87svdIFjuh NnxiJqBF+Vv0pIkRJ0teLimYtYRDTf9ncHuDfFhVNwppnielogSQ+f070eZc7X9Bjhu9 3HyBJ5CVEoEr61aoCaOREbF6d3fPytSt0idFQPCcuuwTl70jRJ1eoW/iHyuUHpoyWbjC 1nz+mvTbHSLyL2lfFwFj+32G3XvgyK/Jb69anjpyJWNsd9vlhzr4vToFvIl/7wG3gyEI wAaEXB2CmzJKZQ+/s3a5uw/fpm00X0/QneWU96H5uEq4c1kt2B5iWSKel3822Ue0biQl fqew==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@fiberby.net header.s=202008 header.b=lgqOwKCG; 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-138262-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-138262-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 c11-20020a05620a11ab00b0078d5ea41044si8449994qkk.195.2024.04.10.02.33.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 02:33:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-138262-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=lgqOwKCG; 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-138262-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-138262-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 18F851C20FF2 for ; Wed, 10 Apr 2024 09:33:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 28E03158204; Wed, 10 Apr 2024 09:33:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fiberby.net header.i=@fiberby.net header.b="lgqOwKCG" 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 2EFEC13D2BC; Wed, 10 Apr 2024 09:32:58 +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=1712741581; cv=none; b=VuqdmwNvncZiBhjkPMh8JtQ+nJHMizEQoyagW+SXjpzB+RvxAhgSvyno8eF8ID+vo0U7z5wMdULqrZhP8sDMGL/r6xCVPAWmDePO6CKKefv898kMQE9BTN3gwnHltmAGgkyJpwu3pcEyZSjy7aOhNU3IsVSBO1I8fagmn6qqvq4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712741581; c=relaxed/simple; bh=Sy9vwHM9lL5sKyKFDT+sqtrTgE6HSdTNapyCUyx55lE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=t/xsjQiZQ1jwLKfnKPhoCU3zxGEh5HzYJIV01+fKFCFFOnZBe+Yqlah5HqUuSinlUoq0XucTEqfw8Hfj6YySUZ//bxvxi0Gjb8YKWYoTjLW0VFnaao4T+FmiVSYLJeQzQzk7TeUwjZFqPFXnsWXJQqds2LoBmgv2p0tNwKv4ogg= 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=lgqOwKCG; 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 BB988600A2; Wed, 10 Apr 2024 09:32:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fiberby.net; s=202008; t=1712741570; bh=Sy9vwHM9lL5sKyKFDT+sqtrTgE6HSdTNapyCUyx55lE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lgqOwKCGYCz7hpXThum89aLbSSV/nTzdyP1VEpjeM0gkNX07wTOf/DfxsSKfBXfEG rhsLEEFaRfFLhmmL4Zhh4xtw5HDGYlK2Fl/50HvVf82/aurZLpigO30ewKtO+2ZBFI f7OOtXjRXtyCXnmcRAw9bLmLiIyDZ0I+oFGQbLbLpf0LI0pQ50MOHEWFHVSDoB61rJ aZvAJ3wtJIW50SOZ3JmH65wpRNzl8fonQDKZV6f4R2M9ZvgmbG+7TJEp8rmDXO7G5/ mJsFNdY4sNRzriq0Ir0vEGcW++2qGAGgwoPZQhQzQg7Nm7kMWpd9bF3tfMv82gQfQJ wkhVCdxjdu4IQ== Received: by x201s (Postfix, from userid 1000) id EB91020BDE4; Wed, 10 Apr 2024 09:32:40 +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?= , "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 v2 3/4] net: prestera: flower: validate control flags Date: Wed, 10 Apr 2024 09:32:24 +0000 Message-ID: <20240410093235.5334-4-ast@fiberby.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240410093235.5334-1-ast@fiberby.net> References: <20240410093235.5334-1-ast@fiberby.net> 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 Add check for unsupported control flags. Only compile-tested, no access to HW. Signed-off-by: Asbjørn Sloth Tønnesen --- drivers/net/ethernet/marvell/prestera/prestera_flower.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/ethernet/marvell/prestera/prestera_flower.c b/drivers/net/ethernet/marvell/prestera/prestera_flower.c index 8b9455d8a4f7a..418101a931490 100644 --- a/drivers/net/ethernet/marvell/prestera/prestera_flower.c +++ b/drivers/net/ethernet/marvell/prestera/prestera_flower.c @@ -229,6 +229,10 @@ static int prestera_flower_parse(struct prestera_flow_block *block, flow_rule_match_control(f_rule, &match); addr_type = match.key->addr_type; + + if (flow_rule_has_control_flags(match.mask->flags, + f->common.extack)) + return -EOPNOTSUPP; } if (flow_rule_match_key(f_rule, FLOW_DISSECTOR_KEY_BASIC)) { -- 2.43.0