Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp109786lqp; Tue, 11 Jun 2024 16:57:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVcDSuXhkkWncOY6Uu+E4xhS9NIth2ET/AndA2UYhDBdvUdFUFVvC4czuXDKmL+cEWvLqCzv4Fj4CXuwRFbsL2BRgVY47eiBTWX93dlkw== X-Google-Smtp-Source: AGHT+IHl19klPnxom4TiFSWR5/QrgxWat92RPzQMVtvnesXlhF0nWc5JYL642V55d7RuoM+pdaLq X-Received: by 2002:a17:90a:4705:b0:2c4:a910:72f5 with SMTP id 98e67ed59e1d1-2c4a910758emr314336a91.4.1718150277247; Tue, 11 Jun 2024 16:57:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718150277; cv=pass; d=google.com; s=arc-20160816; b=0isK0bkQWj01vCEW56MUpt3BDVNRLnzXiY+YMImq9mfiwjmLqjxocktoIJ92Yta605 G0OfBEXr0rnqSUXDCbd1n3wPvyCZxloAC8NOykbWBaMYJYDBLNa04njuFlkZ0UqNJtrl oav6IenlMO4tuaLQZy4mA8JtID+togtE3V/hy/S1beH/m2ZCn3NZQ4E19YMVHTmE8Ih0 2afV0oP/SqufuceYveePtiD8yNRUFiGH7VariFH5+RB8hIkvbw0HXjNBy+E0pdXqGO3H C4YpXf5v0Vj2Bs90CzmRcVJ/55It7PaRQNdgWpyGvECbyKUO2X4gwdfT0Sm5lMh3RfgV CWGQ== 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=OiUbj62cW5OTwkghKzjwS07CkAOWrEF5cov79bVGOJ4=; fh=frjvUbsquGPigjV6mdI2Sw3TyI8amMB5MY8lXlm26fI=; b=spUewu3WXv2CtCPaq90O6yyNF4I72oKJ+wuYwIjGsxZctmmcZeHYZNFhNtQfoey13D yqyu5M9fZ/YomjXKS7KIljYy9zJG7gnmNkEk4WzGgXKgGHkwxvaFZONlP1aTfh1X8/A5 6eoJvo9ERZPax77CdI1QrFeY13j8R5RScwrJclauXtgCK8SAERqHTauZe/mJCUzsud5+ //Ww2ZUSeWx05Sh6wtIOKoi5jmNTK/8r4nE4H275c3OlIAgPAXfiNXIRNdnEZ7YE4skG W9SIs9JKR89cSKu3SJQBC8qf9krhfiA0mAlkIi5+4R3Kv2t/xi9IDvv9KDRHqZITFnG1 Q4WA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@fiberby.net header.s=202008 header.b=tzl3N853; 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-210723-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210723-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 41be03b00d2f7-6f73d4d95edsi1766598a12.530.2024.06.11.16.57.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 16:57:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-210723-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=tzl3N853; 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-210723-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210723-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 CEC9D2824A0 for ; Tue, 11 Jun 2024 23:56:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D4E83158A16; Tue, 11 Jun 2024 23:54:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fiberby.net header.i=@fiberby.net header.b="tzl3N853" 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 E4EE5156F29; Tue, 11 Jun 2024 23:54:27 +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=1718150071; cv=none; b=Nj8rC/Xk27VOWPCDAiJ37O1kAlRBfOcDQ8+VSitSzpMPRf2nFE/lwS4Zntxgt5FZgBzlAlkOK1stxKt1EgCv91v3b6SAQT+YLC6AQdz0TE6T9szsg9+q/K+Pw2yQzTEjAU88umXhN9yL5FeS298AMhb1JjYuWRZu59whw1RYuJ8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718150071; c=relaxed/simple; bh=VtZWuGrh1ylypaTQdU8aTLu6D7GfyOsmzUhjq6KIDwU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=c7C5PVTLC0+ppJFWlglSWJWDd0qGsyZkc2PP9RwtXPB6ASOavIe3/Aq6bkfGyrH1QYya9Hp/mtZwBlAXeXEAv4YpN5ii4vk9cWS9Im5yKT4x/zpF/swUUx3e5oNvj1jFGTI67r9zotkv/rai2n4uCneBEcFQf72hstVlm8/W4Xs= 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=tzl3N853; 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fiberby.net; s=202008; t=1718150060; bh=VtZWuGrh1ylypaTQdU8aTLu6D7GfyOsmzUhjq6KIDwU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tzl3N853ldx1Vy8RVIE4f7klT3sIGqET1NC5ncXlItYPqG8YniyvJJpZIQZovihdz tsk5ebcSveeKwT1Z+cwKojy9zw4KCqKAd51/fI4QpE6WzqItL/8hSSF9qn7PgNbb6L 3jXVAJ0oPSqM4q16wogLB8YFQZlwDgF7GHED5SGmCHXKV98KiL6DQM6aW0kZw0t4Vo jSvD22gcgSJEUvl50vq5wK9LiVYZXsHnzrS4umf7EbmWOcpQk3wMUhssoV6yBNatsB IrAR7s8odiEwMeh/V9GuQY3Ko1nMY2DTnsn7qX43VWYAcQhz/SkjU2Yqumn+OKQh5x ToZF6MXf+MnIQ== Received: from x201s (193-104-135-243.ip4.fiberby.net [193.104.135.243]) by mail1.fiberby.net (Postfix) with ESMTPSA id 5D2B76009D; Tue, 11 Jun 2024 23:54:17 +0000 (UTC) Received: by x201s (Postfix, from userid 1000) id 6FD3D202E0F; Tue, 11 Jun 2024 23:54:00 +0000 (UTC) From: =?UTF-8?q?Asbj=C3=B8rn=20Sloth=20T=C3=B8nnesen?= To: Davide Caratti , Ilya Maximets , Jamal Hadi Salim , Cong Wang , Jiri Pirko Cc: =?UTF-8?q?Asbj=C3=B8rn=20Sloth=20T=C3=B8nnesen?= , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , David Ahern , Simon Horman , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH net-next 3/9] net/sched: cls_flower: add policy for TCA_FLOWER_KEY_FLAGS Date: Tue, 11 Jun 2024 23:53:36 +0000 Message-ID: <20240611235355.177667-4-ast@fiberby.net> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240611235355.177667-1-ast@fiberby.net> References: <20240611235355.177667-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 This policy guards fl_set_key_flags() from seeing flags not used in the context of TCA_FLOWER_KEY_FLAGS. Signed-off-by: Asbjørn Sloth Tønnesen --- net/sched/cls_flower.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c index 6a5cecfd95619..6a2afc31f038b 100644 --- a/net/sched/cls_flower.c +++ b/net/sched/cls_flower.c @@ -41,6 +41,10 @@ #define TCA_FLOWER_KEY_CT_FLAGS_MASK \ (TCA_FLOWER_KEY_CT_FLAGS_MAX - 1) +#define TCA_FLOWER_KEY_FLAGS_POLICY_MASK \ + (TCA_FLOWER_KEY_FLAGS_IS_FRAGMENT | \ + TCA_FLOWER_KEY_FLAGS_FRAG_IS_FIRST) + #define TUNNEL_FLAGS_PRESENT (\ _BITUL(IP_TUNNEL_CSUM_BIT) | \ _BITUL(IP_TUNNEL_DONT_FRAGMENT_BIT) | \ @@ -676,8 +680,10 @@ static const struct nla_policy fl_policy[TCA_FLOWER_MAX + 1] = { [TCA_FLOWER_KEY_ENC_UDP_SRC_PORT_MASK] = { .type = NLA_U16 }, [TCA_FLOWER_KEY_ENC_UDP_DST_PORT] = { .type = NLA_U16 }, [TCA_FLOWER_KEY_ENC_UDP_DST_PORT_MASK] = { .type = NLA_U16 }, - [TCA_FLOWER_KEY_FLAGS] = { .type = NLA_U32 }, - [TCA_FLOWER_KEY_FLAGS_MASK] = { .type = NLA_U32 }, + [TCA_FLOWER_KEY_FLAGS] = NLA_POLICY_MASK(NLA_U32, + TCA_FLOWER_KEY_FLAGS_POLICY_MASK), + [TCA_FLOWER_KEY_FLAGS_MASK] = NLA_POLICY_MASK(NLA_U32, + TCA_FLOWER_KEY_FLAGS_POLICY_MASK), [TCA_FLOWER_KEY_ICMPV4_TYPE] = { .type = NLA_U8 }, [TCA_FLOWER_KEY_ICMPV4_TYPE_MASK] = { .type = NLA_U8 }, [TCA_FLOWER_KEY_ICMPV4_CODE] = { .type = NLA_U8 }, -- 2.45.1