]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blob - security/landlock/setup.c
landlock: Set up the security framework and manage credentials
[mirror_ubuntu-jammy-kernel.git] / security / landlock / setup.c
1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
3 * Landlock LSM - Security framework setup
4 *
5 * Copyright © 2016-2020 Mickaël Salaün <mic@digikod.net>
6 * Copyright © 2018-2020 ANSSI
7 */
8
9 #include <linux/init.h>
10 #include <linux/lsm_hooks.h>
11
12 #include "common.h"
13 #include "cred.h"
14 #include "setup.h"
15
16 struct lsm_blob_sizes landlock_blob_sizes __lsm_ro_after_init = {
17 .lbs_cred = sizeof(struct landlock_cred_security),
18 };
19
20 static int __init landlock_init(void)
21 {
22 landlock_add_cred_hooks();
23 pr_info("Up and running.\n");
24 return 0;
25 }
26
27 DEFINE_LSM(LANDLOCK_NAME) = {
28 .name = LANDLOCK_NAME,
29 .init = landlock_init,
30 .blobs = &landlock_blob_sizes,
31 };