diff options
author | Deven Bowers <deven.desai@linux.microsoft.com> | 2024-08-02 23:08:15 -0700 |
---|---|---|
committer | Paul Moore <paul@paul-moore.com> | 2024-08-19 22:36:26 -0400 |
commit | 0311507792b54069ac72e0a6c6b35c5d40aadad8 (patch) | |
tree | 6d74be50e686df975fdec73c65ce920826f2ae32 /security/ipe/ipe.c | |
parent | 9ee6881454345c4bb518e9478415b32731da9858 (diff) | |
download | linux-0311507792b54069ac72e0a6c6b35c5d40aadad8.tar.gz linux-0311507792b54069ac72e0a6c6b35c5d40aadad8.tar.bz2 linux-0311507792b54069ac72e0a6c6b35c5d40aadad8.zip |
lsm: add IPE lsm
Integrity Policy Enforcement (IPE) is an LSM that provides an
complimentary approach to Mandatory Access Control than existing LSMs
today.
Existing LSMs have centered around the concept of access to a resource
should be controlled by the current user's credentials. IPE's approach,
is that access to a resource should be controlled by the system's trust
of a current resource.
The basis of this approach is defining a global policy to specify which
resource can be trusted.
Signed-off-by: Deven Bowers <deven.desai@linux.microsoft.com>
Signed-off-by: Fan Wu <wufan@linux.microsoft.com>
[PM: subject line tweak]
Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'security/ipe/ipe.c')
-rw-r--r-- | security/ipe/ipe.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/security/ipe/ipe.c b/security/ipe/ipe.c new file mode 100644 index 000000000000..8d4ea372873e --- /dev/null +++ b/security/ipe/ipe.c @@ -0,0 +1,42 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2020-2024 Microsoft Corporation. All rights reserved. + */ +#include <uapi/linux/lsm.h> + +#include "ipe.h" + +static struct lsm_blob_sizes ipe_blobs __ro_after_init = { +}; + +static const struct lsm_id ipe_lsmid = { + .name = "ipe", + .id = LSM_ID_IPE, +}; + +static struct security_hook_list ipe_hooks[] __ro_after_init = { +}; + +/** + * ipe_init() - Entry point of IPE. + * + * This is called at LSM init, which happens occurs early during kernel + * start up. During this phase, IPE registers its hooks and loads the + * builtin boot policy. + * + * Return: + * * %0 - OK + * * %-ENOMEM - Out of memory (OOM) + */ +static int __init ipe_init(void) +{ + security_add_hooks(ipe_hooks, ARRAY_SIZE(ipe_hooks), &ipe_lsmid); + + return 0; +} + +DEFINE_LSM(ipe) = { + .name = "ipe", + .init = ipe_init, + .blobs = &ipe_blobs, +}; |