From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Oleg Nesterov <oleg@redhat.com>
Cc: Michal Hocko <mhocko@suse.com>,
cve@kernel.org, linux-kernel@vger.kernel.org,
linux-cve-announce@vger.kernel.org
Subject: Re: CVE-2025-22029: exec: fix the racy usage of fs_struct->in_exec
Date: Thu, 1 May 2025 16:17:00 +0200 [thread overview]
Message-ID: <2025050148-celtic-espresso-60d2@gregkh> (raw)
In-Reply-To: <20250430112033.GA9277@redhat.com>
On Wed, Apr 30, 2025 at 01:20:33PM +0200, Oleg Nesterov wrote:
> On 04/30, Michal Hocko wrote:
> >
> > Based on a follow up update from Oleg[1] I would like to dispute this
> > CVE.
>
> Agreed. Let me quote my reply to my "fix", see
> https://lore.kernel.org/all/20250429154944.GA18907@redhat.com/
>
> Damn, I am stupid.
>
> On 03/24, Oleg Nesterov wrote:
> >
> > check_unsafe_exec() sets fs->in_exec under cred_guard_mutex, then execve()
> > paths clear fs->in_exec lockless. This is fine if exec succeeds, but if it
> > fails we have the following race:
> >
> > T1 sets fs->in_exec = 1, fails, drops cred_guard_mutex
> >
> > T2 sets fs->in_exec = 1
> >
> > T1 clears fs->in_exec
>
> When I look at this code again, I think this race was not possible and thus
> this patch (applied as af7bb0d2ca45) was not needed.
>
> Yes, begin_new_exec() can drop cred_guard_mutex on failure, but only after
> de_thread() succeeds, when we can't race with another sub-thread.
>
> I hope this patch didn't make the things worse so we don't need to revert it.
> Plus I think it makes this (confusing) logic a bit more clear. Just, unless
> I am confused again, it wasn't really needed.
>
> Sorry for the confusion caused by my patch :/
Sorry for the delay, the CVE is now rejected, thanks.
greg k-h
prev parent reply other threads:[~2025-05-01 14:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <2025041655-CVE-2025-22029-349f@gregkh>
2025-04-30 10:39 ` Michal Hocko
2025-04-30 10:57 ` Greg Kroah-Hartman
2025-04-30 11:20 ` Oleg Nesterov
2025-05-01 14:17 ` Greg Kroah-Hartman [this message]
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=2025050148-celtic-espresso-60d2@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=cve@kernel.org \
--cc=linux-cve-announce@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mhocko@suse.com \
--cc=oleg@redhat.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
Powered by JetHome