[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191008140049.GM6681@dhcp22.suse.cz>
Date: Tue, 8 Oct 2019 16:00:49 +0200
From: Michal Hocko <mhocko@...nel.org>
To: Christian Kellner <ckellner@...hat.com>,
Christian Brauner <christian.brauner@...ntu.com>
Cc: linux-kernel@...r.kernel.org,
Christian Kellner <christian@...lner.me>,
Andrew Morton <akpm@...ux-foundation.org>,
"Peter Zijlstra (Intel)" <peterz@...radead.org>,
Ingo Molnar <mingo@...nel.org>,
Elena Reshetova <elena.reshetova@...el.com>,
Thomas Gleixner <tglx@...utronix.de>,
Roman Gushchin <guro@...com>,
Andrea Arcangeli <aarcange@...hat.com>,
"Joel Fernandes (Google)" <joel@...lfernandes.org>,
Al Viro <viro@...iv.linux.org.uk>,
"Dmitry V. Levin" <ldv@...linux.org>
Subject: Re: [PATCH] pidfd: show pids for nested pid namespaces in fdinfo
On Tue 08-10-19 15:52:59, Christian Brauner wrote:
> On Tue, Oct 08, 2019 at 03:36:37PM +0200, Christian Kellner wrote:
> > From: Christian Kellner <christian@...lner.me>
> >
> > The fdinfo file for a process file descriptor already contains the
> > pid of the process in the callers namespaces. Additionally, if pid
> > namespaces are configured, show the process ids of the process in
> > all nested namespaces in the same format as in the procfs status
> > file, i.e. "NSPid:\t%d\%d...". This allows the easy identification
> > of the processes in nested namespaces.
> >
> > Signed-off-by: Christian Kellner <christian@...lner.me>
>
> Yeah, makes sense to me.
> Note that if you send the pidfd to a sibling pid namespace NSpid won't
> show you anything useful. But that's what I'd expect security wise. You
> should only be able to snoop on descendant pid namespaces.
>
> Please add a test for this to verify that this all works correctly and
> then resend. The tests live in tools/testing/selftests/pidfd/ and should
> already have most of the infrastructure there. The fdinfo parsing code
> should be in samples/pidfd/ which
>
> For the patch itself:
>
> Reviewed-by: Christian Brauner <christian.brauner@...ntu.com>
>
> You can resend with my Reviewed-by retained if you don't change
> anything. Before I see tests I'll hold off on merging this. ;)
This is also forming a new user visible "api" right? So the make sure
that linux-api is on the Cc list.
And one minore note. The ifdefery is just ugly, could you just make it a
separate function with ifdef hidden inside?
--
Michal Hocko
SUSE Labs
Powered by blists - more mailing lists