[PATCH v9 7/7] ima: measure kexec load and exec events as critical data
steven chen
chenste at linux.microsoft.com
Wed Mar 5 00:57:16 UTC 2025
On 3/4/2025 4:25 PM, Mimi Zohar wrote:
> Hi Steven,
>
> On Tue, 2025-03-04 at 11:03 -0800, steven chen wrote:
>> +void ima_measure_kexec_event(const char *event_name)
>> +{
>> + char ima_kexec_event[IMA_KEXEC_EVENT_LEN];
>> + size_t buf_size = 0;
>> + long len;
>> +
>> + buf_size = ima_get_binary_runtime_size();
>> + len = atomic_long_read(&ima_htable.len);
>> +
>> + int n = scnprintf(ima_kexec_event, IMA_KEXEC_EVENT_LEN,
>> + "kexec_segment_size=%lu;ima_binary_runtime_size=%lu;"
>> + "ima_runtime_measurements_count=%ld;",
>> + kexec_segment_size, buf_size, len);
> Variables should not be defined inline, but at the beginning of the function.
> After doing that, scripts/checkpatch.pl complains about the formatting.
>
> Mimi
Hi Mimi,
I will update it in next release.
Thanks,
Steven
>> +
>> + ima_measure_critical_data("ima_kexec", event_name, ima_kexec_event, n, false, NULL, 0);
>> +}
>> +
More information about the Linux-security-module-archive
mailing list