Received: by 10.223.185.116 with SMTP id b49csp996606wrg; Fri, 16 Feb 2018 10:30:44 -0800 (PST) X-Google-Smtp-Source: AH8x224Xbng6tuZygWKqT96WK4jILyVsWKSKKJmA4CbcfyNtgmUyjmelqpbmIKgxj8MSlrwSAWcj X-Received: by 10.99.166.10 with SMTP id t10mr5852027pge.198.1518805844159; Fri, 16 Feb 2018 10:30:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518805844; cv=none; d=google.com; s=arc-20160816; b=Q3kf7DeaTueBk+DaWiIzE3YxQIVZ5gOAPD9v1SXCJGDHMozNll0bfg07MF3TSQ7zeG 2FFa+FCRwN7gKb6glh8SE6DkYm/VShZwKMZez978BsUrlxSYB1xB7v6uU+V3bjp4gkbG 8rksInPJRSnNgfqcKhMU3OvTeGeNW5EgC+rSQ5aLZrtsKKZYQZkQfGXWjZNIDsPsve4x nrAql599XrE54DjxlbQTpQyEFO3epXkdsUhAIm1TlvU9GftAaXdXp1QP4Vc4RyhZ1mFe bko71bhadKHgGFiBa5cNXh2zPUSgtp80EAnc3xu/4gGvCVe6EZlgdAoC7/sTG4ZbmXm/ BbwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=m2hWqD8sisCtV6AolQAmda7bL6Af8Ts1uLoPVXu7YK0=; b=EBAp1XhvJ64IzoO/7ODhIxwmo5culu5JLEqRLcnCKwWQvaMDFt3sTlagd+46govrSf 6YbelhnRLB7vpBmYR9BYh6vN7484+tdMDaG0Z8P0fCeu//Rem+YCrRDP2WSrLXG70CSd GuJ+Q69ezAwD9XWXAwzfYS9dT9uRdxhBBpkhHKyAe5CTvWrfzWPrRs+EpmSCoT2hT0Yu 9Tou/Df2MhKr51lCsaPuLHw6sRfUk8dR+HPpFADz2DbAB0kr16MMNVw2/tvOTt+6w/YI u7K7vqqkzoecysumX03NiNUMzdNO71Emolxgt1+R1tXRHNx0CdsQNccMoDQ3knXlPXyN ygzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=YVCOM7vU; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n9-v6si146327pll.334.2018.02.16.10.30.28; Fri, 16 Feb 2018 10:30:44 -0800 (PST) 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=YVCOM7vU; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1422810AbeBPAIg (ORCPT + 99 others); Thu, 15 Feb 2018 19:08:36 -0500 Received: from mail-it0-f45.google.com ([209.85.214.45]:36205 "EHLO mail-it0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1422779AbeBPAIe (ORCPT ); Thu, 15 Feb 2018 19:08:34 -0500 Received: by mail-it0-f45.google.com with SMTP id 18so227112itj.1 for ; Thu, 15 Feb 2018 16:08:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=m2hWqD8sisCtV6AolQAmda7bL6Af8Ts1uLoPVXu7YK0=; b=YVCOM7vUxdcFDZOLEu50Jynx9wLJKjllN4KCYsxQwlmZn+3z4YFnNKQgV8pgfTRUx5 czim/22Sg/wWPR+MapSiyTTyxs8XUnbprzQjSx7IX0BSh90uc+IUa46Oc0noy2hPMgfT VSWhXp3G6BZezptIpX3rEJcfz9YLEpNQv+8zs8+o+P6XRxAfQIg7y7pKMbdmcKOX+k2f GLvl6LPBnaZ3M3xfcrZrw05JhgWo2dPJRAWFdL9MsbsSQdlwei+9vNz9QSBZX4qc4AaT NMyAHSkKXvQzAZwFPAA4F5o4n6SH0FUVatMRC2DGIEpTi62bdg56qmQ8bO43I2j7u5Xm PWMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=m2hWqD8sisCtV6AolQAmda7bL6Af8Ts1uLoPVXu7YK0=; b=NmxFMABsTByn5bceO4JOi60J8aKLGEhH47OuEtUKuJnbXxoEhtIMvpzlCvof2iaUfO eqxOobTovrN4p70W+wUmkZ+lDJGLIEAIZnXiuzZiGPBUc0ErRzFfIP1a/ykHE5ry1Dcu 8NhDq1Rj6zsHKf5ek9X09Chrlc2y87qvWyD0aQx5gaH5lJabM8DD8bLI6B1KZHrpLifX lTE81oo5WKw7Wpwgc6V5zQ6ckbY0VOqLUc3sfjdEKZ48TY2qs5GRNMabBj6gKxsMELqT ilr+2IXpoKnlzm52fS3ercPk11NZQLRou3yru79kx7+pdpPcBx/bKOBuPT3XnYABSpHG 6dow== X-Gm-Message-State: APf1xPBV5qaP8UnML68MCaOUrrMXn6TqRmQYA4BTcDmKPsYkZNdOU5ou Cr1N+HGxgdWz3ZvSlb87QS4/QPMhgdKmpm/Qjxo= X-Received: by 10.36.176.1 with SMTP id d1mr6137199itf.100.1518739713672; Thu, 15 Feb 2018 16:08:33 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.135.221 with HTTP; Thu, 15 Feb 2018 16:08:33 -0800 (PST) In-Reply-To: References: <20180215163602.61162-1-namit@vmware.com> <20180215163602.61162-5-namit@vmware.com> <9EB804CA-0EC9-4CBB-965A-F3C8520201E7@gmail.com> From: Linus Torvalds Date: Thu, 15 Feb 2018 16:08:33 -0800 X-Google-Sender-Auth: r4sVuEEF1Ws1YKbG6TiHwj9iYzU Message-ID: Subject: Re: [PATCH RFC v2 4/6] x86: Disable PTI on compatibility mode To: Andy Lutomirski Cc: Nadav Amit , Pavel Emelyanov , Cyrill Gorcunov , Ingo Molnar , Thomas Gleixner , Peter Zijlstra , Dave Hansen , Willy Tarreau , X86 ML , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 15, 2018 at 3:29 PM, Andy Lutomirski wrote: > > It's possible we could get away with adding the prctl but making the > default be that only the bitness that matches the program being run is > allowed. After all, it's possible that CRIU is literally the only > program that switches bitness using the GDT. (DOSEMU2 definitely does > cross-bitness stuff, but it uses the LDT as far as I know.) And I've > never been entirely sure that CRIU fully counts toward the Linux > "don't break ABI" guarantee. Ugh. There are just _so_ many reasons to dislike that. It's not that I don't think we could try to encourage it, but this whole "security depends on it being in sync" seems really like a fundamentally bad design. > Linus, how would you feel about, by default, preventing 64-bit > programs from long-jumping to __USER32_CS and vice versa? How? It's a standard GDT entry. Are you going to start switching the GDT around every context switch? I *thought* that user space can just do a far jump on its own. But it's so long since I had to care that I may have forgotten all the requirements for going between "compatibility mode" and real long mode. I just feel this all is a nightmare. I can see how you would want to think that compatibility mode doesn't need PTI, but at the same time it feels like a really risky move to do this. I can see one thread being in compatibiilty mode, and another being in long mode, and sharing the address space. But even with just one thread, I'm not seeing how you keep user mode from going from compatibility mode to L mode with just a far jump. But maybe you have some clever scheme in mind that guarantees that there are no issues, or maybe I've just forgotten all the details of long mode vs compat mode. Linus