From: Mimi Zohar <zohar@linux.ibm.com>
To: Chris J Arges <carges@cloudflare.com>, roberto.sassu@huawei.com
Cc: kernel-team@cloudflare.com,
"Dmitry Kasatkin" <dmitry.kasatkin@gmail.com>,
"Eric Snowberg" <eric.snowberg@oracle.com>,
"Paul Moore" <paul@paul-moore.com>,
"James Morris" <jmorris@namei.org>,
"Serge E. Hallyn" <serge@hallyn.com>,
"Mickaël Salaün" <mic@digikod.net>, "Kees Cook" <kees@kernel.org>,
linux-integrity@vger.kernel.org,
linux-security-module@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] ima: Fix stack-out-of-bounds in is_bprm_creds_for_exec()
Date: Tue, 23 Dec 2025 16:58:26 -0500 [thread overview]
Message-ID: <3aeed1ff9388f09555bf5c6ade03cbe9ce93ff14.camel@linux.ibm.com> (raw)
In-Reply-To: <20251221180128.1026760-1-carges@cloudflare.com>
Hi Chris,
On Sun, 2025-12-21 at 12:01 -0600, Chris J Arges wrote:
> KASAN reported a stack-out-of-bounds access in ima_appraise_measurement
> from is_bprm_creds_for_exec:
>
> BUG: KASAN: stack-out-of-bounds in ima_appraise_measurement+0x12dc/0x16a0
> Read of size 1 at addr ffffc9000160f940 by task sudo/550
> The buggy address belongs to stack of task sudo/550
> and is located at offset 24 in frame:
> ima_appraise_measurement+0x0/0x16a0
> This frame has 2 objects:
> [48, 56) 'file'
> [80, 148) 'hash'
>
> This is caused by using container_of on the *file pointer. This offset
> calculation is what triggers the stack-out-of-bounds error.
>
> In order to fix this, pass in a bprm_is_check boolean which can be set
> depending on how process_measurement is called. If the caller has a
> linux_binprm pointer and the function is BPRM_CHECK we can determine
> is_check and set it then. Otherwise set it to false.
>
> Fixes: 95b3cdafd7cb7 ("ima: instantiate the bprm_creds_for_exec() hook")
>
> Signed-off-by: Chris J Arges <carges@cloudflare.com>
Thank you! I'd appreciate your limiting the line lengths to 80 chars (e.g.
scripts/checkpatch.pl --max-line-length=80).
--
thanks,
Mimi
next prev parent reply other threads:[~2025-12-23 21:59 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-19 19:54 [PATCH] " Chris J Arges
2025-12-20 15:21 ` kernel test robot
2025-12-20 18:37 ` kernel test robot
2025-12-21 18:01 ` [PATCH v2] " Chris J Arges
2025-12-23 21:58 ` Mimi Zohar [this message]
2025-12-28 3:16 ` Chris Arges
2025-12-28 3:18 ` [PATCH v3] " Chris J Arges
2025-12-29 21:13 ` Mimi Zohar
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=3aeed1ff9388f09555bf5c6ade03cbe9ce93ff14.camel@linux.ibm.com \
--to=zohar@linux.ibm.com \
--cc=carges@cloudflare.com \
--cc=dmitry.kasatkin@gmail.com \
--cc=eric.snowberg@oracle.com \
--cc=jmorris@namei.org \
--cc=kees@kernel.org \
--cc=kernel-team@cloudflare.com \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=mic@digikod.net \
--cc=paul@paul-moore.com \
--cc=roberto.sassu@huawei.com \
--cc=serge@hallyn.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
all inboxes | Powered by JetHome®