Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp929814ybb; Sat, 28 Mar 2020 13:43:49 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtvWRKIOK3sfhkMS1VA8zWN4vyb6GQYbH5bHAg4MEnxdESuIT21h7/1e+5LPHzjjVLAQWEK X-Received: by 2002:a4a:a226:: with SMTP id m38mr4503735ool.94.1585428229713; Sat, 28 Mar 2020 13:43:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585428229; cv=none; d=google.com; s=arc-20160816; b=t9rJ+FQVoBk4v2x1ImIomj0enwel5ke5n0nXqmRlD7z6ntzg4CgE3SzSRBFAaeH8iy 4TUQ2SsshGx9TN/Cx6BdRsg+vrtmgxtBxvk2AAmRT40VJp9csoDZRM+g8N5UGeriV4JA KCl5+jNJ1R6T8x+xdbyCA6tcBe21uGHBwx2QSYdFRbSzF/1hrnVCb/u1ZozD+kJQ3770 153kLvyg83F8QswBbdRrLyuNJE3jfgYz6X83b49J3PpakU0vdI8+j2bmIpPOjcKHgdNW 8rPL2cOVosjs4z2iRbmCzBmeEf32+gZIiwE/yQV9NQakrMaHZR95+jMaXKEP+ezJH+MI SDfg== 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 :dkim-signature; bh=3af4XQiObUNSlXzIpOluwclJ5Se37O3IqIxw7xF6Wfg=; b=JVpVQ7bITWpT9l8YXaIQs74f33ZmdG1x4M7ThsbUqm892+Eo96zDvxt6UcY+Wpn92P HbEi/D5qPGR+dL+vLtJxHEZS6s1mGC+jLEZM51G+vRB3CSVDPYjQaqpQIru+S2ploPjn zLi2TtC8uC6dCaXH0Mx/fV25VsNS8onQdoLVI5WHk8D5RHg88JfROL26XWnFJ4vhwT4O jN1SAJhe+74xn6wuXuYKjdBg8/dWqSoC5NVJPg3Da1JxVZ+otl7qWnEMB7N0okYFEgtE Nq5nJYjalIri6I4BpX+xVrRZ8GPayNTIDm+vOlHobiX6mSOeHrYOqclGnv1BDBMaDIhT 4A4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=IV5SgG1z; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e16si4491873ote.190.2020.03.28.13.43.37; Sat, 28 Mar 2020 13:43:49 -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; dkim=pass header.i=@chromium.org header.s=google header.b=IV5SgG1z; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727641AbgC1UlF (ORCPT + 99 others); Sat, 28 Mar 2020 16:41:05 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:43317 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727612AbgC1UlF (ORCPT ); Sat, 28 Mar 2020 16:41:05 -0400 Received: by mail-pl1-f196.google.com with SMTP id v23so4964102ply.10 for ; Sat, 28 Mar 2020 13:41:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=3af4XQiObUNSlXzIpOluwclJ5Se37O3IqIxw7xF6Wfg=; b=IV5SgG1z6PHJS4slCqg3DwNNnmqSzIJL6lLp1fwgyLEJHHaJ6fFezzh2xoXOGxJwLX u1uxgsPMEvfXPUcQsdZOXFVXGdVOzEb6PYiQY7d+mwL+SpkgBSbR2QlSCupn/XvORASl wudH09K3inIipQyjqcchSB9CuWVOfYplGOnIM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=3af4XQiObUNSlXzIpOluwclJ5Se37O3IqIxw7xF6Wfg=; b=DFUnzuhlnV0hSc/O0nSVXyhzc+4gtQaA1tav6HbZ7jEbNcoKA2tT9bVDucIE+4tt5Q 6mYvUIigyQgUE5ITR9rVWU0WAdE7KnsLOjL0dvS0YiSxOjQAxH/ZvyI1P5D9g48Tvz2b LaPqUuAvkrCXPCfrOHVoMUMaSmZVq4Eqwe7p4WPYxPSH54XD1xGLaUn4l0wydHwCDxcF LQA1z6RdAAPU1oO3+F8KRyqdcvEaVwQHhbwwuF8bSDkOf0YBuQHmVBV6JP5+mVQ+u2aX oYSTBtnv9GXYxOEIMT67cEC8Ed8xIWTeF+m4EgEHEOcznSXzhkm5ebiIp6TLjIWholRx GKfw== X-Gm-Message-State: ANhLgQ1WZcBJI5jQLeglJ5lzL5NGbqUkRobPVHVrFCmPorwPAjkriemC w5TmCv247+jZ84gykMXyGVaS2A== X-Received: by 2002:a17:90a:240a:: with SMTP id h10mr6679023pje.123.1585428064347; Sat, 28 Mar 2020 13:41:04 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id l190sm6769009pfl.212.2020.03.28.13.41.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Mar 2020 13:41:03 -0700 (PDT) Date: Sat, 28 Mar 2020 13:41:02 -0700 From: Kees Cook To: Alexey Gladkov Cc: LKML , Kernel Hardening , Linux API , Linux FS Devel , Linux Security Module , Akinobu Mita , Alexander Viro , Alexey Dobriyan , Alexey Gladkov , 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 , Linus Torvalds , Oleg Nesterov Subject: Re: [PATCH v10 7/9] proc: move hidepid values to uapi as they are user interface to mount Message-ID: <202003281340.B73225DCC9@keescook> References: <20200327172331.418878-1-gladkov.alexey@gmail.com> <20200327172331.418878-8-gladkov.alexey@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200327172331.418878-8-gladkov.alexey@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 27, 2020 at 06:23:29PM +0100, Alexey Gladkov wrote: > Suggested-by: Alexey Dobriyan > Reviewed-by: Alexey Dobriyan > Signed-off-by: Alexey Gladkov > --- > include/linux/proc_fs.h | 9 +-------- > include/uapi/linux/proc_fs.h | 13 +++++++++++++ > 2 files changed, 14 insertions(+), 8 deletions(-) > create mode 100644 include/uapi/linux/proc_fs.h > > diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h > index afd38cae2339..d259817ec913 100644 > --- a/include/linux/proc_fs.h > +++ b/include/linux/proc_fs.h > @@ -7,6 +7,7 @@ > > #include > #include > +#include > > struct proc_dir_entry; > struct seq_file; > @@ -27,14 +28,6 @@ struct proc_ops { > unsigned long (*proc_get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long); > }; > > -/* definitions for hide_pid field */ > -enum { > - HIDEPID_OFF = 0, > - HIDEPID_NO_ACCESS = 1, > - HIDEPID_INVISIBLE = 2, > - HIDEPID_NOT_PTRACEABLE = 4, /* Limit pids to only ptraceable pids */ > -}; > - > /* definitions for proc mount option pidonly */ > enum { > PROC_PIDONLY_OFF = 0, > diff --git a/include/uapi/linux/proc_fs.h b/include/uapi/linux/proc_fs.h > new file mode 100644 > index 000000000000..dc6d717aa6ec > --- /dev/null > +++ b/include/uapi/linux/proc_fs.h > @@ -0,0 +1,13 @@ > +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ > +#ifndef _UAPI_PROC_FS_H > +#define _UAPI_PROC_FS_H > + > +/* definitions for hide_pid field */ > +enum { > + HIDEPID_OFF = 0, > + HIDEPID_NO_ACCESS = 1, > + HIDEPID_INVISIBLE = 2, > + HIDEPID_NOT_PTRACEABLE = 4, > +}; > + > +#endif > -- > 2.25.2 > Should the numeric values still be UAPI if there is string parsing now? -- Kees Cook