Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4764042yba; Tue, 30 Apr 2019 04:07:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqwpN58lD3Zufw/dj0PdQYab9KMfrhy4NtGUj7S3yf+uvS8vr4PvfVdqv2R/a50Ko1AXhCvh X-Received: by 2002:a17:902:302:: with SMTP id 2mr69254326pld.232.1556622429462; Tue, 30 Apr 2019 04:07:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556622429; cv=none; d=google.com; s=arc-20160816; b=xSTsS/QUTgCIOAWEsoKcvf7Rmj7RO3uYo9ae8jOa4pDb2GCJy15l77+UXHxjNrl6L3 kJyKPVYA8phMGkxC2PBt279uRp4yLUv3m4P/DEPo9uU9cfkStnKhxTTUw0sytWP2pVEO CDt94vC9VihRQC7jVcZC1Bxi8i0MJzUK/C54OEX/CqSsHPi32Co/Wg+BoUD+6wLd5RRo nplULEmRf5RO08kkB+fCmABAzuoVziptj/95nFMNfORpaNZ5vTBjqBS1zXT2nbBKE9vW KySDndwliTyPGitG1/6fC1VK6q2JuHvmwkKbFXrj/3SyrF2gMx3fsRduIsiC1OBHD/Iy IpxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=hcjAClggzePqeJJtXogSOe2XblmZfTT3PJ7ZOWIVOqU=; b=zkJ3xpfMT//tZJTX4LUvUhCjwvyg+htjArjui6X7MU5TWIjI3dX/KlFpJa/7M9QbVk +RQytEsAzRfVn4C3kejsyACRO8c0eLJATaXYc0ApYz5gvbxiUit2WrLgXeCHrZS9i+Tz HgQGSS9T1yPO1AGbPc8dinSshGKO6IVWIai6ajgOpYW8WPM8CvNYrAtp6pYivKRsanhE pgxko2GvyY75JAj25fukHaZPdmmD0L7CyrzfyY186l2kRdD8MWR4BeBlYYQqnZ+bJxIx rXEaPXddPAteqDhukTKzxVHyFD08XGCnhNZ5OpeWx/b8Vs+dny9qCoYZi4mnhZPk3m1k 3CkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=t98F86tk; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q1si37186381pgh.396.2019.04.30.04.06.51; Tue, 30 Apr 2019 04:07:09 -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=fail header.i=@gmail.com header.s=20161025 header.b=t98F86tk; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727163AbfD3LFz (ORCPT + 99 others); Tue, 30 Apr 2019 07:05:55 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:33663 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726294AbfD3LFz (ORCPT ); Tue, 30 Apr 2019 07:05:55 -0400 Received: by mail-wr1-f68.google.com with SMTP id s18so20576384wrp.0; Tue, 30 Apr 2019 04:05:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=hcjAClggzePqeJJtXogSOe2XblmZfTT3PJ7ZOWIVOqU=; b=t98F86tkS7nDT8aNYRRoUWLg5OJwxhtOdcoSs/BsTtn9OgzzITqrjV4cmLJ98Mwb1P Mqw3Dky/HvlbeumYpqCqDtokl2IbheHHUnKfUpXQ0vQd6X+E1+vsNWuApgGiz1Ij6D6i +9xEmITSRyeCwSFy9q9E4JB3oCgGLdH24ITrmedONPahTcgCy77/DWS8CyWArsuDWL/w owESCNvAj/CWa7Sb/6wh4ChvjV4oU0P3zh91GnzAIafx5K0sRIqzIGcixj4Gxq4j97rE k2XyJDVliGcsNDXJHNAcFA+7Vw9dqdqI3dOV3G6HyXz1P5JqwFoCvCTftErm8e2FhbSr rxxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=hcjAClggzePqeJJtXogSOe2XblmZfTT3PJ7ZOWIVOqU=; b=IETqXVQqlEX6fsZqSTSZo7zl+330S3CjmcuLFu4Unz84s1Oy5XymcsVXrYYVEwuvnZ SB2EpY3IEmbBvljOup7w6Nz/sEbeTYaQ6OeuBd6H+6SLoO9xbnajFyIXt8P4VCcT7MTL yLMx3hbBGKDr4zK7TusGhKQwmkFFXrCTeBr6/e1vVX1QKBNTHPKt+U4j2QNO11iV0OI4 B8QKeVxbmD4JW4r+5GY2nfACNNesblIC8nro4XEmfxdLTzTw1z9ZwTv6AIjfPbX9HsiW k1JD2y1Obx7ob5+JnwQkITBjbWPHqmoBbC1bl7pgY5sFfBslnuzDSAy162LXkDrxmFco kqcw== X-Gm-Message-State: APjAAAXRpaihll5ZgOoVAwTcY1pgbnRsTHloslC2PZz/qvDPkXX9RY7c LJ1E1jod6rWLefbNnTYkB4s= X-Received: by 2002:adf:e288:: with SMTP id v8mr8583758wri.7.1556622353105; Tue, 30 Apr 2019 04:05:53 -0700 (PDT) Received: from gmail.com (2E8B0CD5.catv.pool.telekom.hu. [46.139.12.213]) by smtp.gmail.com with ESMTPSA id b11sm4059486wmh.29.2019.04.30.04.05.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 30 Apr 2019 04:05:52 -0700 (PDT) Date: Tue, 30 Apr 2019 13:05:49 +0200 From: Ingo Molnar To: Peter Zijlstra Cc: Andy Lutomirski , Mike Rapoport , LKML , Alexandre Chartre , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Ingo Molnar , James Bottomley , Jonathan Adams , Kees Cook , Paul Turner , Thomas Gleixner , Linux-MM , LSM List , X86 ML , Linus Torvalds , Andrew Morton Subject: Re: [RFC PATCH 2/7] x86/sci: add core implementation for system call isolation Message-ID: <20190430110549.GA119957@gmail.com> References: <1556228754-12996-1-git-send-email-rppt@linux.ibm.com> <1556228754-12996-3-git-send-email-rppt@linux.ibm.com> <20190426083144.GA126896@gmail.com> <20190426095802.GA35515@gmail.com> <20190427084752.GA99668@gmail.com> <20190427104615.GA55518@gmail.com> <20190430050336.GA92357@gmail.com> <20190430093857.GO2623@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190430093857.GO2623@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Peter Zijlstra 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