Return-Path: Received: from mail.linutronix.de (146.0.238.70:993) by crypto-ml.lab.linutronix.de with IMAP4-SSL for ; 02 Jul 2018 18:52:16 -0000 Received: from mail-pl0-x22d.google.com ([2607:f8b0:400e:c01::22d]) by Galois.linutronix.de with esmtps (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1fa3vq-00018r-Ja for speck@linutronix.de; Mon, 02 Jul 2018 20:52:14 +0200 Received: by mail-pl0-x22d.google.com with SMTP id m16-v6so8353004pls.11 for ; Mon, 02 Jul 2018 11:52:14 -0700 (PDT) Received: from i7.lan (c-73-11-52-149.hsd1.or.comcast.net. [73.11.52.149]) by smtp.gmail.com with ESMTPSA id t127-v6sm17690486pfb.139.2018.07.02.11.52.06 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Jul 2018 11:52:07 -0700 (PDT) Sender: Linus Torvalds Date: Mon, 2 Jul 2018 11:52:05 -0700 (PDT) From: Linus Torvalds Subject: [MODERATED] More lfence excitement Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit To: speck@linutronix.de List-ID: So I assume many people on this list are occasionally in touch directly with the TU Graz people, so this comes as no surprise, but just FYI in case you aren't: they have some tests that indicate that lfence isn't quite the fence for speculative execution that it was supposed to be. Their tests says that under heavy interrupt loads, speculative instructions may in fact be executed even after the lfence. We'll see what Intel's reaction to that is. I can imagine a few ways it could be true, mainly something along the lines of "pending interrupt kills off speculative execution of slow-and-or-complex instructions for lower interrupt latency", where the complex "lfence" might be dismissed early due to a pending interrupt, but the regular simple instructions end up killed the usual way at retirement instead. And maybe the Graz data isn't right for some other reason, who knows. Their test program didn't really work all that well for me. They also have an entirely remote attack that depends on timing of network packets, which looks cute. The data rate is pretty low unless you're on the same local network (which generally isn't a very interesting attack, and even then it's pretty low - just not ridiculously so), but they were able to time packets even within a cloud setup using 20 million packets (for one bit). So they could leak a byte of data in a few hours. That's likely not very interesting on its own, although it's cute. But breaking KASRL remotely using it is possible, so it could be the beginning to a second attack. This is all under embargo, of course. And no, the "lfence isn't 100% safe" thing doesn't necessarily mean that anything *else* would be better, since even a serializing instruction might have similar issues. So even if it's true (and let's see what Intel ends up discovering), I don't think it's anything we should necessarily worry about. It's also likely not really an issue in practice. The network timing thing is cross-architecture (they did it on ARM too) and independent of the lfence thing. I suspect that too isn't really all that practical, but it _is_ cute. Linus