[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190430110549.GA119957@gmail.com>
Date: Tue, 30 Apr 2019 13:05:49 +0200
From: Ingo Molnar <mingo@...nel.org>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Andy Lutomirski <luto@...nel.org>,
Mike Rapoport <rppt@...ux.ibm.com>,
LKML <linux-kernel@...r.kernel.org>,
Alexandre Chartre <alexandre.chartre@...cle.com>,
Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>,
"H. Peter Anvin" <hpa@...or.com>, Ingo Molnar <mingo@...hat.com>,
James Bottomley <James.Bottomley@...senpartnership.com>,
Jonathan Adams <jwadams@...gle.com>,
Kees Cook <keescook@...omium.org>,
Paul Turner <pjt@...gle.com>,
Thomas Gleixner <tglx@...utronix.de>,
Linux-MM <linux-mm@...ck.org>,
LSM List <linux-security-module@...r.kernel.org>,
X86 ML <x86@...nel.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [RFC PATCH 2/7] x86/sci: add core implementation for system call
isolation
* Peter Zijlstra <peterz@...radead.org> wrote:
> On Tue, Apr 30, 2019 at 07:03:37AM +0200, Ingo Molnar wrote:
> > So the question IMHO isn't whether it's "valid C", because we already
> > have the Linux kernel's own C syntax variant and are enforcing it with
> > varying degrees of success.
>
> I'm not getting into the whole 'safe' fight here; but you're under
> selling things. We don't have a C syntax, we have a full blown C
> lanugeage variant.
>
> The 'Kernel C' that we write is very much not 'ANSI/ISO C' anymore in a
> fair number of places. And if I can get my way, we'll only diverge
> further from the standard.
Yeah, but I think it would be fair to say that random style variations
aside, in the kernel we still allow about 95%+ of 'sensible C'.
> And this is quite separate from us using every GCC extention under the
> sun; which of course also doesn't help. It mostly has to do with us
> treating C as a portable assembler and the C people not wanting to
> commit to sensible things because they think C is a high-level
> language.
Indeed, and also because there's arguably somewhat of a "if the spec
allows it then performance first, common-sense semantics second" mindset.
Which is an understandable social dynamic, as compiler developers tend to
distinguish themselves via the optimizations they've authored.
Anyway, the main point I tried to make is that I think we'd still be able
to allow 95%+ of "sensible C" even if executed in a "safe runtime", and
we'd still be able to build and run without such strong runtime type
enforcement, i.e. get kernel code close to what we have today, minus a
handful of optimizations and data structures. (But the performance costs
even in that case are nonzero - I'm not sugarcoating it.)
( Plus even that isn't a fully secure solution with deterministic
outcomes, due to parallelism and data races. )
Thanks,
Ingo
Powered by blists - more mailing lists