Commit c5563bad authored by Lakshmi Ramasubramanian's avatar Lakshmi Ramasubramanian Committed by Mimi Zohar

IMA: Check IMA policy flag

process_buffer_measurement() may be called prior to IMA being
initialized (for instance, when the IMA hook is called when
a key is added to the .builtin_trusted_keys keyring), which
would result in a kernel panic.

This patch adds the check in process_buffer_measurement()
to return immediately if IMA is not initialized yet.
Signed-off-by: default avatarLakshmi Ramasubramanian <nramas@linux.microsoft.com>
Signed-off-by: default avatarMimi Zohar <zohar@linux.ibm.com>
parent 96c9e1de
...@@ -655,6 +655,9 @@ void process_buffer_measurement(const void *buf, int size, ...@@ -655,6 +655,9 @@ void process_buffer_measurement(const void *buf, int size,
int action = 0; int action = 0;
u32 secid; u32 secid;
if (!ima_policy_flag)
return;
/* /*
* Both LSM hooks and auxilary based buffer measurements are * Both LSM hooks and auxilary based buffer measurements are
* based on policy. To avoid code duplication, differentiate * based on policy. To avoid code duplication, differentiate
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment