Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp920161ybb; Wed, 25 Mar 2020 12:05:45 -0700 (PDT) X-Google-Smtp-Source: ADFU+vv3HchcZljOYpSdnnp4mf23Mnn7cGc1K5Vl20ifb9ZuSoc9RBKIChUqMXVfiX6KqacENJ0y X-Received: by 2002:a9d:1b6d:: with SMTP id l100mr269357otl.70.1585163144864; Wed, 25 Mar 2020 12:05:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585163144; cv=none; d=google.com; s=arc-20160816; b=GslNlz+l9rEs/YHcouTSSlww8dinpQKij31955zK+0T64EdsvW1Pop/RISc9feqL0r 4RcM7xLkC2ATk1wYGykr3He0G9BgBPwejaywQtnE9SaKnppSqEDXl0HVo11KDf1WxIhs 7qYYzYcgFZZAv48H1o6Jgtczm57S6eHRvT8nM2y75Cjk3Y0O8BFzLkbrmSKnZkBtiZkn LVDsuB4JFEapOh/HGSVDDsZugr7PzgjyNowRa72S2gsY6EVAAq6Dl53y3IoG32gZWHL9 DbXjXu2jtWzEPpLEbt0wJ37DDmwpX+jlO8zPQ34IOEUZgbh/vmXTN1yHiSMDj1s+YW1u c6GA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=oAYHqHv337HAUKTzgALlcy7pgo9oQoJmCmDvgzd1M9w=; b=jZNFCmwW3bbr9k0VEAQIxlsqLt0TFqYd3uk5UBoeCpqwVpdiCzPknWaTK+9iGCEci8 AvLV1cLxH5J/xFOaM3swgG+BkIjBhlPSaU+Pr1voV06r9yOowEvYjIGB6Es5v8hgZVK6 GtmR66SMem/saaEdzgzI86HC4fUhJiuzBRqhKWsZkY2Z/6SAXKbNkvQoC010xP0WbMDD OxdX4TFoEfIJhSX2MZ3VuhFt3Q4ZaG8RHMeZQlT00wUL36KXtTGqoRnhPZuWKo1II1sr NrOHhf5pOlojfGWNJgjWrGZf7l9AJcg9kMVaemUswYveG9PNNBSamcNp5K5pLDOaz0vr xcgw== 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k1si1890194oou.60.2020.03.25.12.05.26; Wed, 25 Mar 2020 12:05:44 -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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727841AbgCYTEg (ORCPT + 99 others); Wed, 25 Mar 2020 15:04:36 -0400 Received: from monster.unsafe.ru ([5.9.28.80]:43518 "EHLO mail.unsafe.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727027AbgCYTEg (ORCPT ); Wed, 25 Mar 2020 15:04:36 -0400 Received: from comp-core-i7-2640m-0182e6 (ip-89-102-33-211.net.upcbroadband.cz [89.102.33.211]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.unsafe.ru (Postfix) with ESMTPSA id 495E5C61AE0; Wed, 25 Mar 2020 19:04:31 +0000 (UTC) Date: Wed, 25 Mar 2020 20:04:29 +0100 From: Alexey Gladkov To: Alexey Dobriyan Cc: Linus Torvalds , LKML , Kernel Hardening , Linux API , Linux FS Devel , Linux Security Module , Akinobu Mita , Alexander Viro , Andrew Morton , Andy Lutomirski , Daniel Micay , Djalal Harouni , "Dmitry V . Levin" , "Eric W . Biederman" , Greg Kroah-Hartman , Ingo Molnar , "J . Bruce Fields" , Jeff Layton , Jonathan Corbet , Kees Cook , Oleg Nesterov Subject: Re: [PATCH RESEND v9 3/8] proc: move hide_pid, pid_gid from pid_namespace to proc_fs_info Message-ID: <20200325190429.73k52amlfjer7epa@comp-core-i7-2640m-0182e6> References: <20200324204449.7263-1-gladkov.alexey@gmail.com> <20200324204449.7263-4-gladkov.alexey@gmail.com> <20200325180015.GA18706@avx2> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200325180015.GA18706@avx2> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 25, 2020 at 09:00:15PM +0300, Alexey Dobriyan wrote: > On Tue, Mar 24, 2020 at 02:21:59PM -0700, Linus Torvalds wrote: > > On Tue, Mar 24, 2020 at 1:46 PM Alexey Gladkov wrote: > > > > > > +/* definitions for hide_pid field */ > > > +enum { > > > + HIDEPID_OFF = 0, > > > + HIDEPID_NO_ACCESS = 1, > > > + HIDEPID_INVISIBLE = 2, > > > +}; > > > > Should this enum be named... > > > > > struct proc_fs_info { > > > struct pid_namespace *pid_ns; > > > struct dentry *proc_self; /* For /proc/self */ > > > struct dentry *proc_thread_self; /* For /proc/thread-self */ > > > + kgid_t pid_gid; > > > + int hide_pid; > > > }; > > > > .. and then used here instead of "int"? > > > > Same goes for 'struct proc_fs_context' too, for that matter? > > > > And maybe in the function declarations and definitions too? In things > > like 'has_pid_permissions()' (the series adds some other cases later, > > like hidepid2str() etc) > > > > Yeah, enums and ints are kind of interchangeable in C, but even if it > > wouldn't give us any more typechecking (except perhaps with sparse if > > you mark it so), it would be documenting the use. > > > > Or am I missing something? > > > > Anyway, I continue to think the series looks fine, bnut would love to > > see it in -next and perhaps comments from Al and Alexey Dobriyan.. > > Patches are OK, except the part where "pid" is named "pidfs" and > the suffix doesn't convey any information. I will fix this in the final version. > mount -t proc -o subset=pid,sysctl,misc I have not yet figured out how to implement this. I mean subset=meminfo,misc. -- Rgrds, legion