Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp5695580ybp; Tue, 8 Oct 2019 07:02:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqwkXnLRUZRhrCsX4anias1IwvuvVdYa+MelLCgt+SqHMzIwZ9seUvuPZVeIU4ermwUBT081 X-Received: by 2002:a50:ed17:: with SMTP id j23mr33785130eds.248.1570543365930; Tue, 08 Oct 2019 07:02:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570543365; cv=none; d=google.com; s=arc-20160816; b=06tyd4jShFqpClFSI/axvtdSOTQ8blGR7VkxAzQH2mZlexxN78upd2Mrm5ICNWFs5f 7gSg2MOcRB+OBmW2QQOlzRs1GXKMLJTxpXyGxpZYR5PyrDLY3kCU1iDA103i/Wfb3Hm+ BmCU2nJN+Fya7oowZrJbMHHFZSxfdKcH0MmJM2T8syxojvnxrn+89w1HxL340tSTOHZ8 /iU7pmceh9/Ycj2V5i8dqksVGbY7V91AMqwjO4Z1176lXhroBuqXYu5FoI+RZSA2I0QZ 1u0/txUZ5hfe+K3V04IgOgZFA0qsh7IJujwsRcxu9CmI1hIgDnBHcBBqWANsGgXG0yI9 587w== 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=Ao6ry5c6YEEFkH1sQTgAYMHaVArWdVB8MAtw+A1Zdvk=; b=kzeh+wCDSH3vncpf0pncdBb6fHLRP7Onl1AkUOu8JzfqBVQKmLZ/mkd/a2wa+J402N irQEKA0xjqkOOJdjzJaGc7oUw2cFKvwER0aXlUCtutAYEQY/ngsnR6DO9NG1ZHBD1le6 3lZjWLSzrLc6EjfAfW33lUZ9gaVs2UaIQERbW8QoPCJI88ZANLmnhHttitDr6LDETciZ o0nX/3JLRrKL7Uw4IiQaHJh3V8tzLnJsR8jtdGuUsdrfLfj6kfpS8Xma4VpSTjWymG4l qoaHkxiorBjdXA7F4OanJRb93m7KENcqNBTwfpvcxYayxqngcZSJFUSxYWJEWaqPVIxn q9ng== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g21si10074514edq.289.2019.10.08.07.02.13; Tue, 08 Oct 2019 07:02:45 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726240AbfJHOAw (ORCPT + 99 others); Tue, 8 Oct 2019 10:00:52 -0400 Received: from mx2.suse.de ([195.135.220.15]:51468 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725848AbfJHOAw (ORCPT ); Tue, 8 Oct 2019 10:00:52 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 6D70DB1A9; Tue, 8 Oct 2019 14:00:50 +0000 (UTC) Date: Tue, 8 Oct 2019 16:00:49 +0200 From: Michal Hocko To: Christian Kellner , Christian Brauner Cc: linux-kernel@vger.kernel.org, Christian Kellner , Andrew Morton , "Peter Zijlstra (Intel)" , Ingo Molnar , 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: <20191008140049.GM6681@dhcp22.suse.cz> References: <20191008133641.23019-1-ckellner@redhat.com> <20191008135258.mzc7o2djiq5yydko@wittgenstein> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191008135258.mzc7o2djiq5yydko@wittgenstein> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > > > > 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. ;) 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