Lines Matching defs:iint

138 				     struct ima_iint_cache *iint,
150 if (!iint)
151 iint = ima_iint_find(inode);
154 if (iint && test_and_clear_bit(IMA_MAY_EMIT_TOMTOU,
155 &iint->atomic_flags))
160 set_bit(IMA_MAY_EMIT_TOMTOU, &iint->atomic_flags);
165 &iint->atomic_flags))
176 ima_add_violation(file, *pathname, iint,
179 ima_add_violation(file, *pathname, iint,
183 static void ima_check_last_writer(struct ima_iint_cache *iint,
192 mutex_lock(&iint->mutex);
196 clear_bit(IMA_EMITTED_OPENWRITERS, &iint->atomic_flags);
199 &iint->atomic_flags);
200 if ((iint->flags & IMA_NEW_FILE) ||
205 stat.change_cookie != iint->real_inode.version) {
206 iint->flags &= ~(IMA_DONE_MASK | IMA_NEW_FILE);
207 iint->measured_pcrs = 0;
209 ima_update_xattr(iint, file);
212 mutex_unlock(&iint->mutex);
224 struct ima_iint_cache *iint;
229 iint = ima_iint_find(inode);
230 if (!iint)
233 ima_check_last_writer(iint, inode, file);
241 struct ima_iint_cache *iint = NULL;
283 iint = ima_inode_get(inode);
284 if (!iint)
289 ima_rdwr_violation_check(file, iint, action & IMA_MEASURE,
299 mutex_lock(&iint->mutex);
301 if (test_and_clear_bit(IMA_CHANGE_ATTR, &iint->atomic_flags))
306 iint->flags &= ~(IMA_APPRAISE | IMA_APPRAISED |
315 if (test_and_clear_bit(IMA_CHANGE_XATTR, &iint->atomic_flags) ||
319 iint->flags &= ~IMA_DONE_MASK;
320 iint->measured_pcrs = 0;
329 (action & IMA_DO_MASK) && (iint->flags & IMA_DONE_MASK)) {
331 integrity_inode_attrs_changed(&iint->real_inode,
333 iint->flags &= ~IMA_DONE_MASK;
334 iint->measured_pcrs = 0;
343 iint->flags &= ~(IMA_APPRAISED |
351 iint->flags |= action;
353 action &= ~((iint->flags & (IMA_DONE_MASK ^ IMA_MEASURED)) >> 1);
356 if ((action & IMA_MEASURE) && (iint->measured_pcrs & (0x1 << pcr)))
361 !(test_bit(IMA_DIGSIG, &iint->atomic_flags))) {
366 set_bit(IMA_DIGSIG, &iint->atomic_flags);
367 iint->flags |= IMA_HASHED;
369 set_bit(IMA_UPDATE_XATTR, &iint->atomic_flags);
378 rc = ima_get_cache_status(iint, func);
394 if (iint->flags & IMA_MODSIG_ALLOWED) {
398 iint->flags & IMA_MEASURED)
405 rc = ima_collect_measurement(iint, file, buf, size, hash_algo, modsig);
413 ima_store_measurement(iint, file, pathname,
417 rc = ima_check_blacklist(iint, modsig, pcr);
420 rc = ima_appraise_measurement(func, iint, file,
430 ima_audit_measurement(iint, pathname);
432 if ((file->f_flags & O_DIRECT) && (iint->flags & IMA_PERMIT_DIRECTIO))
445 if ((mask & MAY_WRITE) && test_bit(IMA_DIGSIG, &iint->atomic_flags) &&
446 !(iint->flags & IMA_NEW_FILE))
448 mutex_unlock(&iint->mutex);
458 set_bit(IMA_UPDATE_XATTR, &iint->atomic_flags);
641 struct ima_iint_cache *iint = NULL, tmp_iint;
645 iint = ima_iint_find(inode);
646 if (iint)
647 mutex_lock(&iint->mutex);
650 if ((!iint || !(iint->flags & IMA_COLLECTED)) && file) {
651 if (iint)
652 mutex_unlock(&iint->mutex);
667 iint = &tmp_iint;
668 mutex_lock(&iint->mutex);
671 if (!iint)
678 if (!iint->ima_hash || !(iint->flags & IMA_COLLECTED)) {
679 mutex_unlock(&iint->mutex);
686 copied_size = min_t(size_t, iint->ima_hash->length, buf_size);
687 memcpy(buf, iint->ima_hash->digest, copied_size);
689 hash_algo = iint->ima_hash->algo;
690 mutex_unlock(&iint->mutex);
692 if (iint == &tmp_iint)
693 kfree(iint->ima_hash);
726 * and is in the iint cache.
764 struct ima_iint_cache *iint;
776 iint = ima_inode_get(inode);
777 if (!iint)
781 set_bit(IMA_UPDATE_XATTR, &iint->atomic_flags);
782 iint->ima_file_status = INTEGRITY_PASS;
795 struct ima_iint_cache *iint;
808 iint = ima_inode_get(inode);
809 if (!iint)
813 iint->flags |= IMA_NEW_FILE;
1018 struct ima_iint_cache iint = {};
1019 struct ima_event_data event_data = {.iint = &iint,
1065 iint.ima_hash = hash_hdr;
1066 iint.ima_hash->algo = ima_hash_algo;
1067 iint.ima_hash->length = hash_digest_size[ima_hash_algo];
1069 ret = ima_calc_buffer_hash(buf, size, iint.ima_hash);
1079 iint.ima_hash);
1090 memcpy(digest, iint.ima_hash->digest, digest_hash_len);
1179 * binary requires executing modprobe itself. Since the modprobe iint->mutex