public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Theodore Ts'o" <tytso@mit.edu>
To: "Richard W.M. Jones" <rjones@redhat.com>
Cc: Michal Hocko <mhocko@kernel.org>,
	linux-kernel@vger.kernel.org, corbet@lwn.net,
	akpm@linux-foundation.org, vbabka@suse.cz, hughd@google.com,
	koct9i@gmail.com, chenhanxiao@cn.fujitsu.com,
	n-horiguchi@ah.jp.nec.com, ross.zwisler@linux.intel.com,
	john.stultz@linaro.org, minchan@kernel.org, jmarchan@redhat.com,
	hannes@cmpxchg.org, nathans@redhat.com,
	andriy.shevchenko@linux.intel.com, keescook@chromium.org,
	gorcunov@openvz.org, joe@perches.com, linux@rasmusvillemoes.dk,
	mingo@kernel.org, cmetcalf@ezchip.com, iago@endocode.com,
	luto@kernel.org, linux-doc@vger.kernel.org, gorcunov@gmail.com,
	fw@deneb.enyo.de, walters@verbum.org
Subject: Re: [PATCH v2] procfs: expose umask in /proc/<PID>/status
Date: Fri, 15 Apr 2016 11:52:25 -0400	[thread overview]
Message-ID: <20160415155225.GD11838@thunk.org> (raw)
In-Reply-To: <20160415132952.GZ11600@redhat.com>

On Fri, Apr 15, 2016 at 02:29:52PM +0100, Richard W.M. Jones wrote:
> 
> The use case is that we have endless trouble with people setting weird
> umask() values (usually on the grounds of "security"), and then
> everything breaking.  I'm on the hook to fix these.  We'd like to add
> debugging to our program so we can dump out the umask in debug
> reports.
> 
> Previous versions of the patch used a syscall so you could only read
> your own umask.  That's all I need.  However there was quite a lot of
> push-back from those, so this new version exports it in /proc.
> 
> See:
> 
> https://lkml.org/lkml/2016/4/13/704 [umask2]
> https://lkml.org/lkml/2016/4/13/487 [getumask]

I think /proc is better because it's already pretty well understood
that programs like "ps" returns information which is subject to
change, even before the ps command has had a chance to print the
values.  Where as I could easily see programmers who read umask via a
system call could more easily get confused about the expectations of
stability of the returned value.  (This is not a strong argument,
admittedly, because the same stupid application programmer could get
confused about the stability of getuid() as well.)

The stronger argument IMHO is that you're not at the mercy of glibc
developers to add it to glibc.

					- Ted

  reply	other threads:[~2016-04-15 15:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-14 11:08 [PATCH v2] procfs: expose umask in /proc/<PID>/status Richard W.M. Jones
2016-04-14 11:08 ` Richard W.M. Jones
2016-04-14 12:34   ` Konstantin Khlebnikov
2016-04-14 12:41   ` Jerome Marchand
2016-04-15 13:13   ` Michal Hocko
2016-04-15 13:29     ` Richard W.M. Jones
2016-04-15 15:52       ` Theodore Ts'o [this message]
2016-04-15 16:43   ` Kees Cook

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160415155225.GD11838@thunk.org \
    --to=tytso@mit.edu \
    --cc=akpm@linux-foundation.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=chenhanxiao@cn.fujitsu.com \
    --cc=cmetcalf@ezchip.com \
    --cc=corbet@lwn.net \
    --cc=fw@deneb.enyo.de \
    --cc=gorcunov@gmail.com \
    --cc=gorcunov@openvz.org \
    --cc=hannes@cmpxchg.org \
    --cc=hughd@google.com \
    --cc=iago@endocode.com \
    --cc=jmarchan@redhat.com \
    --cc=joe@perches.com \
    --cc=john.stultz@linaro.org \
    --cc=keescook@chromium.org \
    --cc=koct9i@gmail.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=luto@kernel.org \
    --cc=mhocko@kernel.org \
    --cc=minchan@kernel.org \
    --cc=mingo@kernel.org \
    --cc=n-horiguchi@ah.jp.nec.com \
    --cc=nathans@redhat.com \
    --cc=rjones@redhat.com \
    --cc=ross.zwisler@linux.intel.com \
    --cc=vbabka@suse.cz \
    --cc=walters@verbum.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox