1 // SPDX-License-Identifier: GPL-2.0-only
3 * Landlock LSM - Security framework setup
5 * Copyright © 2016-2020 Mickaël Salaün <mic@digikod.net>
6 * Copyright © 2018-2020 ANSSI
9 #include <linux/init.h>
10 #include <linux/lsm_hooks.h>
18 bool landlock_initialized __lsm_ro_after_init = false;
20 struct lsm_blob_sizes landlock_blob_sizes __lsm_ro_after_init = {
21 .lbs_cred = sizeof(struct landlock_cred_security),
22 .lbs_inode = sizeof(struct landlock_inode_security),
23 .lbs_superblock = sizeof(struct landlock_superblock_security),
26 static int __init landlock_init(void)
28 landlock_add_cred_hooks();
29 landlock_add_ptrace_hooks();
30 landlock_add_fs_hooks();
31 landlock_initialized = true;
32 pr_info("Up and running.\n");
36 DEFINE_LSM(LANDLOCK_NAME) = {
37 .name = LANDLOCK_NAME,
38 .init = landlock_init,
39 .blobs = &landlock_blob_sizes,