lkml.org 
[lkml]   [2021]   [Jun]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC][PATCH 01/12] ima: Add digest, algo, measured parameters to ima_measure_critical_data()
From
Date
On Fri, 2021-06-25 at 18:56 +0200, Roberto Sassu wrote:
> ima_measure_critical_data() allows any caller in the kernel to provide a
> buffer, so that is measured by IMA if an appropriate policy is set. Some
> information that could be useful to the callers are the digest of the
> buffer included in the new measurement entry, the digest algorithm and
> whether the buffer was measured.
>
> This patch modifies the definition of ima_measure_critical_data() to
> include three new parameters: digest, algo and measured. If they are NULL,
> the function behaves as before and just measures the buffer, if requested
> with the IMA policy. Otherwise, it also writes the digest, algorithm and
> whether the buffer is measured to the provided pointers.
>
> If the pointers are not NULL, the digest is calculated also if there is no
> matching rule in the IMA policy.

As much as possible, let's not define additional
ima_measure_critical_data() arguments. Probably the only new variable
really need is "digest". The hash algorithm doesn't change. How about
defining and exporting a new function to return the system defined
ima_hash_algo. In terms of failure, have ima_measure_critical_data()
return errno.

thanks,

Mimi

\
 
 \ /
  Last update: 2021-06-25 20:28    [W:1.972 / U:0.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site