1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Copyright (C) 2020-2024 Microsoft Corporation. All rights reserved.
8 #include <linux/list.h>
9 #include <linux/types.h>
17 IPE_OP_KEXEC_INITRAMFS
,
23 #define IPE_OP_INVALID __IPE_OP_MAX
25 enum ipe_action_type
{
31 #define IPE_ACTION_INVALID __IPE_ACTION_MAX
34 IPE_PROP_BOOT_VERIFIED_FALSE
,
35 IPE_PROP_BOOT_VERIFIED_TRUE
,
36 IPE_PROP_DMV_ROOTHASH
,
37 IPE_PROP_DMV_SIG_FALSE
,
38 IPE_PROP_DMV_SIG_TRUE
,
40 IPE_PROP_FSV_SIG_FALSE
,
41 IPE_PROP_FSV_SIG_TRUE
,
45 #define IPE_PROP_INVALID __IPE_PROP_MAX
48 struct list_head next
;
49 enum ipe_prop_type type
;
55 enum ipe_action_type action
;
56 struct list_head props
;
57 struct list_head next
;
61 struct list_head rules
;
62 enum ipe_action_type default_action
;
65 struct ipe_parsed_policy
{
73 enum ipe_action_type global_default_action
;
75 struct ipe_op_table rules
[__IPE_OP_MAX
];
85 struct ipe_parsed_policy
*parsed
;
87 struct dentry
*policyfs
;
90 struct ipe_policy
*ipe_new_policy(const char *text
, size_t textlen
,
91 const char *pkcs7
, size_t pkcs7len
);
92 void ipe_free_policy(struct ipe_policy
*pol
);
93 int ipe_update_policy(struct inode
*root
, const char *text
, size_t textlen
,
94 const char *pkcs7
, size_t pkcs7len
);
95 int ipe_set_active_pol(const struct ipe_policy
*p
);
96 extern struct mutex ipe_policy_lock
;
98 #endif /* _IPE_POLICY_H */