lkml.org 
[lkml]   [2022]   [Jan]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] ima: Allow template selection with ima_template[_fmt]= after ima_hash=
From
Date
On Mon, 2022-01-31 at 18:11 +0100, Roberto Sassu wrote:
> Commit c2426d2ad5027 ("ima: added support for new kernel cmdline parameter
> ima_template_fmt") introduced an additional check on the ima_template
> variable to avoid multiple template selection.
>
> Unfortunately, ima_template could be also set by the setup function of the
> ima_hash= parameter, when it calls ima_template_desc_current(). This causes
> attempts to choose a new template with ima_template= or with
> ima_template_fmt=, after ima_hash=, to be ignored.
>
> Achieve the goal of the commit mentioned with the new static variable
> template_setup_done, so that template selection requests after ima_hash=
> are not ignored.
>
> Finally, call ima_init_template_list(), if not already done, to initialize
> the list of templates before lookup_template_desc() is called.
>
> Cc: stable@vger.kernel.org
> Fixes: c2426d2ad5027 ("ima: added support for new kernel cmdline parameter ima_template_fmt")
> Signed-off-by: Roberto Sassu <roberto.sassu@huawei.com>

Thanks, Roberto.

Reviewed-by: Mimi Zohar <zohar@linux.ibm.com>

Mimi

\
 
 \ /
  Last update: 2022-01-31 20:21    [W:0.024 / U:1.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site