public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: steven chen <chenste@linux.microsoft.com>
To: Mimi Zohar <zohar@linux.ibm.com>, Baoquan He <bhe@redhat.com>
Cc: stefanb@linux.ibm.com, roberto.sassu@huaweicloud.com,
	roberto.sassu@huawei.com, eric.snowberg@oracle.com,
	ebiederm@xmission.com, paul@paul-moore.com, code@tyhicks.com,
	bauermann@kolabnow.com, linux-integrity@vger.kernel.org,
	kexec@lists.infradead.org, linux-security-module@vger.kernel.org,
	linux-kernel@vger.kernel.org, madvenka@linux.microsoft.com,
	nramas@linux.microsoft.com,
	James.Bottomley@hansenpartnership.com, vgoyal@redhat.com,
	dyoung@redhat.com
Subject: Re: [PATCH v9 1/7] ima: copy only complete measurement records across kexec
Date: Thu, 6 Mar 2025 14:45:50 -0800	[thread overview]
Message-ID: <8bc74dd8-ecd0-44ad-88a2-8b36fa61100a@linux.microsoft.com> (raw)
In-Reply-To: <fe6e3c1333a50d66dc876b5a196d3491170802a8.camel@linux.ibm.com>

On 3/5/2025 4:27 AM, Mimi Zohar wrote:
> On Wed, 2025-03-05 at 20:08 +0800, Baoquan He wrote:
>> On 03/04/25 at 11:03am, steven chen wrote:
>>> Carrying the IMA measurement list across kexec requires allocating a
>>> buffer and copying the measurement records.  Separate allocating the
>>> buffer and copying the measurement records into separate functions in
>>> order to allocate the buffer at kexec 'load' and copy the measurements
>>> at kexec 'execute'.
>>>
>>> This patch includes the following changes:
>> I don't know why one patch need include so many changes. From below log,
>> it should be split into separate patches. It may not need to make one
>> patch to reflect one change, we should at least split and wrap several
>> kind of changes to ease patch understanding and reviewing. My personal
>> opinion.
> Agreed, well explained.
>
> Mimi
>
>>>   - Refactor ima_dump_measurement_list() to move the memory allocation
>>>     to a separate function ima_alloc_kexec_file_buf() which allocates
>>>     buffer of size 'kexec_segment_size' at kexec 'load'.
>>>   - Make the local variable ima_kexec_file in ima_dump_measurement_list()
>>>     a local static to the file, so that it can be accessed from
>>>     ima_alloc_kexec_file_buf(). Compare actual memory required to ensure
>>>     there is enough memory for the entire measurement record.
>>>   - Copy only complete measurement records.
>>>   - Make necessary changes to the function ima_add_kexec_buffer() to call
>>>     the above two functions.
>>>   - Compared the memory size allocated with memory size of the entire
>>>     measurement record. Copy only complete measurement records if there
>>>     is enough memory. If there is not enough memory, it will not copy
>>>     any IMA measurement records, and this situation will result in a
>>>     failure of remote attestation.
>>>
>>> Suggested-by: Mimi Zohar <zohar@linux.ibm.com>
>>> Signed-off-by: Tushar Sugandhi <tusharsu@linux.microsoft.com>
>>> Signed-off-by: steven chen <chenste@linux.microsoft.com>

I will split this patch into the following two patches:

     ima: define and call ima_alloc_kexec_file_buf
     ima: copy measurement records as much as possible across kexec

Thanks,

Steven


  reply	other threads:[~2025-03-06 22:45 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-04 19:03 [PATCH v9 0/7] ima: kexec: measure events between kexec load and execute steven chen
2025-03-04 19:03 ` [PATCH v9 1/7] ima: copy only complete measurement records across kexec steven chen
2025-03-05  2:08   ` Mimi Zohar
2025-03-05 11:34     ` Mimi Zohar
2025-03-05 12:08   ` Baoquan He
2025-03-05 12:27     ` Mimi Zohar
2025-03-06 22:45       ` steven chen [this message]
2025-03-07  2:51         ` Mimi Zohar
2025-03-11 12:44           ` Mimi Zohar
2025-03-11 23:45             ` steven chen
2025-03-04 19:03 ` [PATCH v9 2/7] kexec: define functions to map and unmap segments steven chen
2025-03-04 22:23   ` Jarkko Sakkinen
2025-03-05  0:55     ` steven chen
2025-03-05 12:24       ` Baoquan He
2025-03-17 18:26         ` steven chen
2025-03-06  6:35   ` Dan Carpenter
2025-03-04 19:03 ` [PATCH v9 3/7] ima: kexec: skip IMA segment validation after kexec soft reboot steven chen
2025-03-05 12:37   ` Baoquan He
2025-03-04 19:03 ` [PATCH v9 4/7] ima: kexec: define functions to copy IMA log at soft boot steven chen
2025-03-12  8:57   ` kernel test robot
2025-03-04 19:03 ` [PATCH v9 5/7] ima: kexec: move IMA log copy from kexec load to execute steven chen
2025-03-04 19:03 ` [PATCH v9 6/7] ima: make the kexec extra memory configurable steven chen
2025-03-04 19:03 ` [PATCH v9 7/7] ima: measure kexec load and exec events as critical data steven chen
2025-03-05  0:25   ` Mimi Zohar
2025-03-05  0:57     ` steven chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8bc74dd8-ecd0-44ad-88a2-8b36fa61100a@linux.microsoft.com \
    --to=chenste@linux.microsoft.com \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=bauermann@kolabnow.com \
    --cc=bhe@redhat.com \
    --cc=code@tyhicks.com \
    --cc=dyoung@redhat.com \
    --cc=ebiederm@xmission.com \
    --cc=eric.snowberg@oracle.com \
    --cc=kexec@lists.infradead.org \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=madvenka@linux.microsoft.com \
    --cc=nramas@linux.microsoft.com \
    --cc=paul@paul-moore.com \
    --cc=roberto.sassu@huawei.com \
    --cc=roberto.sassu@huaweicloud.com \
    --cc=stefanb@linux.ibm.com \
    --cc=vgoyal@redhat.com \
    --cc=zohar@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox