Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp6155454rdb; Mon, 1 Jan 2024 10:43:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IFMZ+OgbNq8cbFB83mB264CxaavRER9VnK+rglED8deCamSZlEjk/4kRpJO9SRNz4+N0kXh X-Received: by 2002:a05:600c:851a:b0:40c:f7b:67e5 with SMTP id gw26-20020a05600c851a00b0040c0f7b67e5mr8275083wmb.37.1704134589055; Mon, 01 Jan 2024 10:43:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704134589; cv=none; d=google.com; s=arc-20160816; b=NK6LU4fbEvApjnEImzA0qP1jGLPDDskKN5v+fyuklcTBceLYIeEuU3HMo0zB6Jm44E rHOWvItekvQzry8A7frZXcXmQAKcPMtscgYPyLcABZhiSEKcu4W4FRaRIELhIPQdwm3i UG6Mf+tjY7BkRDFARAYHeXtIHVr7jvzxn70xEU1VMS4EDAVUoH+pfl+FodIfgTDhSX3s Ei0CGt2Q5jrAtFqo/PGSp+aWACGnDKzAeoy4hG4quwtgCJOs3gX+/YxPpEDET2MWJ+tp FxlFg5gK9ZOhApsik5bIZD8miKcxzZE20Bhmiewa4kVFWrkYwcdTwMY7Uo8rcFvHYzEM KmIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=RXpEDsxUBs30PjcuzXJKBSUE53akb2fmSYFoDxvovTM=; fh=d7ILf+FmC2UbFCEmYsYvv9mycOKXbkfBubE9jy+hmD8=; b=yRPLE7dDCve6/jzT1c6X2kbZlv6b+HokZkM1d5IUCkN8HzxYIolaFead3YTvGIlCmf FIUNQNlrq6y//atiVGcLSrw+2jSnYnPBHpqZ2btl3cEMDyym3OtdimJGHbUAurR8betI 55NidoMB7qADMNYmp5mAbapDQdoyGTguUh8OJf0JUtHRv3Ry5fpqly5YzuXox4esG/iK 3bzEusmY0d6yykbmRyMd7WmanF2VE7BCW9ZvUUcFEJmxtTJJ9nIifjwWiJsyundWOqwP gN2creCit9YfFiYmrR2LZ/jgSWiAx0chgIXvgA6i+M3KjKF9CH3WcrZ3aAfw6YED83QF Brmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="nbi/1msl"; spf=pass (google.com: domain of linux-kernel+bounces-13933-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-13933-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id qx26-20020a170906fcda00b00a269798110fsi10601987ejb.1006.2024.01.01.10.43.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jan 2024 10:43:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-13933-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="nbi/1msl"; spf=pass (google.com: domain of linux-kernel+bounces-13933-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-13933-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id C7B9E1F211D1 for ; Mon, 1 Jan 2024 18:43:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 78B88D51D; Mon, 1 Jan 2024 18:42:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="nbi/1msl" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 672EED51C; Mon, 1 Jan 2024 18:42:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pf1-f169.google.com with SMTP id d2e1a72fcca58-6da202aa138so2436318b3a.2; Mon, 01 Jan 2024 10:42:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704134577; x=1704739377; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=RXpEDsxUBs30PjcuzXJKBSUE53akb2fmSYFoDxvovTM=; b=nbi/1mslcGzmMIz32nN7C+QGGqRF7fDQOvn6qNtjdBuXLWCzuOkDO9m1VqkhpId4dS TwiZGBcUY/WjirHHXCgAYq1LTqKXXSoPxLXIP1e4rFyeu8TbIelSYAs+7222Zb+DbzNE snX1VR7CJPSuJQVbyLge/vOr3cN8nzwVgLClnF+/9trsKDBLnu5wMq7XqmpT7b7coxJZ CMr8irBd9WnqqOi9n1GWZ9VbNxVLGXAD3pUpppOSO6KlZiYO7rgZiwGJK+CGfq3cHykO i8DjpvuYDQWzM4anKJpo2bTIke68vSKww1nqclmxAkDyUnR/lGblZC3Z5ap0FBmBnPBS b9Bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704134577; x=1704739377; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=RXpEDsxUBs30PjcuzXJKBSUE53akb2fmSYFoDxvovTM=; b=DUmWfUVZEJULh6zu5uwFfHxtST+Fx9dp5u8LO3tXpeO7Cwr883FSIjwV5Kopr756V2 ohEe6Q2AWX6JYz9g45aXXxB7j3afMmdnjaK77Hi4r8XAEtDSuYVVV7IEWwyGwlukk/S5 92RucobreJC6geOzMkjK8s5DOek6KLfXRZ2kfEZdWG8U+bbX28vbmoJwTdW7MhC5myi0 WM/aIDyOyH3GpV/+duM4c1P3heSNkxeGHldB7BxNndrfq3/OPAkmdvFQrP2DH0rviFNO b0ugBI/rzXokYRRBsaBfL0ztuR+r6cvJWdZ+2T4aDntyINVsIy642CuSrhLDujORORVU JuuQ== X-Gm-Message-State: AOJu0Yz30DsytvSHhujNXjmWsQXOOxMVpUxCy2hn4GcuvAAGIwHQdtUh zDAPteHTjImM/HuTuY3D/Wo= X-Received: by 2002:a05:6a00:a24:b0:6da:4d93:ef74 with SMTP id p36-20020a056a000a2400b006da4d93ef74mr6770774pfh.6.1704134576593; Mon, 01 Jan 2024 10:42:56 -0800 (PST) Received: from localhost ([2601:647:5b81:12a0:8134:8b90:8d31:15e7]) by smtp.gmail.com with ESMTPSA id c12-20020a62e80c000000b006d5929810a6sm14617801pfi.83.2024.01.01.10.42.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jan 2024 10:42:55 -0800 (PST) Date: Mon, 1 Jan 2024 10:42:54 -0800 From: Cong Wang To: Lin Ma Cc: jhs@mojatatu.com, jiri@resnulli.us, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next v2] net/sched: cls_api: complement tcf_tfilter_dump_policy Message-ID: References: <20231228064358.3042747-1-linma@zju.edu.cn> 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=us-ascii Content-Disposition: inline In-Reply-To: <20231228064358.3042747-1-linma@zju.edu.cn> On Thu, Dec 28, 2023 at 02:43:58PM +0800, Lin Ma wrote: > In function `tc_dump_tfilter`, the attributes array is parsed via > tcf_tfilter_dump_policy which only describes TCA_DUMP_FLAGS. However, > the NLA TCA_CHAIN is also accessed with `nla_get_u32`. > > The access to TCA_CHAIN is introduced in commit 5bc1701881e3 ("net: > sched: introduce multichain support for filters") and no nla_policy is > provided for parsing at that point. Later on, tcf_tfilter_dump_policy is > introduced in commit f8ab1807a9c9 ("net: sched: introduce terse dump > flag") while still ignoring the fact that TCA_CHAIN needs a check. This > patch does that by complementing the policy to allow the access > discussed here can be safe as other cases just choose rtm_tca_policy as > the parsing policy. > This patch looks good but you could use NLA_POLICY_MAX() to validate TCA_CHAIN while you are on it. Thanks.