All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Michal Hocko <mhocko@suse.com>
Cc: cve@kernel.org, linux-kernel@vger.kernel.org,
	linux-cve-announce@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: CVE-2025-22029: exec: fix the racy usage of fs_struct->in_exec
Date: Wed, 30 Apr 2025 13:20:33 +0200	[thread overview]
Message-ID: <20250430112033.GA9277@redhat.com> (raw)
In-Reply-To: <aBH93qMAhgMEGDAY@tiehlicka>

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 :/

Oleg.


  parent reply	other threads:[~2025-04-30 11:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-16 14:12 CVE-2025-22029: exec: fix the racy usage of fs_struct->in_exec Greg Kroah-Hartman
2025-04-30 10:39 ` Michal Hocko
2025-04-30 10:57   ` Greg Kroah-Hartman
2025-04-30 11:20   ` Oleg Nesterov [this message]
2025-05-01 14:17     ` Greg Kroah-Hartman

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=20250430112033.GA9277@redhat.com \
    --to=oleg@redhat.com \
    --cc=cve@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-cve-announce@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhocko@suse.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.