lkml.org 
[lkml]   [2019]   [Oct]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2 1/4] KEYS: Defined an ima hook for measuring keys on key create or update
From
Date
On 10/25/2019 12:40 PM, Mimi Zohar wrote:

>> +void ima_post_key_create_or_update(struct key *keyring, struct key *key,
>> + unsigned long flags, bool create)
>> +{
>> + const struct public_key *pk;
>> +
>> + if (key->type != &key_type_asymmetric)
>> + return;
>> +
>> + if (!ima_initialized)
>> + return;
>
> There's no reason to define a new variable to determine if IMA is
> initialized.  Use ima_policy_flag.

Please correct me if I am wrong -

ima_policy_flag will be set to 0 if IMA is not yet initialized
OR
IMA is initialized, but ima_policy_flag could be still set to 0 (say,
due to the configured policy).

In the latter case the measurement request should be a NOP immediately.

-lakshmi

\
 
 \ /
  Last update: 2019-10-26 00:29    [W:1.087 / U:0.216 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site