Skip to content

Commit aae6ccb

Browse files
committed
ima: rename IMA_ACTION_FLAGS to IMA_NONACTION_FLAGS
Simple policy rule options, such as fowner, uid, or euid, can be checked immediately, while other policy rule options, such as requiring a file signature, need to be deferred. The 'flags' field in the integrity_iint_cache struct contains the policy action', 'subaction', and non action/subaction. action: measure/measured, appraise/appraised, (collect)/collected, audit/audited subaction: appraise status for each hook (e.g. file, mmap, bprm, read, creds) non action/subaction: deferred policy rule options and state Rename the IMA_ACTION_FLAGS to IMA_NONACTION_FLAGS. Reviewed-by: Stefan Berger <stefanb@linux.ibm.com> Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
1 parent e4e071b commit aae6ccb

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

security/integrity/ima/ima_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ static int process_measurement(struct file *file, const struct cred *cred,
263263
/* reset appraisal flags if ima_inode_post_setattr was called */
264264
iint->flags &= ~(IMA_APPRAISE | IMA_APPRAISED |
265265
IMA_APPRAISE_SUBMASK | IMA_APPRAISED_SUBMASK |
266-
IMA_ACTION_FLAGS);
266+
IMA_NONACTION_FLAGS);
267267

268268
/*
269269
* Re-evaulate the file if either the xattr has changed or the

security/integrity/ima/ima_policy.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,7 @@ int ima_match_policy(struct user_namespace *mnt_userns, struct inode *inode,
712712
func, mask, func_data))
713713
continue;
714714

715-
action |= entry->flags & IMA_ACTION_FLAGS;
715+
action |= entry->flags & IMA_NONACTION_FLAGS;
716716

717717
action |= entry->action & IMA_DO_MASK;
718718
if (entry->action & IMA_APPRAISE) {

security/integrity/integrity.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
#define IMA_HASH 0x00000100
3131
#define IMA_HASHED 0x00000200
3232

33-
/* iint cache flags */
34-
#define IMA_ACTION_FLAGS 0xff000000
33+
/* iint policy rule cache flags */
34+
#define IMA_NONACTION_FLAGS 0xff000000
3535
#define IMA_DIGSIG_REQUIRED 0x01000000
3636
#define IMA_PERMIT_DIRECTIO 0x02000000
3737
#define IMA_NEW_FILE 0x04000000

0 commit comments

Comments
 (0)