From: Chris Arges <carges@cloudflare.com>
To: Mimi Zohar <zohar@linux.ibm.com>
Cc: roberto.sassu@huawei.com, 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: Sat, 27 Dec 2025 21:16:43 -0600 [thread overview]
Message-ID: <aVChG8bjcAqOBEJi@861G6M3> (raw)
In-Reply-To: <3aeed1ff9388f09555bf5c6ade03cbe9ce93ff14.camel@linux.ibm.com>
On 2025-12-23 16:58:26, Mimi Zohar wrote:
> 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
Sure thing, I'll make that adjustment and send v3.
--chris
next prev parent reply other threads:[~2025-12-28 3:16 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-19 19:54 [PATCH] ima: Fix stack-out-of-bounds in is_bprm_creds_for_exec() 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
2025-12-28 3:16 ` Chris Arges [this message]
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=aVChG8bjcAqOBEJi@861G6M3 \
--to=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 \
--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;
as well as URLs for NNTP newsgroup(s).