linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Lutomirski <luto@amacapital.net>
To: Lafcadio Wluiki <wluikil@gmail.com>
Cc: Djalal Harouni <tixxdz@gmail.com>,
	Linux API <linux-api@vger.kernel.org>,
	"kernel-hardening@lists.openwall.com" 
	<kernel-hardening@lists.openwall.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Kees Cook <keescook@chromium.org>
Subject: Re: [PATCH v4 2/2] procfs/tasks: add a simple per-task procfs hidepid= field
Date: Fri, 10 Feb 2017 08:18:11 -0800	[thread overview]
Message-ID: <CALCETrVpOczwpVRFd8yoSZGcYEG=qHuRmTND8L7V_oZRu1sbCA@mail.gmail.com> (raw)
In-Reply-To: <CAOWbf6f-3Ha3dkNuTfar0-u1SdSu=gDt0tK3Wq9+f9LZqB4gMQ@mail.gmail.com>

On Fri, Feb 10, 2017 at 6:40 AM, Lafcadio Wluiki <wluikil@gmail.com> wrote:
> On Sat, Jan 21, 2017 at 1:53 AM, Andy Lutomirski <luto@amacapital.net> wrote:
>
>> I agree that the kernel change to do it per task is very simple.  But
>> this is an unfortunate slippery slope.  What if you want to block off
>> everything in /proc that isn't associated with a PID?  What if you
>> want to suppress /sys access?  What if you want ot block *all*
>> non-current PIDs from being revealed in /proc?  What if you want to
>> hide /proc/PID/cmdline?
>
> These are all what-ifs that noone was interested in so far. I have a
> very specific itch I want to scratch, and I found a reasonably generic
> concept of exposing it. But now you are trying to lead this all down
> onto a paths asking for features noone is actually really interested
> in.

If you have an itch and want to scratch it by adding a new API, the
API has to be right, full stop.

>
>> I think that the right solution here is to fix procfs to understand
>> per-superblock mount options.
>
> Andy, this is really not helpful. Doing that is far from easy, that's
> a major undertaking: asking us to rework procfs in such a major way I
> only can understand as an indirect way for you to say "go away" to
> us... Expecting newcomers to kernel work to basically clean up an
> entire kernel subsystem, dealing with all the politics involved is
> just not going to work.

Once upon a time, a newbish kernel hacker named Andy wrote some code
to change the way the vDSO worked.  The maintainers told me that it
was a nice thought and that it was too messy and wasn't acceptable in
its present form.  So the patchset got quite a bit longer, I learned
more about the mess that was the vDSO, and I fixed it.  The
maintainers were right.

It's just not the case that a newcomer gets to add fields to
task_struct that a more experienced developer wouldn't get to add.
Sorry.

>
> And again: I am very sure the proposed prctl() based solution is
> actually much much nicer than any procfs superblock based one, since
> it works naturally, and easily for unprivileged processes too!
> Anything that requires mount options means privileges are required in
> some form or another. Yes userns would open that up, but that comes
> with a huge amount of additional problems.

If you want to design a generic mechanism by which a task can change
the way that pseudo filesystems look for itself and its children
without using mount options, and you come up with something that is
sane, safe, generic, and reasonable clean, you're welcome to do so.
This sounds like a considerably more challenging undertaking than just
fixing procfs.

>
> Anyway, I understand it is your intention to derail this. I can accept
> that. It's a pity though.

I have no intention of derailing improvements to hidepid.  In fact,
I'd love to see improvements here.  I'm just saying that the current
proposal isn't the way to do it.

  reply	other threads:[~2017-02-10 18:16 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-16 13:23 [PATCH v4 0/2] procfs/tasks: introduce per-task procfs hidepid= field Djalal Harouni
2017-01-16 13:23 ` [PATCH v4 1/2] procfs: use an enum for possible hidepid values Djalal Harouni
2017-02-13 22:16   ` Kees Cook
2017-02-15  0:34     ` Andrew Morton
2017-02-15  8:56       ` Djalal Harouni
2017-01-16 13:23 ` [PATCH v4 2/2] procfs/tasks: add a simple per-task procfs hidepid= field Djalal Harouni
2017-01-16 18:24   ` [kernel-hardening] " Daniel Micay
2017-01-17  9:54     ` Lafcadio Wluiki
     [not found]   ` <CAEiveUfDvSoW9Hy2Y_uxU2YQ+vR8OvXMqRhxAANTGG7QaQbJeg@mail.gmail.com>
     [not found]     ` <CALCETrWEGLhEHO_6sTXreVyWFVsEeYmZSrLNNXx-ma5gd+nTQQ@mail.gmail.com>
2017-01-18 22:50       ` Djalal Harouni
2017-01-18 23:35         ` Andy Lutomirski
2017-01-19 13:53           ` Djalal Harouni
2017-01-19 19:52             ` Andy Lutomirski
2017-01-20 15:56               ` Lafcadio Wluiki
2017-01-20 16:33               ` Djalal Harouni
2017-01-21  0:53                 ` Andy Lutomirski
2017-01-23 11:46                   ` Djalal Harouni
2017-01-23 20:07                     ` Andy Lutomirski
2017-01-26 13:20                       ` Djalal Harouni
2017-02-10 14:40                   ` Lafcadio Wluiki
2017-02-10 16:18                     ` Andy Lutomirski [this message]
2017-01-20 15:44           ` Lafcadio Wluiki
2017-02-10 23:44           ` Kees Cook
2017-02-13 19:01             ` Andy Lutomirski
2017-02-13 19:15               ` Kees Cook
2017-02-14  4:11                 ` Christian Kujau

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='CALCETrVpOczwpVRFd8yoSZGcYEG=qHuRmTND8L7V_oZRu1sbCA@mail.gmail.com' \
    --to=luto@amacapital.net \
    --cc=akpm@linux-foundation.org \
    --cc=keescook@chromium.org \
    --cc=kernel-hardening@lists.openwall.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tixxdz@gmail.com \
    --cc=wluikil@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).