From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A1BC4C54EAA for ; Fri, 27 Jan 2023 13:44:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232321AbjA0No2 (ORCPT ); Fri, 27 Jan 2023 08:44:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231590AbjA0No1 (ORCPT ); Fri, 27 Jan 2023 08:44:27 -0500 Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5138341084 for ; Fri, 27 Jan 2023 05:44:24 -0800 (PST) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 5AFB13200C83; Fri, 27 Jan 2023 08:44:23 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Fri, 27 Jan 2023 08:44:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1674827062; x=1674913462; bh=049vtcBDNIsAWQrXNX6+PjYeTlzS TbdXTssQ9sitqtI=; b=a0sJ7V/Y76F08rHev2jTfZ/FMhWdpmw+KMlgjgAab4cW TCLhe06RY455l5bpMR9EtediDE8jrBNzyCGqqRAEGZ8RarWa94uv/SUAH8h9SphQ DQZvC5o+r03Rhbvo45Qeh57Uuq8y6t6gZHZqHN/DfXLkzZtu5452Zw/lu2fY8dZj Qgr5kGq4jdombEjZTZX5mQiZngO996CKZ2HCk7t1FExDONraqn2zbjcbaDDcg43F q4EzdWa3iAIcmE5r6qjkFTstWmQXhIjkkrj75Qb64QhaNQCOeHyUMzzzVQQun4Cr wBVMl0vQB34ixNoarQ3XAZoT684LUK0qFDmsZaL9Tw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedruddviedgheefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesthdtredttddtvdenucfhrhhomhepkfguohcu ufgthhhimhhmvghluceoihguohhstghhsehiughoshgthhdrohhrgheqnecuggftrfgrth htvghrnhepvddufeevkeehueegfedtvdevfefgudeifeduieefgfelkeehgeelgeejjeeg gefhnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepih guohhstghhsehiughoshgthhdrohhrgh X-ME-Proxy: Feedback-ID: i494840e7:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 27 Jan 2023 08:44:21 -0500 (EST) Date: Fri, 27 Jan 2023 15:44:18 +0200 From: Ido Schimmel To: Johannes Berg Cc: netdev@vger.kernel.org, Johannes Berg Subject: Re: [PATCH net-next] net: netlink: recommend policy range validation Message-ID: References: <20230127084506.09f280619d64.I5dece85f06efa8ab0f474ca77df9e26d3553d4ab@changeid> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230127084506.09f280619d64.I5dece85f06efa8ab0f474ca77df9e26d3553d4ab@changeid> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Fri, Jan 27, 2023 at 08:45:06AM +0100, Johannes Berg wrote: > From: Johannes Berg > > For large ranges (outside of s16) the documentation currently > recommends open-coding the validation, but it's better to use > the NLA_POLICY_FULL_RANGE() or NLA_POLICY_FULL_RANGE_SIGNED() > policy validation instead; recommend that. > > Signed-off-by: Johannes Berg I followed the current comment in code I'm currently working on to validate VXLAN VNI ([0, 16M - 1]). Adjusted to use NLA_POLICY_FULL_RANGE() following your patch, so thanks for that. Reviewed-by: Ido Schimmel