From: Willy Tarreau <w@1wt.eu>
To: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: linux-kernel@vger.kernel.org, x86@kernel.org, tglx@linutronix.de,
gnomes@lxorguk.ukuu.org.uk, torvalds@linux-foundation.org
Subject: Re: [PATCH RFC 0/4] Per-task PTI activation
Date: Tue, 9 Jan 2018 22:57:29 +0100 [thread overview]
Message-ID: <20180109215729.GC13282@1wt.eu> (raw)
In-Reply-To: <87d12iivwk.fsf@xmission.com>
On Tue, Jan 09, 2018 at 03:07:07PM -0600, Eric W. Biederman wrote:
> > In fact that's what I liked with the wrapper approach, except that it
> > had the downside of being harder to manage in terms of administration
> > and we'd risk to see it used everywhere by default. The arch_prctl()
> > approach ensures that only applications where this is relevant can do
> > it. In the case of haproxy, I can trivially add a config option like
> > "disable-page-isolation" to let the admin enable it on purpose.
>
> How is that different from the option?
Not sure what is different from the option, so let me just enumerate the
two approaches I'm seeing :
- either a wrapper which work for the next execve() and not further.
The benefit is that applications do not need to be recompiled. The
problem is that it requires some changes to various places ranging
from init scripts to API wrappers and whatever to place this wrapper.
Also it can start to be perceived as the "wrapper that makes things
fast" and some admins might start to routinely use it like we use
taskset, and I'm not fond of this.
- the option I mentionned would be a configuration setting enabling
arch_prctl(). The option name should explicitly indicate that the
admin wants to screw up his system's security. For example,
"destroy-security-for-performance" is not the type of option you
leave enabled in your config templates. It *will* require to
recompile applications. I don't think it's a problem for the most
performance sensitive ones, but I may be biased by my own
experience.
- or a combination of the two if some admins need to support stuff
they can't rebuild (well LD_PRELOAD might be an option after all...)
> > But I suspect there might be some performance critical applications that
> > cannot be patched, and that's where the wrapper could still provide some
> > value.
>
> I just don't want to encourage changning this option by default.
That's the same for me. Even the prctl name should be scary enough. Boris
suggested tainting the kernel and that's a very good idea, it will even
ensure that the setting is not used by default in applications because
admins won't want to see their systems tainted for no reason.
> As a
> lot of applications get installed in home servers or other places where
> they are not performance critical. At which point disabling the kpti
> protection by default would be reducing the level of protection of
> everything.
Definitely. That's why I don't want to see the hard-coded prctl() either.
> But ultimately I only brought this up so that people are thinking about
> the other side of this. About how it will affect not the high
> performance servers single function but how it will affect the millions
> of little servers that do many things all from a single machine.
This is my concern as well, which is why I'm seeking the most balanced
approach I can think of.
> Certainly I would not want this enabled in a container or a virtual
> private server. The capable(CAP_RAWIO) seems to handle that beautifully.
>
> >> Certainly this is something that should look at no-new-privs and if
> >> no-new-privs is set not allow disabling this protection.
> >
> > I don't know what is "no-new-privs" and couldn't find info on it
> > unfortunately. Do you have a link please ?
>
> Probably because I used dashes. The no new privs flag is documented
> in:
> Documentation/userspace-api/no_new_privs.rst
Ah stupid me, I should have tried underscores as well. Thank you.
> It is a sandboxing flag that guarantees a process can not gain
> privileges after it has been set. You can search for PFA_NO_NEW_PRIVS
> in sched.h if you want to see where it is defined.
Oh that's very interesting, I wasn't aware of this! Definitely something
I need to set after dropping privileges in haproxy I guess ;-)
Thanks,
Willy
prev parent reply other threads:[~2018-01-09 21:57 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-08 16:12 [PATCH RFC 0/4] Per-task PTI activation Willy Tarreau
2018-01-08 16:12 ` [PATCH RFC 1/4] x86/thread_info: add TIF_NOPTI to disable PTI per task Willy Tarreau
2018-01-08 16:57 ` Thomas Gleixner
2018-01-08 17:03 ` Willy Tarreau
2018-01-08 17:14 ` Ingo Molnar
2018-01-08 16:12 ` [PATCH RFC 2/4] x86/arch_prctl: add ARCH_GET_NOPTI and ARCH_SET_NOPTI to enable/disable PTI Willy Tarreau
2018-01-08 16:49 ` Peter Zijlstra
2018-01-08 16:56 ` Willy Tarreau
2018-01-08 17:02 ` Thomas Gleixner
2018-01-08 17:10 ` Willy Tarreau
2018-01-08 17:17 ` Ingo Molnar
2018-01-08 17:26 ` Thomas Gleixner
2018-01-08 17:46 ` Ingo Molnar
2018-01-08 17:05 ` Ingo Molnar
2018-01-08 17:19 ` Peter Zijlstra
2018-01-08 17:26 ` Ingo Molnar
2018-01-08 17:50 ` Borislav Petkov
2018-01-08 17:54 ` Linus Torvalds
2018-01-08 18:22 ` Willy Tarreau
2018-01-08 20:49 ` Thomas Gleixner
2018-01-08 21:03 ` Willy Tarreau
2018-01-08 20:35 ` Willy Tarreau
2018-01-08 16:12 ` [PATCH RFC 3/4] x86/pti: don't mark the user PGD with _PAGE_NX Willy Tarreau
2018-01-08 17:03 ` Dave Hansen
2018-01-08 17:17 ` Willy Tarreau
2018-01-08 17:23 ` Dave Hansen
2018-01-08 17:30 ` Peter Zijlstra
2018-01-08 17:49 ` Willy Tarreau
2018-01-08 17:21 ` Ingo Molnar
2018-01-08 23:05 ` Andy Lutomirski
2018-01-08 23:09 ` Kees Cook
2018-01-09 4:22 ` Willy Tarreau
2018-01-08 17:05 ` Thomas Gleixner
2018-01-08 17:28 ` Dave Hansen
2018-01-08 17:50 ` Ingo Molnar
2018-01-08 18:25 ` Alan Cox
2018-01-08 18:35 ` Ingo Molnar
2018-01-08 18:35 ` Linus Torvalds
2018-01-08 18:44 ` Dave Hansen
2018-01-08 16:12 ` [PATCH RFC 4/4] x86/entry/pti: don't switch PGD on tasks holding flag TIF_NOPTI Willy Tarreau
2018-01-08 17:11 ` Ingo Molnar
2018-01-08 17:20 ` Dave Hansen
2018-01-08 18:12 ` Willy Tarreau
2018-01-08 23:01 ` Andy Lutomirski
2018-01-08 16:59 ` [PATCH RFC 0/4] Per-task PTI activation Dave Hansen
2018-01-08 17:06 ` Willy Tarreau
2018-01-08 17:17 ` Dave Hansen
2018-01-08 17:13 ` Ingo Molnar
2018-01-09 15:31 ` Eric W. Biederman
2018-01-09 16:02 ` Willy Tarreau
2018-01-09 18:11 ` Zhi Wang
2018-01-09 21:07 ` Eric W. Biederman
2018-01-09 21:57 ` Willy Tarreau [this message]
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=20180109215729.GC13282@1wt.eu \
--to=w@1wt.eu \
--cc=ebiederm@xmission.com \
--cc=gnomes@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=x86@kernel.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