forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LSM: Identify modules by more than name
Create a struct lsm_id to contain identifying information about Linux Security Modules (LSMs). At inception this contains the name of the module and an identifier associated with the security module. Change the security_add_hooks() interface to use this structure. Change the individual modules to maintain their own struct lsm_id and pass it to security_add_hooks(). The values are for LSM identifiers are defined in a new UAPI header file linux/lsm.h. 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. This is an arbitrary convention for assigning the values, but none better presents itself. The value 0 is defined as being invalid. The values 1-99 are reserved for any special case uses which may arise in the future. This may include attributes of the LSM infrastructure itself, possibly related to namespacing or network attribute management. A special range is identified for such attributes to help reduce confusion for developers unfamiliar with LSMs. LSM attribute values are defined for the attributes presented by modules that are available today. As with the LSM IDs, The value 0 is defined as being invalid. The values 1-99 are reserved for any special case uses which may arise in the future. Cc: linux-security-module <[email protected]> Signed-off-by: Casey Schaufler <[email protected]> Reviewed-by: Kees Cook <[email protected]> Reviewed-by: Serge Hallyn <[email protected]> Reviewed-by: Mickael Salaun <[email protected]> Reviewed-by: John Johansen <[email protected]> Signed-off-by: Kees Cook <[email protected]> Nacked-by: Tetsuo Handa <[email protected]> [PM: forward ported beyond v6.6 due merge window changes] Signed-off-by: Paul Moore <[email protected]>
- Loading branch information
1 parent
b85ea95
commit f3b8788
Showing
21 changed files
with
162 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19511,6 +19511,7 @@ L: [email protected] (suggested Cc:) | |
S: Supported | ||
W: http://kernsec.org/ | ||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/lsm.git | ||
F: include/uapi/linux/lsm.h | ||
F: security/ | ||
X: security/selinux/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ | ||
/* | ||
* Linux Security Modules (LSM) - User space API | ||
* | ||
* Copyright (C) 2022 Casey Schaufler <[email protected]> | ||
* Copyright (C) 2022 Intel Corporation | ||
*/ | ||
|
||
#ifndef _UAPI_LINUX_LSM_H | ||
#define _UAPI_LINUX_LSM_H | ||
|
||
/* | ||
* ID tokens to identify Linux Security Modules (LSMs) | ||
* | ||
* These token values are used to uniquely identify specific LSMs | ||
* in the kernel as well as in the kernel's LSM userspace API. | ||
* | ||
* A value of zero/0 is considered undefined and should not be used | ||
* outside the kernel. Values 1-99 are reserved for potential | ||
* future use. | ||
*/ | ||
#define LSM_ID_UNDEF 0 | ||
#define LSM_ID_CAPABILITY 100 | ||
#define LSM_ID_SELINUX 101 | ||
#define LSM_ID_SMACK 102 | ||
#define LSM_ID_TOMOYO 103 | ||
#define LSM_ID_IMA 104 | ||
#define LSM_ID_APPARMOR 105 | ||
#define LSM_ID_YAMA 106 | ||
#define LSM_ID_LOADPIN 107 | ||
#define LSM_ID_SAFESETID 108 | ||
#define LSM_ID_LOCKDOWN 109 | ||
#define LSM_ID_BPF 110 | ||
#define LSM_ID_LANDLOCK 111 | ||
|
||
/* | ||
* LSM_ATTR_XXX definitions identify different LSM attributes | ||
* which are used in the kernel's LSM userspace API. Support | ||
* for these attributes vary across the different LSMs. None | ||
* are required. | ||
* | ||
* A value of zero/0 is considered undefined and should not be used | ||
* outside the kernel. Values 1-99 are reserved for potential | ||
* future use. | ||
*/ | ||
#define LSM_ATTR_UNDEF 0 | ||
#define LSM_ATTR_CURRENT 100 | ||
#define LSM_ATTR_EXEC 101 | ||
#define LSM_ATTR_FSCREATE 102 | ||
#define LSM_ATTR_KEYCREATE 103 | ||
#define LSM_ATTR_PREV 104 | ||
#define LSM_ATTR_SOCKCREATE 105 | ||
|
||
#endif /* _UAPI_LINUX_LSM_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.