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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMw=ZnRt3Zvmf9Nt0sDHGPUn06HP3NE3at=x+infO=Ms4gYDGA@mail.gmail.com>
Date: Fri, 4 Oct 2024 19:50:11 +0100
From: Luca Boccassi <luca.boccassi@...il.com>
To: Christian Brauner <brauner@...nel.org>
Cc: Jeff Layton <jlayton@...nel.org>, Josef Bacik <josef@...icpanda.com>, 
	Oleg Nesterov <oleg@...hat.com>, linux-kernel@...r.kernel.org, paul@...l-moore.com, 
	linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH] pidfd: add ioctl to retrieve pid info

On Fri, 4 Oct 2024 at 10:29, Christian Brauner <brauner@...nel.org> wrote:
>
> On Wed, Oct 02, 2024 at 03:24:33PM GMT, luca.boccassi@...il.com wrote:
> > +             info.pid = pid_nr_ns(pid, task_active_pid_ns(task));
>
> I think this is wrong what this should return is the pid of the process
> as seen from the caller's pid namespace. Otherwise you'll report
> meaningless pid numbers to the caller when the caller's pid namespace is
> outside of the pid namespace hierarchy of the process that pidfd refers
> to. This can easily happen when you receive pidfds via SCM_RIGHTS.

Thanks for the review, I applied the rest of the comments in v2 (I
think at least), but for this one I can't tell, how should I do it?
Naively I thought that task_active_pid_ns(task) would already fulfil
this requirement and resolve it using the correct pid namespace, is
that not the case? If not, what else should I do here?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ