LWN: Comments on "Is hyperthreading dangerous?" https://lwn.net/Articles/136273/ This is a special feed containing comments posted to the individual LWN article titled "Is hyperthreading dangerous?". en-us Sat, 27 Sep 2025 13:49:21 +0000 Sat, 27 Sep 2025 13:49:21 +0000 https://www.rssboard.org/rss-specification lwn@lwn.net mergemem and timing vulnerabilities https://lwn.net/Articles/137915/ https://lwn.net/Articles/137915/ anton If one could only check whether full pages are merged, that would be<br> pretty hard to exploit (one would have to guess all of the page<br> correctly, i.e., usually the complete key or password).<br> <p> Another potential attack path was using a timing attack based on how<br> long the merge attempt takes, or how much of the merge-attempted pages<br> is in the cache afterwards. That would bring the granularity down to<br> a word or a cache line, which makes guessing much more practical.<br> <p> IMO, even that attack path could be blocked relatively easily (e.g.,<br> allow only merging corresponding pages from processes that run the<br> same binary, and were not tainted with ptrace or somesuch).<br> <p> My impression was that too much emphasis was given to the<br> vulnerabilities in the mergemem announcements, and that may be one<br> reason why there was not much interest in it.<br> <p> Sun, 29 May 2005 11:15:55 +0000 Somewhat OT: Is hyperthreading dangerous? https://lwn.net/Articles/137847/ https://lwn.net/Articles/137847/ zakaelri Albeit I may pay for it later, this is a great place where TPM (Trusted Computing) could be used. Within the TPM system, the chip responsible for key management is the only one that can ever "see" the keys being used.<br> <p> Any time a key goes out, it's encrypted. So, you can send in an encrypted key, a datastream, and an encrypt/decrypt/sign/verify instruction... the chip does the magic required, and spits out whichever data was asked for.<br> <p> Note: While Palladium is evil. I actually like TPM. (My ThinkPad has it, but I havn't had the opportunity to set it up yet).<br> <p> <p> To make a desparate attempt for on-topic-ness: I disliked HTT from the beginning. It didn't seem worth paying for... It makes more sense (to me) to fine-tune cache performance.<br> Fri, 27 May 2005 20:38:37 +0000 5 to 30% Speed Improvement https://lwn.net/Articles/137639/ https://lwn.net/Articles/137639/ MarkWilliamson HT doesn't provide extra functional units but it may enable better use of <br> the functional units available, as well as allowing the CPU to continue <br> working in the event one thread stalls. <br> <br> Unfortunately, with cache contention (and the different mix of functional <br> units required by different threads), the performance benefits can be <br> highly variable - scheduling-wise it's a whole new can of worms!!! <br> Thu, 26 May 2005 13:34:21 +0000 Dual cores... https://lwn.net/Articles/137638/ https://lwn.net/Articles/137638/ MarkWilliamson IIRC, the initial dual-cores from AMD and Intel will not share any cache. <br> Intel's (initial) implementation in particular is basically two <br> independent CPUs on the same die. Even when shared L2 caches are <br> implemented, it seems that sharing an L2 cache will provide lower <br> bandwidth to this kind of exploit, which benefits hugely from the shared <br> L1 cache of the two hyperthreads. <br> <br> Note that IBM's POWER4 shares caches across multiple cores and the POWER5 <br> also has SMT... <br> Thu, 26 May 2005 13:30:44 +0000 Threads actually do run simultaneously https://lwn.net/Articles/137636/ https://lwn.net/Articles/137636/ MarkWilliamson A little quibble about the first paragraph: hyperthreads actually do run <br> truly simultaneously, which is what distinguishes Simultaneous <br> MultiThreading from Fine Grained MultiThreading. This gives the <br> additional benefit of being able to use issue slots in a superscalar CPU <br> that would otherwise be wasted. Of course, if one stalls, you still get <br> the benefit that the other thread carries on keeping the processor busy. <br> <br> Since modern x86 CPUs internally use register renaming and figure out <br> instruction dependencies dynamically, I've always suspected that adding HT <br> didn't require many (or perhaps any) changes to the middle part of the <br> pipeline. <br> Thu, 26 May 2005 13:23:37 +0000 Is hyperthreading dangerous? https://lwn.net/Articles/137359/ https://lwn.net/Articles/137359/ mjc@redhat.com <font class="QuotedText">&gt; In the longer term, authors of cryptographic code may find that they need </font><br> <font class="QuotedText">&gt; to add avoidance of data-dependent memory access patterns </font><br> <p> At least one affected cryptographic library has been evaluating ways to mitigate this issue. OpenSSL is adding contsant-time exponentiation:<br> <p> <a href="http://marc.theaimsgroup.com/?l=openssl-cvs&amp;m=111620782424862&amp;w=2">http://marc.theaimsgroup.com/?l=openssl-cvs&amp;m=1116207...</a><br> Wed, 25 May 2005 09:53:28 +0000 5 to 30% Speed Improvement https://lwn.net/Articles/136850/ https://lwn.net/Articles/136850/ ksmathers If what I've read is correct, hyperthreading increases processor efficiency in the event of a stalled pipeline (such as for a mispredicted branch, or a subroutine entry/exit), but doesn't provide any extra execution units for parallelism. A 30% upper end to speed improvement is about right, but the bottom end is more like -5%. For two CPU bound tasks both of which are contending for cache-lines and each with relatively long spans of instructions between function calls (typically C code instead of C++) Hyperthreading can cause thrashing in the L1 and L2 cache for a net drop in performance.<br> Fri, 20 May 2005 17:08:41 +0000 Is hyperthreading dangerous? https://lwn.net/Articles/136716/ https://lwn.net/Articles/136716/ hamjudo <i>... is for the cryptography to occur on dedicated processors, designed to make obtaining access to embedded private keys very difficult and expensive. </i><p> If the cryptographic keys are mission critical, they must be backed up. The backups also have to be protected, even when stored off site. I think that the most significant benefit of a dedicated processor is that you can have a very different scheme for backing up the crypto hardware than for your other servers.<p> Thu, 19 May 2005 17:35:08 +0000 Is hyperthreading dangerous? https://lwn.net/Articles/136710/ https://lwn.net/Articles/136710/ khim <p>Does this very theoretical exploit affect multicore systems too?</p> <p>Yes and no. Yes - it's possible to use the same technique for dual-core systems. But in reality it'll require <b>way</b> too much brute force. The problem with Hyper-Threading is size of L1 cache - it's too small. Multicore systems only share L2 cache (if even that) and it's much bigger so problem becomes pure theory.</p> Thu, 19 May 2005 15:13:55 +0000 Is hyperthreading dangerous? https://lwn.net/Articles/136648/ https://lwn.net/Articles/136648/ ballombe Interestingly, when the mergemem pacth (<a href="http://mergemem.ist.org/">http://mergemem.ist.org/</a>) was proposed in 1998, it was accompanied by a note stating a similar security concern. (Hostile programs could generate pages and see whether memory usage go up or not, and deduce they were merged).<br> <p> Avoidance of data-dependent memory access patterns is already in use in smartcard devices (it is much easier to exploit once you have stolen the smartcard, though).<br> Thu, 19 May 2005 12:56:39 +0000 Is hyperthreading dangerous? https://lwn.net/Articles/136680/ https://lwn.net/Articles/136680/ copsewood I would question whether it is even possible to make cryptographic computations optimally secure on a highly complex system shared with potentially hostile processes. This kind of attack highlights the kind of difficulties involved. If cryptography is only one of very many things done on a highly complex system, it seems to me unlikely that the security of this cryptography will be done very well. I think a simpler and likely to be more effective approach, once appropriate hardware becomes more generally available, is for the cryptography to occur on dedicated processors, designed to make obtaining access to embedded private keys very difficult and expensive.<br> Thu, 19 May 2005 12:19:44 +0000 Is hyperthreading dangerous? https://lwn.net/Articles/136638/ https://lwn.net/Articles/136638/ filipjoelsson Does this very theoretical exploit affect multicore systems too? I'm not sure I have this right, but I think they sharing cache too. Or is the (still very theorietical) exploit dependent on the feature that the hostile thread and the cryptographic one do not run at the same time?<br> <p> In any case, I have the answer:<br> &lt;TIC&gt;This is the perfect exploit to close with security thorugh obscurity. We have to lessen the risque that the two processes happen to be in the same processor cache at the same time. This is best (depending on wether you share my definition of 'best') done by getting an 8-way SMP system, preferably dualcore. (Well, at least _I_ would prefer that, wouldn't you?) Thus the chance would be slim, at best, that the two processes would schedule to the same processor at the same time. (Now, all I need is to persuade my wife that this is necessary in the name of security.)&lt;/TIC&gt;<br> Thu, 19 May 2005 09:42:14 +0000