Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1274659rwi; Wed, 26 Oct 2022 13:07:01 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6ql57BmU4Ibh7DkQL8m62Cv8U64kts3GI348obVcP30BMjYJZZtov+uvhJ9SnxNI6ZGH9c X-Received: by 2002:a17:907:847:b0:77f:f489:cc25 with SMTP id ww7-20020a170907084700b0077ff489cc25mr38665660ejb.80.1666814810494; Wed, 26 Oct 2022 13:06:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666814810; cv=none; d=google.com; s=arc-20160816; b=lDcyIcN/Xzd7GEd3pyrHT4Flxc2DVAUDzTkyoY8ShDFpqQd3vINi7RN+/ovJSi3Joj dY9HRQPQPOrJujvWEBGPzBdLHQ9ojcUA1U99vwa5j0zczMOhCxIf0Cj1bj2Fnw6zHUWl feizzh6KLPj9kdl42a2N+UUVzoRYN3K4b9yNBYhgkSKA9F7DKbRlWdyWWsbzcqSTKClh TbTSNQAAXmxccC757Krk5bzNs0TXHyydATG0Us8QaoUpNpmZaS7Xx3ssU4WZp68n6bUA clF/4xD1Vb7DrKoO2RFCzzrHjUKyHkr+9Q7vLNkcUGPJ7yzZQmBKdAhDUaYeuvy0UWdt JWxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=fgyo2ISY3OAsGAQIUHFMsA2y9yvPMn9uSWbL47QxgxA=; b=BrHSxKxJK4y12qn5g62VmIw9uscPbXOWxkX+7Rw8Lfy+OME1BxJwU39rml+BgaRxMF Z0oAa8C6L2D7KoWEOkpqInk5qSZidgaMf1nIZvVMJGCHt6l4q3SQdtdMqRhLqv/G47rh xjaKzGQNY4KC54dn4ez/WSlie/0pi+apTFQusbQ8DSOEw7Z1HrUUMm2t9/dBWYmfM9XJ uNh91bp7VOZNfT/gIdQePOpVQpTFmS/iA7GDSbZb124j9gBZY4hTCIzzoEDEyHle5e/N yY3Fbe8Pd4RoJacpnsZmU+Sny3XQ2wGXyaUnlQvLvajNPJhX2DzY/UD98SofTI+aR+gW Xi8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yahoo.com header.s=s2048 header.b=uTw2h70i; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cr18-20020a170906d55200b007807e2ff1besi3260583ejc.918.2022.10.26.13.06.22; Wed, 26 Oct 2022 13:06:50 -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=@yahoo.com header.s=s2048 header.b=uTw2h70i; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234686AbiJZTgs (ORCPT + 99 others); Wed, 26 Oct 2022 15:36:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234763AbiJZTgp (ORCPT ); Wed, 26 Oct 2022 15:36:45 -0400 Received: from sonic310-30.consmr.mail.ne1.yahoo.com (sonic310-30.consmr.mail.ne1.yahoo.com [66.163.186.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F77A814DA for ; Wed, 26 Oct 2022 12:36:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1666813001; bh=fgyo2ISY3OAsGAQIUHFMsA2y9yvPMn9uSWbL47QxgxA=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From:Subject:Reply-To; b=uTw2h70iE/0PCD7KKMkxLHTtgAoTGrE5zsq+ZBQoedItywpfJrL6SYgLxfpBnLMw6Thl7JKq/8LntfQ/knJv4LUxgmH5qH/GmusYgjflF0lJzLndr9BvY6oGucrYSbKEUongwy7WDWjcK6kbYn7H+MXyQ6NBSt6+r/+m1wRf8i+h0XI9qHg/VRQCSKqLcDlhWiP3h1jgZZDe9dqDTm35r5COaPClVY5PgL5f6yoYNGe3/u4PhcaVSfd5HP5lfODx3aaxZC2ykOI8jWWaC+zl6enoYKUArFdWbgwxBex/tRotca/Jd+/vdsWfFuFxEDjO+Up0SiwtEbhvxE+DmlZ40g== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1666813001; bh=XORoNFgByCE8mTnxUG6iFHtoEpoZrKyHEA68/kkIPxD=; h=X-Sonic-MF:Date:Subject:To:From:From:Subject; b=t+zIjAP5vbgQdmLR2xrDnQkEJUj0Kwf0b+TRGgingAkT4bIT3hIlObTYOxHD9XbBAudtOoj8HocP+d8IOIS7wTTMC+sSeUNP47a5fln6hIP4mUDUUKPxLwKoDZQAfjjeyip8amyQsY41fEioz/h/Orrmr6KxPF7JZUsBTYqdrhHhDbdyXvWYmMNvYam0yLZl4bHYMLJxImjtcQqvmRKH+5iyJjeu03GjQ9JxJcfeHi9LW1S7p7ta1vDvgrGz4UKHCxN6L0UjFtAKdUhGP1lxD+iUC2r+f4iAGln0TyX0miEpGNMPaCwbsmD1NvYuIsoKtyWBoJoVcOs/JOigSm4ENw== X-YMail-OSG: AcF0dHUVM1lbkt5gX5hDUE0dbPop16EuKUO5obC9.AaQT86FBILl_UN.TYJlbMs Kg4LKXY6YVinaHUb6rNs5uCL5NOgnWTqB5NdbQVNx.dAq0wWQAoavhotUfkGuu4PvI5oys6x2odX jBgBBeq96ApUNFgN.J1radWcIcVhl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.com by sonic310.consmr.mail.ne1.yahoo.com with HTTP; Wed, 26 Oct 2022 19:36:41 +0000 Received: by hermes--production-bf1-64dccd5d47-k9w9h (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 0c5d151e36f47c5c39f843a98a5bcf91; Wed, 26 Oct 2022 19:36:36 +0000 (UTC) Message-ID: <5396ab1e-9b93-df33-ca49-58dc59459a76@schaufler-ca.com> Date: Wed, 26 Oct 2022 12:36:34 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.4.0 Subject: Re: [PATCH v1 2/8] LSM: Add an LSM identifier for external use Content-Language: en-US To: Greg KH Cc: casey.schaufler@intel.com, paul@paul-moore.com, linux-security-module@vger.kernel.org, jmorris@namei.org, keescook@chromium.org, john.johansen@canonical.com, penguin-kernel@i-love.sakura.ne.jp, stephen.smalley.work@gmail.com, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, mic@digikod.net, casey@schaufler-ca.com References: <20221025184519.13231-1-casey@schaufler-ca.com> <20221025184519.13231-3-casey@schaufler-ca.com> From: Casey Schaufler In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Mailer: WebService/1.1.20783 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE 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 10/25/2022 10:58 PM, Greg KH wrote: > On Tue, Oct 25, 2022 at 11:45:13AM -0700, Casey Schaufler wrote: >> Add an integer member "id" to the struct lsm_id. This value is >> a unique identifier associated with each security module. The >> values are defined in a new UAPI header file. Each existing LSM >> has been updated to include it's LSMID in the lsm_id. >> >> The LSM ID values are sequential, with the oldest module >> LSM_ID_CAPABILITY being the lowest value and the existing >> modules numbered in the order they were included in the >> main line kernel. The first 32 values (0 - 31) are reserved >> for some as yet unknown but important use. >> >> Signed-off-by: Casey Schaufler >> --- >> include/linux/lsm_hooks.h | 1 + >> include/uapi/linux/lsm.h | 32 ++++++++++++++++++++++++++++++++ >> security/apparmor/lsm.c | 2 ++ >> security/bpf/hooks.c | 2 ++ >> security/commoncap.c | 2 ++ >> security/landlock/setup.c | 2 ++ >> security/loadpin/loadpin.c | 2 ++ >> security/lockdown/lockdown.c | 2 ++ >> security/safesetid/lsm.c | 2 ++ >> security/selinux/hooks.c | 2 ++ >> security/smack/smack_lsm.c | 2 ++ >> security/tomoyo/tomoyo.c | 2 ++ >> security/yama/yama_lsm.c | 2 ++ >> 13 files changed, 55 insertions(+) >> create mode 100644 include/uapi/linux/lsm.h >> >> diff --git a/include/linux/lsm_hooks.h b/include/linux/lsm_hooks.h >> index e383e468f742..dd4b4d95a172 100644 >> --- a/include/linux/lsm_hooks.h >> +++ b/include/linux/lsm_hooks.h >> @@ -1607,6 +1607,7 @@ struct security_hook_heads { >> */ >> struct lsm_id { >> const char *lsm; /* Name of the LSM */ >> + int id; /* LSM ID */ > Again, kerneldoc. > > And if this crosses the user/kernel boundry, please make it __u64. Or > __s32? Something explicit please. Will do. >> }; >> >> /* >> diff --git a/include/uapi/linux/lsm.h b/include/uapi/linux/lsm.h >> new file mode 100644 >> index 000000000000..d5bcbb9375df >> --- /dev/null >> +++ b/include/uapi/linux/lsm.h >> @@ -0,0 +1,32 @@ >> +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ >> +/* >> + * Linus Security Modules (LSM) - User space API > s/Linus/Linux/. Whoops. > > >> + * >> + * Copyright (C) 2022 Casey Schaufler >> + * Copyright (C) Intel Corporation > No date for Intel? The latest guidance I have received is that Intel does not want a date. >> + */ >> + >> +#ifndef _UAPI_LINUX_LSM_H >> +#define _UAPI_LINUX_LSM_H >> + >> +/* >> + * ID values to identify security modules. >> + * A system may use more than one security module. >> + * >> + * LSM_ID_XXX values 0 - 31 are reserved for future use > Reserved for what? Why? You're not the first person to ask. I'll remove the reserved values for the next version. The invalid value has to change as the id field is going to be unsigned. > > thanks, > > greg k-h