@@ -198,6 +198,10 @@ struct ima_iint_cache {
struct ima_digest_data *ima_hash;
};
+#define IMA_INVALID_PCR(a) (((a) < 0) || \
+ (a) >= (sizeof_field(struct ima_iint_cache, measured_pcrs) * 8))
+
+
extern struct lsm_blob_sizes ima_blob_sizes;
static inline struct ima_iint_cache *
@@ -48,9 +48,6 @@
#define HASH 0x0100
#define DONT_HASH 0x0200
-#define INVALID_PCR(a) (((a) < 0) || \
- (a) >= (sizeof_field(struct ima_iint_cache, measured_pcrs) * 8))
-
int ima_policy_flag;
static int temp_ima_appraise;
static int build_ima_appraise __ro_after_init;
@@ -1855,7 +1852,7 @@ static int ima_parse_rule(char *rule, struct ima_rule_entry *entry)
ima_log_string(ab, "pcr", args[0].from);
result = kstrtoint(args[0].from, 10, &entry->pcr);
- if (result || INVALID_PCR(entry->pcr))
+ if (result || IMA_INVALID_PCR(entry->pcr))
result = -EINVAL;
else
entry->flags |= IMA_PCR;
Make the INVALID_PCR() #define available to other compilation units by moving it from ima_policy.c to ima.h and renaming it to IMA_INVALID_PCR() in the course. Signed-off-by: Nicolai Stange <nstange@suse.de> --- security/integrity/ima/ima.h | 4 ++++ security/integrity/ima/ima_policy.c | 5 +---- 2 files changed, 5 insertions(+), 4 deletions(-)