From: sashiko-bot@kernel.org
To: "Jérémy Jean" <Jeremy.Jean@oss.cyber.gouv.fr>,
"Andrew Morton" <akpm@linux-foundation.org>,
"Baoquan He" <baoquan.he@linux.dev>,
"Mike Rapoport" <rppt@kernel.org>,
"Pasha Tatashin" <pasha.tatashin@soleen.com>,
"Pratyush Yadav" <pratyush@kernel.org>,
"Mimi Zohar" <zohar@linux.ibm.com>,
"Roberto Sassu" <roberto.sassu@huawei.com>,
"Dmitry Kasatkin" <dmitry.kasatkin@gmail.com>
Cc: "Eric Snowberg" <eric.snowberg@oracle.com>,
linux-security-module@vger.kernel.org, kexec@lists.infradead.org
Subject: Re: [PATCH v2 2/3] ima: keep kexec dump state tied to installed image
Date: Thu, 12 Nov 2026 13:07:12 +0000 [thread overview]
Message-ID: <sashiko-outbox-211138@kernel.org> (raw)
In-Reply-To: <20261112125246.2715174-4-Jeremy.Jean@oss.cyber.gouv.fr>
> ima_add_kexec_buffer() updates the global measurement scratch buffer
> and segment size for the new image. If kexec_file_load() fails, the
> new image is freed but the scratch buffer and segment size remain. When
> kexec starts the installed image, ima_update_kexec_buffer() dumps the
> measurement list into the IMA segment. A larger failed segment causes an
> OOB write, while a smaller one truncates the log and reports the wrong
> size in the kexec_execute event. KASAN for instsance reports the OOB
> writes as:
>
> BUG: KASAN: vmalloc-out-of-bounds in ima_update_kexec_buffer+0x265/0x280
> Write of size 868426 at addr ffffc9000004e000 by task init/1
> ...
> __asan_memcpy+0x3b/0x60
> ima_update_kexec_buffer+0x265/0x280
>
> Leave installed scratch state unchanged until all later load steps pass.
> Store new buffers in the candidate and reuse only equal-size installed
> buffers. Emit kexec_load before those steps with the local size.
> Allocation failure still omits the optional segment.
>
> Fixes: 9f0ec4b16f2b ("ima: kexec: move IMA log copy from kexec load to execute")
> Cc: stable@vger.kernel.org
> Signed-off-by: Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261112125246.2715174-2-Jeremy.Jean@oss.cyber.gouv.fr?part=2
next prev parent reply other threads:[~2026-11-12 13:07 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-12 12:52 [PATCH v2 0/3] ima: keep kexec dump state tied to installed image Jérémy Jean
2026-11-12 12:52 ` [PATCH v2 1/3] kexec_file: update IMA after machine post-load Jérémy Jean
2026-11-12 13:04 ` sashiko-bot
2026-11-12 12:52 ` [PATCH v2 2/3] ima: keep kexec dump state tied to installed image Jérémy Jean
2026-11-12 13:07 ` sashiko-bot [this message]
2026-11-12 12:52 ` [PATCH v2 3/3] ima: clear kexec state when replacing file image Jérémy Jean
2026-11-12 13:08 ` sashiko-bot
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=sashiko-outbox-211138@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=Jeremy.Jean@oss.cyber.gouv.fr \
--cc=akpm@linux-foundation.org \
--cc=baoquan.he@linux.dev \
--cc=dmitry.kasatkin@gmail.com \
--cc=eric.snowberg@oracle.com \
--cc=kexec@lists.infradead.org \
--cc=linux-security-module@vger.kernel.org \
--cc=pasha.tatashin@soleen.com \
--cc=pratyush@kernel.org \
--cc=roberto.sassu@huawei.com \
--cc=rppt@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--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