lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250804124402.GB6656@redhat.com>
Date: Mon, 4 Aug 2025 14:44:02 +0200
From: Oleg Nesterov <oleg@...hat.com>
To: Christian Brauner <brauner@...nel.org>
Cc: 高翔 <gaoxiang17@...omi.com>,
	Al Viro <viro@...iv.linux.org.uk>,
	Xiang Gao <gxxa03070307@...il.com>,
	"mjguzik@...il.com" <mjguzik@...il.com>,
	"Liam.Howlett@...cle.com" <Liam.Howlett@...cle.com>,
	"joel.granados@...nel.org" <joel.granados@...nel.org>,
	"lorenzo.stoakes@...cle.com" <lorenzo.stoakes@...cle.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] pid: Add a judgment for ns null in pid_nr_ns

On 08/04, Christian Brauner wrote:
>
> On Mon, Aug 04, 2025 at 01:49:01PM +0200, Oleg Nesterov wrote:
> >
> > You need something like
> >
> > 	info->pid = info->ppid = 0;
> >
> > 	rcu_read_lock();
> > 	if (pid_alive(tsk)) {
> > 		info->pid = task_pid_vnr(tsk);
> > 		info->ppid = task_tgid_vnr(tsk->real_parent);
> > 	}
> > 	rcu_read_unlock();
>
> I distinctly remember having seen a similar patch about 5 years ago that
> did the exact same fix for some out-of-tree abuse:
> 20201201024811.GA72235@...172-31-62-0.us-west-2.compute.internal
>
> Where in the kernel is that code supposed to live? Is this again an
> out-of-tree module?

I don't know.

But. I need to re-check, but I just realized that pid_alive() can't
really help, tsk->thread_pid is not stable even if tsk == current.

This means that, say, task_ppid_nr_ns() is buggy.

I'll return to this tomorrow.

Oleg.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ