Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751615AbeAPTVX (ORCPT + 1 other); Tue, 16 Jan 2018 14:21:23 -0500 Received: from mail-qk0-f193.google.com ([209.85.220.193]:42025 "EHLO mail-qk0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751280AbeAPTVV (ORCPT ); Tue, 16 Jan 2018 14:21:21 -0500 X-Google-Smtp-Source: ACJfBovvK1uJ8GHSU5w1BA5AlLelhppKi8uPLcWG2F1/HONPk8dKxc4+bzGkqQH7iWD6fTuA4/RLh/kj9avQQa8Y47g= MIME-Version: 1.0 In-Reply-To: References: <151571798296.27429.7166552848688034184.stgit@dwillia2-desk3.amr.corp.intel.com> From: Tony Luck Date: Tue, 16 Jan 2018 11:21:19 -0800 Message-ID: Subject: Re: [PATCH v2 00/19] prevent bounds-check bypass via speculative execution To: Linus Torvalds Cc: Dan Williams , Linux Kernel Mailing List , Mark Rutland , kernel-hardening@lists.openwall.com, Peter Zijlstra , Alan Cox , Will Deacon , Alexei Starovoitov , Solomon Peachy , "H. Peter Anvin" , Christian Lamparter , Elena Reshetova , "linux-arch@vger.kernel.org" , Andi Kleen , "James E.J. Bottomley" , Linux SCSI List , Jonathan Corbet , "the arch/x86 maintainers" , Russell King , Ingo Molnar , Catalin Marinas , Alexey Kuznetsov , Linux Media Mailing List , Tom Lendacky , Kees Cook , Jan Kara , Al Viro , qla2xxx-upstream@qlogic.com, Thomas Gleixner , Mauro Carvalho Chehab , Kalle Valo , Alan Cox , "Martin K. Petersen" , Hideaki YOSHIFUJI , Greg KH , Linux Wireless List , "Eric W. Biederman" , Network Development , Andrew Morton , "David S. Miller" , Laurent Pinchart Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Sat, Jan 13, 2018 at 10:51 AM, Linus Torvalds wrote: > On Fri, Jan 12, 2018 at 4:15 PM, Tony Luck wrote: > So your argument depends on "the uarch will actually run the code in > order if there are no events that block the pipeline". And might be bogus ... I'm a software person not a u-arch expert. That sounded good in my head, but the level of parallelism may be greater than I can imagine. > Or at least it depends on a certain latency of the killing of any OoO > execution being low enough that the cache access doesn't even begin. > > I realize that that is very much a particular microarchitectural > detail, but it's actually a *big* deal. Do we have a set of rules for > what is not a worry, simply because the speculated accesses get killed > early enough? > > Apparently "test a register value against a constant" is good enough, > assuming that register is also needed for the address of the access. People who do understand this are working on what can be guaranteed. For now don't make big plans based on my ramblings. -Tony