Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp5685632ybp; Tue, 8 Oct 2019 06:54:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqxYCfctJfjHp6UBWe0I1S2yilWY4LRPzyaYLFTdZd9/XRInRxONrrRAqOFxiL3grVzaqDrh X-Received: by 2002:a17:906:b84c:: with SMTP id ga12mr284169ejb.0.1570542847666; Tue, 08 Oct 2019 06:54:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570542847; cv=none; d=google.com; s=arc-20160816; b=uiVKcNpRtU6qgx8Ctpl8+lIzp/5NDr4wLy1wchIdqQvFNy8xgDr6iDP9Hwi69Xc1rD iF1SkfZu5UqpK/d4LBpzFkC6tPQoMhEWHoR1c/X5vdpezvBA+QrFv58JNiUzA5YqWfRz cGVG9Vnf9hs8uObDldUVtk5tj2BXOs3xUrrp3d0w1d1pyK1TAVW7IPvk3pozK6L0qmwo sxYuiRcdVISQGl3XWdTzpH2R1ZbjSeFXhLnlfWCr97WQnB+kxynpAxXZKgiumuZ7TVvl n5h+nA8NLUq4+JyCoaPwqHCAYM09Be4H6GZ5KExwW2u44jCuqsvXc5zZOsKaXeOUKD/Z 4nPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=wiexHG+NY5VAa8WCPmsqQD2P8JRiDSOeZyHqytD1xgU=; b=g6qlIBa0rzabqS4Hmgv5fpZ33bWlnB043uszIy0DETkO+rR4A022zE3e3gSSshlKIZ lg5aqjQZDU4B/FyfpvDYzdS30iYBnllFCDiePEOzWUadDglQUwziTabA32A8q0zIS+U2 rmPDLI0xy7y6NdxSJG3D0PfNDKymrgXepdPQLCrn2B5saaWDruzloar0QM3rSruw2MlB /ntKuymCdugkH78Iw+AJzvDUSjo8bM43By855uS1OvPu3AXwwUaoVIevZP7gAAg+uNVH tBbFnDMigmDC67bPKQfZkFwfb91f9Si5uwZ6+MnV9U26/NhzF/MweVpzUY6IYvS6Axl5 aLlw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z10si10129220edx.168.2019.10.08.06.53.43; Tue, 08 Oct 2019 06:54:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725972AbfJHNxD (ORCPT + 99 others); Tue, 8 Oct 2019 09:53:03 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:56065 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725821AbfJHNxD (ORCPT ); Tue, 8 Oct 2019 09:53:03 -0400 Received: from p2e585ebf.dip0.t-ipconnect.de ([46.88.94.191] helo=wittgenstein) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1iHpvA-00053R-Oe; Tue, 08 Oct 2019 13:53:00 +0000 Date: Tue, 8 Oct 2019 15:52:59 +0200 From: Christian Brauner To: Christian Kellner Cc: linux-kernel@vger.kernel.org, Christian Kellner , Andrew Morton , "Peter Zijlstra (Intel)" , Ingo Molnar , Michal Hocko , Elena Reshetova , Thomas Gleixner , Roman Gushchin , Andrea Arcangeli , "Joel Fernandes (Google)" , Al Viro , "Dmitry V. Levin" Subject: Re: [PATCH] pidfd: show pids for nested pid namespaces in fdinfo Message-ID: <20191008135258.mzc7o2djiq5yydko@wittgenstein> References: <20191008133641.23019-1-ckellner@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20191008133641.23019-1-ckellner@redhat.com> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 08, 2019 at 03:36:37PM +0200, Christian Kellner wrote: > From: Christian Kellner > > 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 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 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. ;) Thanks! Christian