Re: [PATCH v4 2/2] IMA: Call workqueue functions to measure queued keys

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2019-12-16 at 15:53 +0900, James Bottomley wrote:
> That doesn't matter ... the question is, is the input assumption that
> both pre/post have to be called or neither must correct?  If so, the
> code is wrong, if not, explain why.

Thanks, James, for looking at the locking.

"ima_process_keys" is set once.  Once it is set, the keys are measured
immediately.  For performance to avoid taking the mutex, both the
reader and writer check "ima_process_keys" twice, once without taking
the lock and, again, after taking the lock.  Based on the second test,
the reader queues the "key" or not.  Refer to ima_queue_key().

The latest patch version sets "ima_process_keys" after taking the
lock.  With this change, the comment in ima_process_queued_keys() is
now correct.  We're now guaranteed to process the queued "keys" just
once and not drop any "key" measurements.

I hope this answers your question.

Mimi




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux Kernel]     [Linux Kernel Hardening]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux