ipe.c (52443cb60c356707df494910fa134bbb0a8b1a66) ipe.c (a8a74df150835f5ceff89d40fadda1cf3961fdae)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (C) 2020-2024 Microsoft Corporation. All rights reserved.
4 */
5#include <uapi/linux/lsm.h>
6
7#include "ipe.h"
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (C) 2020-2024 Microsoft Corporation. All rights reserved.
4 */
5#include <uapi/linux/lsm.h>
6
7#include "ipe.h"
8#include "eval.h"
8#include "hooks.h"
9
10static struct lsm_blob_sizes ipe_blobs __ro_after_init = {
9#include "hooks.h"
10
11static struct lsm_blob_sizes ipe_blobs __ro_after_init = {
12 .lbs_superblock = sizeof(struct ipe_superblock),
11};
12
13static const struct lsm_id ipe_lsmid = {
14 .name = "ipe",
15 .id = LSM_ID_IPE,
16};
17
13};
14
15static const struct lsm_id ipe_lsmid = {
16 .name = "ipe",
17 .id = LSM_ID_IPE,
18};
19
20struct ipe_superblock *ipe_sb(const struct super_block *sb)
21{
22 return sb->s_security + ipe_blobs.lbs_superblock;
23}
24
18static struct security_hook_list ipe_hooks[] __ro_after_init = {
19 LSM_HOOK_INIT(bprm_check_security, ipe_bprm_check_security),
20 LSM_HOOK_INIT(mmap_file, ipe_mmap_file),
21 LSM_HOOK_INIT(file_mprotect, ipe_file_mprotect),
22 LSM_HOOK_INIT(kernel_read_file, ipe_kernel_read_file),
23 LSM_HOOK_INIT(kernel_load_data, ipe_kernel_load_data),
25static struct security_hook_list ipe_hooks[] __ro_after_init = {
26 LSM_HOOK_INIT(bprm_check_security, ipe_bprm_check_security),
27 LSM_HOOK_INIT(mmap_file, ipe_mmap_file),
28 LSM_HOOK_INIT(file_mprotect, ipe_file_mprotect),
29 LSM_HOOK_INIT(kernel_read_file, ipe_kernel_read_file),
30 LSM_HOOK_INIT(kernel_load_data, ipe_kernel_load_data),
31 LSM_HOOK_INIT(initramfs_populated, ipe_unpack_initramfs),
24};
25
26/**
27 * ipe_init() - Entry point of IPE.
28 *
29 * This is called at LSM init, which happens occurs early during kernel
30 * start up. During this phase, IPE registers its hooks and loads the
31 * builtin boot policy.

--- 17 unchanged lines hidden ---
32};
33
34/**
35 * ipe_init() - Entry point of IPE.
36 *
37 * This is called at LSM init, which happens occurs early during kernel
38 * start up. During this phase, IPE registers its hooks and loads the
39 * builtin boot policy.

--- 17 unchanged lines hidden ---