Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp149816rwe; Tue, 30 Aug 2022 23:34:43 -0700 (PDT) X-Google-Smtp-Source: AA6agR4CQtIvGu/xi9uks4piyWqdsRvVm3jSjcixYFIq8jZinL4xanCeofW5onNmAT5I2Xo5JASg X-Received: by 2002:a05:6a00:22c7:b0:53a:bea5:9abd with SMTP id f7-20020a056a0022c700b0053abea59abdmr1526946pfj.3.1661927683087; Tue, 30 Aug 2022 23:34:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661927683; cv=none; d=google.com; s=arc-20160816; b=J+dvAz51EDKcFzM+pQK2rDm1Zn0byxfwEP4RmSg6dlPggOljDZIUxLUa4ONbFNFUjr hd2ebLj6SIfshUCibKGeKc0pDCxUluKJesPFpplqJ8rd8lJqcJfVlqBtKGfjgnWCZgOe CiyhW6yYtTvMpIpt97pW7u4kKlvXlWD44I/0R06XG2gKOsK9EtGxj9565+iaXBRm2WxJ 70z/GN1/jcY5aVoewF/CppVttp7cdMxFgfHlv2LGDTnIE1SRx2hNReqDrfMSfdCoTYhV AeMLoaWp8ajWCv+cq9ppvplXSkjhXbcwHWpkpDCcxC4ZLraCNCHy0uN3ZM/yVAIeRC0g Er+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=R+B8IxUo8lF4mUVRWCB8v4jRiud4ySu7FwEPqVaz3PI=; b=EmbVBEuAXY4PY3g0K/KSo11Jz6PH3/e2OXiYGzEU3Jarmk9PbOC79goz5NNau8E+PG z1puPaBCThLgiz8600m6zXRMN0EWmki8Zbm10ZWXPbz4RohUdrIeRzJpSW8Dt99OGCRL HqGAJS6BqCJvErv8la79vgdkFDQ/N/PClfKHbQsJ5et3ew/BFqKg8V7LVGWQhaAE9/1D h7QyVDLmcwEEFp/hOaa3pXUE4uk47RcQihffMJgXj6EUP9Kwp4uBZhrGMilIls44ITb6 nF6gY+wxQHPzy4yOnik96OVfiXPcWB2XdlFCvacvxnMr3WeMEJ6G2Pn5w16riF4plsXM /I3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JrcvEQ+S; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k13-20020a056a00134d00b0052eb0d3a27fsi8955528pfu.157.2022.08.30.23.34.32; Tue, 30 Aug 2022 23:34:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JrcvEQ+S; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229633AbiHaG3Q (ORCPT + 99 others); Wed, 31 Aug 2022 02:29:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45394 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230230AbiHaG3M (ORCPT ); Wed, 31 Aug 2022 02:29:12 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E77ABD142; Tue, 30 Aug 2022 23:29:10 -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 ams.source.kernel.org (Postfix) with ESMTPS id C6281B81F3F; Wed, 31 Aug 2022 06:29:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0B437C433D6; Wed, 31 Aug 2022 06:29:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1661927347; bh=Gc5Gyf6Ot/5jz68KN38QlvrXxUiCmwnGxXTq/AyIJ+g=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=JrcvEQ+SK2OhMPIpF+MLbnUy6rctYfRRAeLaeRc/32BPQWC6eYCyyH7sfYXggdqEM CmsXlWj7FEe4wG6yWUQL7jbxW/VqezJwxT9tpZn8U1Rrn/KsE04/ohYIIYaptnAPRi mYyyZsqR/X4OqL4P1X7Fh+jGG9s4xhXwLJ+HCPM9lu6Xz54hXs8vICFm+nbc/OXqq2 JYjcP3VCpnS1JkdSpNKnraTf4Xc0GbSkHx7kaJ5GzvRnKkyAtmNDwVRLdb6WYLl9Kr U7OFCAK0q53whGjo1BrjglK0csNdphjYKkDruh7q6FZhOXF0mpHBxLxW32Zz1FPxmy M1UDUSIGhm3Jg== Date: Wed, 31 Aug 2022 09:29:02 +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, 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, keyrings@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, deso@posteo.net, memxor@gmail.com, Roberto Sassu Subject: Re: [PATCH v14 05/12] KEYS: Move KEY_LOOKUP_ to include/linux/key.h and set KEY_LOOKUP_FLAGS_ALL Message-ID: References: <20220830161716.754078-1-roberto.sassu@huaweicloud.com> <20220830161716.754078-6-roberto.sassu@huaweicloud.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 31, 2022 at 07:51:47AM +0300, Jarkko Sakkinen wrote: > On Wed, Aug 31, 2022 at 05:53:28AM +0300, Jarkko Sakkinen wrote: > > On Tue, Aug 30, 2022 at 06:17:09PM +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, define the new constant KEY_LOOKUP_FLAGS_ALL, to facilitate checking > > > whether a variable contains only defined flags. > > > > > > Signed-off-by: Roberto Sassu > > > Reviewed-by: KP Singh > > > --- > > > include/linux/key.h | 4 ++++ > > > security/keys/internal.h | 2 -- > > > 2 files changed, 4 insertions(+), 2 deletions(-) > > > > > > diff --git a/include/linux/key.h b/include/linux/key.h > > > index 7febc4881363..e2a70e0fa89f 100644 > > > --- a/include/linux/key.h > > > +++ b/include/linux/key.h > > > @@ -88,6 +88,10 @@ enum key_need_perm { > > > KEY_DEFER_PERM_CHECK, /* Special: permission check is deferred */ > > > }; > > > > > > +#define KEY_LOOKUP_CREATE 0x01 > > > +#define KEY_LOOKUP_PARTIAL 0x02 > > > +#define KEY_LOOKUP_FLAGS_ALL (KEY_LOOKUP_CREATE | KEY_LOOKUP_PARTIAL) > > > > IMHO this could be just KEY_LOOKUP_ALL. > > > > > + > > > struct seq_file; > > > struct user_struct; > > > struct signal_struct; > > > diff --git a/security/keys/internal.h b/security/keys/internal.h > > > index 9b9cf3b6fcbb..3c1e7122076b 100644 > > > --- a/security/keys/internal.h > > > +++ b/security/keys/internal.h > > > @@ -165,8 +165,6 @@ extern struct key *request_key_and_link(struct key_type *type, > > > > > > extern bool lookup_user_key_possessed(const struct key *key, > > > const struct key_match_data *match_data); > > > -#define KEY_LOOKUP_CREATE 0x01 > > > -#define KEY_LOOKUP_PARTIAL 0x02 > > > > > > extern long join_session_keyring(const char *name); > > > extern void key_change_session_keyring(struct callback_head *twork); > > > -- > > > 2.25.1 > > > > > > > Other than that wfm. > > Roberto, with the change done above, just add my ack > to the next version: > > Acked-by: Jarkko Sakkinen And it is fine also to pick this to the bpf tree with rest of the patch set (in the end). BR, Jarkko