* Re: Patch "rust: task: restrict Task::group_leader() to current" has been added to the 6.18-stable tree
[not found] <20260221161726.4075998-1-sashal@kernel.org>
@ 2026-03-23 10:10 ` Alice Ryhl
2026-03-23 10:18 ` Miguel Ojeda
0 siblings, 1 reply; 4+ messages in thread
From: Alice Ryhl @ 2026-03-23 10:10 UTC (permalink / raw)
To: stable
Cc: stable-commits, Miguel Ojeda, Boqun Feng, Gary Guo,
Björn Roy Baron, Benno Lossin, Andreas Hindborg,
Trevor Gross, Danilo Krummrich
On Sat, Feb 21, 2026 at 5:17 PM Sasha Levin <sashal@kernel.org> wrote:
>
> This is a note to let you know that I've just added the patch titled
>
> rust: task: restrict Task::group_leader() to current
>
> to the 6.18-stable tree which can be found at:
> http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
>
> The filename of the patch is:
> rust-task-restrict-task-group_leader-to-current.patch
> and it can be found in the queue-6.18 subdirectory.
>
> If you, or anyone else, feels it should not be added to the stable tree,
> please let <stable@vger.kernel.org> know about it.
>
>
>
> commit afd4cb72fea7e256c378bc90efc19e140da35e00
> Author: Alice Ryhl <aliceryhl@google.com>
> Date: Wed Jan 7 08:28:46 2026 +0000
>
> rust: task: restrict Task::group_leader() to current
>
> [ Upstream commit 105ddfb2d2b3acec7a7d9695463df48733d91e6c ]
>
> The Task::group_leader() method currently allows you to access the
> group_leader() of any task, for example one you hold a refcount to. But
> this is not safe in general since the group leader could change when a
> task exits. See for example commit a15f37a40145c ("kernel/sys.c: fix the
> racy usage of task_lock(tsk->group_leader) in sys_prlimit64() paths").
>
> All existing users of Task::group_leader() call this method on current,
> which is guaranteed running, so there's not an actual issue in Rust code
> today. But to prevent code in the future from making this mistake,
> restrict Task::group_leader() so that it can only be called on current.
>
> There are some other cases where accessing task->group_leader is okay.
> For example it can be safe if you hold tasklist_lock or rcu_read_lock().
> However, only supporting current->group_leader is sufficient for all
> in-tree Rust users of group_leader right now. Safe Rust functionality for
> accessing it under rcu or while holding tasklist_lock may be added in the
> future if required by any future Rust module.
>
> This patch is a bugfix in that it prevents users of this API from writing
> incorrect code. It doesn't change behavior of correct code.
>
> Link: https://lkml.kernel.org/r/20260107-task-group-leader-v2-1-8fbf816f2a2f@google.com
> Signed-off-by: Alice Ryhl <aliceryhl@google.com>
> Fixes: 313c4281bc9d ("rust: add basic `Task`")
> Reported-by: Oleg Nesterov <oleg@redhat.com>
> Closes: https://lore.kernel.org/all/aTLnV-5jlgfk1aRK@redhat.com/
> Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
> Reviewed-by: Gary Guo <gary@garyguo.net>
> Cc: Andreas Hindborg <a.hindborg@kernel.org>
> Cc: Benno Lossin <lossin@kernel.org>
> Cc: "Björn Roy Baron" <bjorn3_gh@protonmail.com>
> Cc: Björn Roy Baron <bjorn3_gh@protonmail.com>
> Cc: Christian Brauner <brauner@kernel.org>
> Cc: Danilo Krummrich <dakr@kernel.org>
> Cc: FUJITA Tomonori <fujita.tomonori@gmail.com>
> Cc: Miguel Ojeda <ojeda@kernel.org>
> Cc: Panagiotis Foliadis <pfoliadis@posteo.net>
> Cc: Shankari Anand <shankari.ak0208@gmail.com>
> Cc: Trevor Gross <tmgross@umich.edu>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> Signed-off-by: Sasha Levin <sashal@kernel.org>
I noticed that this was backported to 6.18, but not to 6.12. Is that
because the first user of this function was merged in 6.18, or is
there some other reason?
Alice
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Patch "rust: task: restrict Task::group_leader() to current" has been added to the 6.18-stable tree
2026-03-23 10:10 ` Patch "rust: task: restrict Task::group_leader() to current" has been added to the 6.18-stable tree Alice Ryhl
@ 2026-03-23 10:18 ` Miguel Ojeda
2026-03-23 10:30 ` Greg KH
0 siblings, 1 reply; 4+ messages in thread
From: Miguel Ojeda @ 2026-03-23 10:18 UTC (permalink / raw)
To: Alice Ryhl
Cc: stable, stable-commits, Miguel Ojeda, Boqun Feng, Gary Guo,
Björn Roy Baron, Benno Lossin, Andreas Hindborg,
Trevor Gross, Danilo Krummrich
On Mon, Mar 23, 2026 at 11:11 AM Alice Ryhl <aliceryhl@google.com> wrote:
>
> I noticed that this was backported to 6.18, but not to 6.12. Is that
> because the first user of this function was merged in 6.18, or is
> there some other reason?
If it was meant to be backported, then the commit should have Cc:
stable@vger.kernel.org.
Perhaps it was picked for 6.18 (and 6.19) because it applied cleanly.
Cheers,
Miguel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Patch "rust: task: restrict Task::group_leader() to current" has been added to the 6.18-stable tree
2026-03-23 10:18 ` Miguel Ojeda
@ 2026-03-23 10:30 ` Greg KH
2026-03-23 10:33 ` Alice Ryhl
0 siblings, 1 reply; 4+ messages in thread
From: Greg KH @ 2026-03-23 10:30 UTC (permalink / raw)
To: Miguel Ojeda
Cc: Alice Ryhl, stable, stable-commits, Miguel Ojeda, Boqun Feng,
Gary Guo, Björn Roy Baron, Benno Lossin, Andreas Hindborg,
Trevor Gross, Danilo Krummrich
On Mon, Mar 23, 2026 at 11:18:50AM +0100, Miguel Ojeda wrote:
> On Mon, Mar 23, 2026 at 11:11 AM Alice Ryhl <aliceryhl@google.com> wrote:
> >
> > I noticed that this was backported to 6.18, but not to 6.12. Is that
> > because the first user of this function was merged in 6.18, or is
> > there some other reason?
>
> If it was meant to be backported, then the commit should have Cc:
> stable@vger.kernel.org.
>
> Perhaps it was picked for 6.18 (and 6.19) because it applied cleanly.
That is correct, we take "Fixes:" only commits as a "best effort" type
of thing. This doesn't apply cleanly to 6.12.y so it was not applied
there, nor was there a FAILED email sent as it wasn't asked directly to
be applied by the developer/maintainer.
hope this helps explain,
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Patch "rust: task: restrict Task::group_leader() to current" has been added to the 6.18-stable tree
2026-03-23 10:30 ` Greg KH
@ 2026-03-23 10:33 ` Alice Ryhl
0 siblings, 0 replies; 4+ messages in thread
From: Alice Ryhl @ 2026-03-23 10:33 UTC (permalink / raw)
To: Greg KH
Cc: Miguel Ojeda, stable, stable-commits, Miguel Ojeda, Boqun Feng,
Gary Guo, Björn Roy Baron, Benno Lossin, Andreas Hindborg,
Trevor Gross, Danilo Krummrich
On Mon, Mar 23, 2026 at 11:31 AM Greg KH <greg@kroah.com> wrote:
>
> On Mon, Mar 23, 2026 at 11:18:50AM +0100, Miguel Ojeda wrote:
> > On Mon, Mar 23, 2026 at 11:11 AM Alice Ryhl <aliceryhl@google.com> wrote:
> > >
> > > I noticed that this was backported to 6.18, but not to 6.12. Is that
> > > because the first user of this function was merged in 6.18, or is
> > > there some other reason?
> >
> > If it was meant to be backported, then the commit should have Cc:
> > stable@vger.kernel.org.
> >
> > Perhaps it was picked for 6.18 (and 6.19) because it applied cleanly.
>
> That is correct, we take "Fixes:" only commits as a "best effort" type
> of thing. This doesn't apply cleanly to 6.12.y so it was not applied
> there, nor was there a FAILED email sent as it wasn't asked directly to
> be applied by the developer/maintainer.
>
> hope this helps explain,
ah, ok, that makes sense, thanks!
Alice
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-03-23 10:34 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20260221161726.4075998-1-sashal@kernel.org>
2026-03-23 10:10 ` Patch "rust: task: restrict Task::group_leader() to current" has been added to the 6.18-stable tree Alice Ryhl
2026-03-23 10:18 ` Miguel Ojeda
2026-03-23 10:30 ` Greg KH
2026-03-23 10:33 ` Alice Ryhl
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox