[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9d1af6223f17ec0d99635bac7ca208226e5eb8d2.camel@linux.ibm.com>
Date: Tue, 08 Apr 2025 00:37:29 -0400
From: Mimi Zohar <zohar@...ux.ibm.com>
To: steven chen <chenste@...ux.microsoft.com>, stefanb@...ux.ibm.com,
roberto.sassu@...weicloud.com, roberto.sassu@...wei.com,
eric.snowberg@...cle.com, ebiederm@...ssion.com, paul@...l-moore.com,
code@...icks.com, bauermann@...abnow.com,
linux-integrity@...r.kernel.org, kexec@...ts.infradead.org,
linux-security-module@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: madvenka@...ux.microsoft.com, nramas@...ux.microsoft.com,
James.Bottomley@...senPartnership.com, bhe@...hat.com,
vgoyal@...hat.com, dyoung@...hat.com
Subject: Re: [PATCH v11 1/9] ima: rename variable the set_file "file" to
"ima_kexec_file"
Please fix the Subject line: change set_file -> seq_file
On Wed, 2025-04-02 at 05:47 -0700, steven chen wrote:
> The current kernel behavior is IMA measurements snapshot is taken at
> kexec 'load' and not at kexec 'execute'. IMA log is then carried
> over to the new kernel after kexec 'execute'. However, the time gap
> between kexec load and kexec reboot can be very long. During this
> time window, new events extended into TPM PCRs miss the chance
> to be carried over to the second kernel.
>
> To address the above, the following approach is proposed:
> - Allocate the necessary buffer during the kexec load phase.
> - Populate this buffer with the IMA measurements during
> the kexec execute phase.
>
> In the current implementation, a local variable "file" of type seq_file
> is used in the API ima_dump_measurement_list() to store the IMA measurements
> to be carried over across kexec system call. To make this buffer accessible
> at kexec 'execute' time, rename it to "ima_kexec_file" before making it
> a file variable to better reflect its purpose.
Only the reason for the variable name change is needed. Please remove
everything else.
>
> Renaming the local variable "file" of type seq_file defined in the
> ima_dump_measurement_list function to "ima_kexec_file" will improve code
> readability and maintainability by making the variable's role more explicit.
As previously mentioned, there is a difference when naming local and file static
global variables. Variable naming is described
https://www.kernel.org/doc/html/v4.10/process/coding-style.html#naming
-> Before making the local ima_dump_measurement_list() seq_file "file" variable
file static global, rename it to ima_kexec_file.
thanks,
Mimi
Powered by blists - more mailing lists