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 7B1B3C54EE9 for ; Sun, 28 Aug 2022 03:59:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231804AbiH1D7y (ORCPT ); Sat, 27 Aug 2022 23:59:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231788AbiH1D7v (ORCPT ); Sat, 27 Aug 2022 23:59:51 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6131B101F; Sat, 27 Aug 2022 20:59:47 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0345F60F3E; Sun, 28 Aug 2022 03:59:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DEE7FC433D6; Sun, 28 Aug 2022 03:59:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1661659186; bh=mxF6wWgyLzTNK1iaXUFWV3bzy0h0vd0jxhXaREnNPzw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=PfxYIA2ySkWpzwIoXljHtSfNmXObhfZlc9Ol7omHsAplU4rsdmSbCXCUApPBNiWl1 pDg9Olu2kmT+iWoY3rf6C10AJS/4Gx7PX/bbcbcgVZ7qxuQCH2W7SBuEAuiE5DHi5n J/DJxORLZ9ezv1SRkZNmSQ6REOTS+cFTMHC68ghhmzATvzhVTScpDdu1s/KpWZh701 e7PiAZGPxmTYeQbG9vvfEqGz7DEtiTeN5gFnF26lMDnNXCFqNZdmuWDfrDAAlYmWeZ o9h4VnZGea7Dl2xdu/4pAOz57OXaOgM0u/V+6Equ8Rs/T2OPZs47eJ8wBAsDMzSi1P XBYePzPgnlGGg== Date: Sun, 28 Aug 2022 06:59:38 +0300 From: Jarkko Sakkinen To: Roberto Sassu Cc: ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, martin.lau@linux.dev, song@kernel.org, yhs@fb.com, john.fastabend@gmail.com, kpsingh@kernel.org, sdf@google.com, haoluo@google.com, jolsa@kernel.org, mykolal@fb.com, corbet@lwn.net, dhowells@redhat.com, rostedt@goodmis.org, mingo@redhat.com, paul@paul-moore.com, jmorris@namei.org, serge@hallyn.com, shuah@kernel.org, bpf@vger.kernel.org, linux-doc@vger.kernel.org, keyrings@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, deso@posteo.net, Roberto Sassu Subject: Re: [PATCH v14 04/10] KEYS: Move KEY_LOOKUP_ to include/linux/key.h and add flags check function Message-ID: References: <20220826091228.1701185-1-roberto.sassu@huaweicloud.com> <6d85d7b1f0c2341698e88bad025bd6e0b34c7666.camel@huaweicloud.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6d85d7b1f0c2341698e88bad025bd6e0b34c7666.camel@huaweicloud.com> Precedence: bulk List-ID: On Fri, Aug 26, 2022 at 11:22:54AM +0200, Roberto Sassu wrote: > On Fri, 2022-08-26 at 11:12 +0200, Roberto Sassu wrote: > > From: Roberto Sassu > > > > In preparation for the patch that introduces the > > bpf_lookup_user_key() eBPF > > kfunc, move KEY_LOOKUP_ definitions to include/linux/key.h, to be > > able to > > validate the kfunc parameters. > > > > Also, introduce key_lookup_flags_valid() to check if the caller set > > in the > > argument only defined flags. Introduce it directly in > > include/linux/key.h, > > to reduce the risk that the check is not in sync with currently > > defined > > flags. > > > > Signed-off-by: Roberto Sassu > > Reviewed-by: KP Singh > > Jarkko, could you please ack it if it is fine? So, as said I'm not really confident that a function is even needed in the first place. It's fine if there are enough call sites to make it legit. BR, Jarkko