at v6.7-rc2 43 lines 1.0 kB view raw
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 "fs.h" 15#include "net.h" 16#include "ptrace.h" 17#include "setup.h" 18 19bool landlock_initialized __ro_after_init = false; 20 21struct lsm_blob_sizes landlock_blob_sizes __ro_after_init = { 22 .lbs_cred = sizeof(struct landlock_cred_security), 23 .lbs_file = sizeof(struct landlock_file_security), 24 .lbs_inode = sizeof(struct landlock_inode_security), 25 .lbs_superblock = sizeof(struct landlock_superblock_security), 26}; 27 28static int __init landlock_init(void) 29{ 30 landlock_add_cred_hooks(); 31 landlock_add_ptrace_hooks(); 32 landlock_add_fs_hooks(); 33 landlock_add_net_hooks(); 34 landlock_initialized = true; 35 pr_info("Up and running.\n"); 36 return 0; 37} 38 39DEFINE_LSM(LANDLOCK_NAME) = { 40 .name = LANDLOCK_NAME, 41 .init = landlock_init, 42 .blobs = &landlock_blob_sizes, 43};