linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Christian Brauner <brauner@kernel.org>
Cc: Xiang Gao <gxxa03070307@gmail.com>,
	joel.granados@kernel.org, lorenzo.stoakes@oracle.com,
	linux-kernel@vger.kernel.org, gaoxiang17 <gaoxiang17@xiaomi.com>,
	mjguzik@gmail.com, Liam.Howlett@Oracle.com,
	viro@zeniv.linux.org.uk
Subject: Re: [PATCH] pid: Add a judgment for ns null in pid_nr_ns
Date: Mon, 1 Sep 2025 17:30:55 +0200	[thread overview]
Message-ID: <20250901153054.GA5587@redhat.com> (raw)
In-Reply-To: <20250819142557.GA11345@redhat.com>

ping...

We need either

  [1/1] pid: Add a judgment for ns null in pid_nr_ns
  https://git.kernel.org/vfs/vfs/c/006568ab4c5c

or

  [1/4] pid: make __task_pid_nr_ns(ns => NULL) safe for zombie callers
  https://git.kernel.org/vfs/vfs/c/abdfd4948e45

in any case imo the changelog should explain why do we care
to check ns != NUll, "Sometimes null is returned for task_active_pid_ns"
doesn't look like a good explanation...

Oleg.

On 08/19, Oleg Nesterov wrote:
>
> On 08/19, Christian Brauner wrote:
> >
> > On Sat, 02 Aug 2025 10:21:23 +0800, Xiang Gao wrote:
> > > __task_pid_nr_ns
> > >         ns = task_active_pid_ns(current);
> > >         pid_nr_ns(rcu_dereference(*task_pid_ptr(task, type)), ns);
> > >                 if (pid && ns->level <= pid->level) {
> > >
> > > Sometimes null is returned for task_active_pid_ns. Then it will trigger kernel panic in pid_nr_ns.
> > >
> > > [...]
> >
> > Applied to the vfs-6.18.pidfs branch of the vfs/vfs.git tree.
> > Patches in the vfs-6.18.pidfs branch should appear in linux-next soon.
> >
> > Please report any outstanding bugs that were missed during review in a
> > new review to the original patch series allowing us to drop it.
> >
> > It's encouraged to provide Acked-bys and Reviewed-bys even though the
> > patch has now been applied. If possible patch trailers will be updated.
> >
> > Note that commit hashes shown below are subject to change due to rebase,
> > trailer updates or similar. If in doubt, please check the listed branch.
> >
> > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
> > branch: vfs-6.18.pidfs
> >
> > [1/1] pid: Add a judgment for ns null in pid_nr_ns
> >       https://git.kernel.org/vfs/vfs/c/006568ab4c5c
> > [1/4] pid: make __task_pid_nr_ns(ns => NULL) safe for zombie callers
> >       https://git.kernel.org/vfs/vfs/c/abdfd4948e45
> > [3/4] pid: change bacct_add_tsk() to use task_ppid_nr_ns()
> >       https://git.kernel.org/vfs/vfs/c/b1afcaddd6c8
> > [4/4] pid: change task_state() to use task_ppid_nr_ns()
> >       https://git.kernel.org/vfs/vfs/c/d00f5232851c
> 
> Hmm. The 1st patch adds the ns != NULL check into pid_nr_ns().
> 
> This means that "[1/4] pid: make __task_pid_nr_ns(ns => NULL) safe for zombie callers"
> (commit  abdfd4948e45c51b19 in vfs-6.18.pidfs) is not needed.
> 
> OTOH... You didn't take
> 
> 	[PATCH 2/4] pid: introduce task_ppid_vnr()
> 	https://lore.kernel.org/all/20250810173610.GA19995@redhat.com/
> 
> currently in -mm tree. It is purely cosmetic, but imo makes sense.
> 
> Oleg.


  reply	other threads:[~2025-09-01 15:32 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-02  2:21 [PATCH] pid: Add a judgment for ns null in pid_nr_ns Xiang Gao
2025-08-02  2:25 ` Al Viro
     [not found]   ` <15b18541f37447dd8d5dbd8012662f67@xiaomi.com>
2025-08-02  5:52     ` 答复: [External Mail]Re: " Al Viro
2025-08-02  5:54       ` Al Viro
     [not found]       ` <c7968242db914979953277226fe55fc8@xiaomi.com>
2025-08-02  8:04         ` 答复: " Al Viro
2025-08-02  8:45     ` Oleg Nesterov
     [not found]       ` <80be47cb31d14ffc9f9a7d8d4408ab0a@xiaomi.com>
2025-08-04 11:49         ` Oleg Nesterov
2025-08-04 12:14           ` Christian Brauner
2025-08-04 12:44             ` Oleg Nesterov
2025-08-05 12:43               ` Oleg Nesterov
2025-08-08 14:56                 ` Christian Brauner
2025-08-10 15:42                   ` Oleg Nesterov
     [not found]             ` <aa5272ddcec944e2a35ca7104f6a86bf@xiaomi.com>
2025-08-05 19:43               ` 答复: [External Mail]Re: " Oleg Nesterov
2025-08-08 14:54                 ` Christian Brauner
2025-08-02  8:43   ` Oleg Nesterov
2025-08-10 17:36 ` [PATCH 1/4] pid: make __task_pid_nr_ns(ns => NULL) safe for zombie callers Oleg Nesterov
2025-08-10 17:36 ` [PATCH 2/4] pid: introduce task_ppid_vnr() Oleg Nesterov
2025-08-10 17:36 ` [PATCH 3/4] pid: change bacct_add_tsk() to use task_ppid_nr_ns() Oleg Nesterov
2025-08-10 17:36 ` [PATCH 4/4] pid: change task_state() " Oleg Nesterov
2025-08-19 11:40 ` [PATCH] pid: Add a judgment for ns null in pid_nr_ns Christian Brauner
2025-08-19 14:25   ` Oleg Nesterov
2025-09-01 15:30     ` Oleg Nesterov [this message]
2025-09-01 15:44       ` Mateusz Guzik
2025-09-01 15:55         ` Mateusz Guzik
2025-09-02 14:37           ` Oleg Nesterov
  -- strict thread matches above, loose matches on Subject: below --
2025-02-11  6:17 Xiang Gao
2025-02-11  6:49 ` Baoquan He

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=20250901153054.GA5587@redhat.com \
    --to=oleg@redhat.com \
    --cc=Liam.Howlett@Oracle.com \
    --cc=brauner@kernel.org \
    --cc=gaoxiang17@xiaomi.com \
    --cc=gxxa03070307@gmail.com \
    --cc=joel.granados@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lorenzo.stoakes@oracle.com \
    --cc=mjguzik@gmail.com \
    --cc=viro@zeniv.linux.org.uk \
    /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).