integrity: add measured_pcrs field to integrity cache
authorEric Richter <erichte@linux.vnet.ibm.com>
Wed, 1 Jun 2016 18:14:00 +0000 (13:14 -0500)
committerMimi Zohar <zohar@linux.vnet.ibm.com>
Thu, 30 Jun 2016 05:14:19 +0000 (01:14 -0400)
To keep track of which measurements have been extended to which PCRs, this
patch defines a new integrity_iint_cache field named measured_pcrs. This
field is a bitmask of the PCRs measured. Each bit corresponds to a PCR
index. For example, bit 10 corresponds to PCR 10.

Signed-off-by: Eric Richter <erichte@linux.vnet.ibm.com>
Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
security/integrity/iint.c
security/integrity/integrity.h

index 345b75997e4c2fdd6308dd76ab4e322388a4ae82..c710d22042f96c4e9d42a73943ce2d8f2689f89f 100644 (file)
@@ -79,6 +79,7 @@ static void iint_free(struct integrity_iint_cache *iint)
        iint->ima_bprm_status = INTEGRITY_UNKNOWN;
        iint->ima_read_status = INTEGRITY_UNKNOWN;
        iint->evm_status = INTEGRITY_UNKNOWN;
+       iint->measured_pcrs = 0;
        kmem_cache_free(iint_cache, iint);
 }
 
@@ -159,6 +160,7 @@ static void init_once(void *foo)
        iint->ima_bprm_status = INTEGRITY_UNKNOWN;
        iint->ima_read_status = INTEGRITY_UNKNOWN;
        iint->evm_status = INTEGRITY_UNKNOWN;
+       iint->measured_pcrs = 0;
 }
 
 static int __init integrity_iintcache_init(void)
index 90bc57d796ec1e23495a27a76104f64e8d664e11..24520b4ef3b081887f15d660aac17371fe6c9788 100644 (file)
@@ -103,6 +103,7 @@ struct integrity_iint_cache {
        struct inode *inode;    /* back pointer to inode in question */
        u64 version;            /* track inode changes */
        unsigned long flags;
+       unsigned long measured_pcrs;
        enum integrity_status ima_file_status:4;
        enum integrity_status ima_mmap_status:4;
        enum integrity_status ima_bprm_status:4;