Lines Matching refs:iint

118 				     struct ima_iint_cache *iint,
130 if (!iint)
131 iint = ima_iint_find(inode);
133 if (iint && test_bit(IMA_MUST_MEASURE,
134 &iint->atomic_flags))
139 set_bit(IMA_MUST_MEASURE, &iint->atomic_flags);
150 ima_add_violation(file, *pathname, iint,
153 ima_add_violation(file, *pathname, iint,
157 static void ima_check_last_writer(struct ima_iint_cache *iint,
166 mutex_lock(&iint->mutex);
171 &iint->atomic_flags);
172 if ((iint->flags & IMA_NEW_FILE) ||
177 stat.change_cookie != iint->real_inode.version) {
178 iint->flags &= ~(IMA_DONE_MASK | IMA_NEW_FILE);
179 iint->measured_pcrs = 0;
181 ima_update_xattr(iint, file);
184 mutex_unlock(&iint->mutex);
196 struct ima_iint_cache *iint;
201 iint = ima_iint_find(inode);
202 if (!iint)
205 ima_check_last_writer(iint, inode, file);
213 struct ima_iint_cache *iint = NULL;
253 iint = ima_inode_get(inode);
254 if (!iint)
259 ima_rdwr_violation_check(file, iint, action & IMA_MEASURE,
269 mutex_lock(&iint->mutex);
271 if (test_and_clear_bit(IMA_CHANGE_ATTR, &iint->atomic_flags))
273 iint->flags &= ~(IMA_APPRAISE | IMA_APPRAISED |
282 if (test_and_clear_bit(IMA_CHANGE_XATTR, &iint->atomic_flags) ||
286 iint->flags &= ~IMA_DONE_MASK;
287 iint->measured_pcrs = 0;
296 (action & IMA_DO_MASK) && (iint->flags & IMA_DONE_MASK)) {
298 integrity_inode_attrs_changed(&iint->real_inode,
300 iint->flags &= ~IMA_DONE_MASK;
301 iint->measured_pcrs = 0;
310 iint->flags &= ~(IMA_APPRAISED |
318 iint->flags |= action;
320 action &= ~((iint->flags & (IMA_DONE_MASK ^ IMA_MEASURED)) >> 1);
323 if ((action & IMA_MEASURE) && (iint->measured_pcrs & (0x1 << pcr)))
328 !(test_bit(IMA_DIGSIG, &iint->atomic_flags))) {
333 set_bit(IMA_DIGSIG, &iint->atomic_flags);
334 iint->flags |= IMA_HASHED;
336 set_bit(IMA_UPDATE_XATTR, &iint->atomic_flags);
345 rc = ima_get_cache_status(iint, func);
361 if (iint->flags & IMA_MODSIG_ALLOWED) {
365 iint->flags & IMA_MEASURED)
372 rc = ima_collect_measurement(iint, file, buf, size, hash_algo, modsig);
380 ima_store_measurement(iint, file, pathname,
384 rc = ima_check_blacklist(iint, modsig, pcr);
387 rc = ima_appraise_measurement(func, iint, file,
397 ima_audit_measurement(iint, pathname);
399 if ((file->f_flags & O_DIRECT) && (iint->flags & IMA_PERMIT_DIRECTIO))
412 if ((mask & MAY_WRITE) && test_bit(IMA_DIGSIG, &iint->atomic_flags) &&
413 !(iint->flags & IMA_NEW_FILE))
415 mutex_unlock(&iint->mutex);
425 set_bit(IMA_UPDATE_XATTR, &iint->atomic_flags);
580 struct ima_iint_cache *iint = NULL, tmp_iint;
584 iint = ima_iint_find(inode);
585 if (iint)
586 mutex_lock(&iint->mutex);
589 if ((!iint || !(iint->flags & IMA_COLLECTED)) && file) {
590 if (iint)
591 mutex_unlock(&iint->mutex);
606 iint = &tmp_iint;
607 mutex_lock(&iint->mutex);
610 if (!iint)
617 if (!iint->ima_hash || !(iint->flags & IMA_COLLECTED)) {
618 mutex_unlock(&iint->mutex);
625 copied_size = min_t(size_t, iint->ima_hash->length, buf_size);
626 memcpy(buf, iint->ima_hash->digest, copied_size);
628 hash_algo = iint->ima_hash->algo;
629 mutex_unlock(&iint->mutex);
631 if (iint == &tmp_iint)
632 kfree(iint->ima_hash);
665 * and is in the iint cache.
703 struct ima_iint_cache *iint;
715 iint = ima_inode_get(inode);
716 if (!iint)
720 set_bit(IMA_UPDATE_XATTR, &iint->atomic_flags);
721 iint->ima_file_status = INTEGRITY_PASS;
734 struct ima_iint_cache *iint;
747 iint = ima_inode_get(inode);
748 if (!iint)
752 iint->flags |= IMA_NEW_FILE;
957 struct ima_iint_cache iint = {};
958 struct ima_event_data event_data = {.iint = &iint,
1004 iint.ima_hash = hash_hdr;
1005 iint.ima_hash->algo = ima_hash_algo;
1006 iint.ima_hash->length = hash_digest_size[ima_hash_algo];
1008 ret = ima_calc_buffer_hash(buf, size, iint.ima_hash);
1018 iint.ima_hash);
1029 memcpy(digest, iint.ima_hash->digest, digest_hash_len);
1121 * binary requires executing modprobe itself. Since the modprobe iint->mutex