Follow Slashdot blog updates by subscribing to our blog RSS feed


Forgot your password?
Security Software Linux

Hyper-Threading, Linus Torvalds vs. Colin Percival 396

OutsideIn writes "The recent Hyper-Threading vulnerability announcement has generated a fair amount of discussion since it was released. KernelTrap has an interesting article quoting Linux creator Linus Torvalds who recently compared the vulnerability to similar issues with early SMP and direct-mapped caches suggesting, "it doesn't seem all that worrying in real life." Colin Percival, who published a recent paper on the vulnerability, strongly disagreed with Linus' assessment saying, "it is at times like this that Linux really suffers from having a single dictator in charge; when Linus doesn't understand a problem, he won't fix it, even if all the cryptographers in the world are standing against him.""
This discussion has been archived. No new comments can be posted.

Hyper-Threading, Linus Torvalds vs. Colin Percival

Comments Filter:
  • He won't fix it? (Score:5, Insightful)

    by Morgahastu ( 522162 ) <bshel@@@WEEZERro ... my fave bands n> on Wednesday May 18, 2005 @08:18AM (#12565292) Journal
    Then somebody else will.
    • by lintux ( 125434 )
      And how is that somebody else going to make Linus accept the patch?
      • Re:He won't fix it? (Score:5, Interesting)

        by Jugalator ( 259273 ) on Wednesday May 18, 2005 @08:34AM (#12565387) Journal
        Why wouldn't he?

        He doesn't say "I don't want a fix for this anywhere in the kernel" anywhere. Just that he doesn't think it's a very critical issue.

        If someone else does the patch for him, why wouldn't he accept it?
    • by untouchable ( 615727 ) <abyssperl AT gmail DOT com> on Wednesday May 18, 2005 @08:20AM (#12565304) Journal
      Fix what?

      If I remember correctly, there hasn't been a shown exploit for this yet. It's better to wait and see before fixing something that may not matter later.

      • by Niekie ( 884742 )
        And it might be best to start researching it as soon as possible before it will be massively exploited by someone who just found out how it works..
      • by CaymanIslandCarpedie ( 868408 ) on Wednesday May 18, 2005 @08:30AM (#12565364) Journal
        Oh come on man, don't be that guy ;-)

        So MS$ shouldn't fix problems in IE until an exploit has been shown for it?

        It's better to wait and see before fixing something that may not matter later.

        Its better to just fix it and be safe than wait and see if something happens later. It may not be top priority, but remember this "wait and see" approach to security is exactly what got MS$ into so much trouble with users. We don't need the same for Linux.
      • by Threni ( 635302 ) on Wednesday May 18, 2005 @08:38AM (#12565415)
        That reminds me of the joke about programmers being in a car, steaming downhill with failed brakes, narrowly avoiding death, then once the car has come to a standstill suggesting that instead of seeing what went wrong they just get back in the car and `see if it happens again`.
        • Re:He won't fix it? (Score:3, Interesting)

          by robertjw ( 728654 )
          That reminds me of the joke about programmers being in a car, steaming downhill with failed brakes, narrowly avoiding death, then once the car has come to a standstill suggesting that instead of seeing what went wrong they just get back in the car and `see if it happens again`.

          Programmers hell, most mechanics I know have this attitude. 'Well, it stopped, didn't it. We'll fix it later'

          I wouldn't blame software developers for this attitude, it seems to be common for humans (or at least Americans) as a
    • Re:He won't fix it? (Score:5, Interesting)

      by Vo0k ( 760020 ) on Wednesday May 18, 2005 @08:26AM (#12565334) Journal
      Actually, my bet is it will be fixed in the new CPU revision, by Intel. And eventually Kernel fix dug into the config somewhere next to other "bugfix/support" entries, with note like "Early multithreading Intel Pentium 4 CPUs have a vulnerablity that allows to override privledges of a process. This entry includes a patch for this bug at cost of increasing the kernel size by 32K and slightly slowing it down. If you have an early Pentium 4 processor and run a multi-user system, say Y. If you don't or aren't sure, say N."
      • by julesh ( 229690 )
        It isn't something Intel can fix, except by removing hyperthreading. The fact of the matter is that if you have two processes running simultaneously on the same processor, one of them can determine things about what the other is doing based on how many execution units of what type it seems to have access to, how long data remains in the cache, things like that. It's a fundamental problem that can only be fixed by the OS kernel denying use of hyperthreading to processes that need to be kept separate from o
    • ok..
      what are the real threats from the vulnurability?

      the author of the paper seems to see there to be some crapload of problems from this, yet I don't quite see it so(the attack route being quite far fetched imho). so much that a lot of other people probably saw this same 'problem' earlier as well but didn't really think of it as anything.


      is it something that can be done something to in the kernel and not in the suppoesdly vulnurable openssl? like, it is a 'feature' rather than a bug.
    • There is nothing to fix there, most of the coders agreed!

      Some people are just keep pushing their flawed agendas.

      Disclaimer: i did read the whole thread.
    • And how will they fix this?

      The only fix that kinda works is disabling hyperthreading. But on a dual core processor the problem is there as well (if there is a shared cache somewhere). And switching of the second core because of that would be stupid.

      The problem Colin points out (getting an RSA key) is a userland problem anyway, so there is nothing to fix for Linus... fixing cache eviction covert channels in the kernel is possible, but not without losing a lot of performance.

  • Dictator? (Score:5, Insightful)

    by BBrown ( 70466 ) on Wednesday May 18, 2005 @08:23AM (#12565319)
    A dictator who has made his domain open-source, thereby giving everybody free reign to change and make distinct copies of it?

    Come on.
    • Re:Dictator? (Score:5, Informative)

      by squiggleslash ( 241428 ) on Wednesday May 18, 2005 @08:52AM (#12565491) Homepage Journal
      The guy was refering to the oft-quoted observation that Linus is a "benevolent dictator []", or rather than Linux's development model is one of benevolent dictatorship. It wasn't an insult aimed at Torvalds. It's a comment about the development model used by many FOSS projects. See also Larry Wall and Perl, or Guido Van Rossem and Python. In all these cases contributors to the projects defer to a project figurehead who makes the final decisions as to what goes into the official version of the project, and where that project goes.

      The most common alternative model is community development, where a - usually but not always elected - committee of developer 'elders' steer the project. Apache and Mozilla would be good examples of the latter.

      I appreciate some people have heard about this comment first today, people are joining the Free Software and Open Source communities all the time, but it kind of surprises me that so many are criticising Colin for this without anyone explaining this.

    • If Red Hat or SuSE or anyone else disagree with Linux, they can simply produce and apply a patch to their own kernels while releasing the patch itself to the public.

      This is one of the good aspects of open-source software: If you disagree, you can fork or simply distribute a patched product.
  • Single Dictator? (Score:3, Insightful)

    by Anonymous Coward on Wednesday May 18, 2005 @08:26AM (#12565330)
    If Linus decides that he does not want to bump its priority up, someone else can fix it. Thats what fellow kernel developers do.

    If Microtoft decides not to fix it, then no one else can.

    so which one is a single dicatorship?
  • by Anonymous Coward on Wednesday May 18, 2005 @08:28AM (#12565347)
    The answer to Linus' assertion that "I'd be really surprised if somebody is actually able to get a real-world attack on a real-world pgp key usage or similar out of it" is not to say "Well we all think its bad", but to produce a proof-of-concept exploit.

    If he and "all the world's cryptographers" can't do that, then Linus' pragmatism beats the cryptographers paranoia (their defining quality, in my experience) into a cocked hat.

    If an exploit can't actually be exploited, it's not and exploit.
    • by jsonn ( 792303 ) on Wednesday May 18, 2005 @09:24AM (#12565739)
      Get the facts. Colin showed that you can retrieve ~30% of a RSA key by running a program in parallel. This can be improved most likely if you have the chance to do it more than once. It is also imported to keep in mind that you can't entirely avoid an unbalanced memory access pattern without also taking a huge performance penalty.

      The point of this debatte is that the Intel implementation sucks, it allows you to spy a lot on processes running on the virtual CPU. Sure, there are better alternatives than disabling HTT like the suggestions of Colin to only schedule threads of the same program on the virtual CPU. Actually, that is something you want to do anyway or otherwise you can seriously loose speed and drop under the performance of a processor with HTT disabled.

      Speaking of paranoia, it is often not a bad thing to have, many big security problems can be avoided. Oh, I forget to patch the Linux box next door.

    • "I'd be really surprised if somebody is actually able to get a real-world attack on a real-world pgp key usage or similar out of it"

      Being able to read arbitrary memory from another process is a big security flaw, as illustrated by the Minesweeper Hacking [] sample. But for a kernel programmer it's a minor deal for server security as it needs a local/remote exploit to run code on your box. Even then it is a readonly exploit, which decreases exploitability unless we're talking about stuff like SSL certs or GP

    • Other examples (Score:3, Insightful)

      One need only to look at the smart card world to see all sorts of side-channel attacks that are harder to execute than this. First there was power analysis, then when countermeasures were implemented there was differential power analysis, then more countermeasures, now the use RF leakage, so there are countermeasures against that.

      If a process is leaking information somewhere, then there will be people clever enough to pull that information out.

      That said, it seems that this is more of a library problem

  • by Timesprout ( 579035 ) on Wednesday May 18, 2005 @08:29AM (#12565352)
    you found an obscure and difficult to exploit vulnerability. Now quit trying to make out the world is doomed and trolling on Linus to keep the spotlight on youself.
    • I wonder what people would say if this was about Microsoft and not Linux? You think Slashdot would talk about it in the same way?
      • by TuringTest ( 533084 ) on Wednesday May 18, 2005 @08:44AM (#12565451) Journal
        If this was about Microsoft and Bill refused to fix the vulnerability, nobody else could write a patch for the sources to solve the problem. See the difference?
      • Of course. Except that the roles would be taken by other people: The Linux zealots would play the "it's a major security problem" role, while the MS zealots would play the "there's no real exploit here" role.

        Except that for MS problems you'd probably not actually hear about it unless an exploit has been found (MS would of course keep quiet about it, and others would probably not find out other than by creating an exploit).

        However, IANASE
  • by tronicum ( 617382 ) * on Wednesday May 18, 2005 @08:30AM (#12565360)
    Just because Linus does not share the same opinion on the importance of this issue this does not mean that he is an dictator.

    Colin needs to cool down a bit. At least the Linux distros (SuSE, Red Hat, etc are the ones which will get a problem from affected systems) are going to get patches for it. From Linus or any other Kernel developer.

  • by xiando ( 770382 )
    Linux is Open Source. So it does not matter what the dictator thinks. Because even if he is, like Colin childishly claims, a dictator, he does not have any real power over Linux users. There are, in fact, dozens of flavors of Linux kernels available on the market. And almost none of the major distributions today use the stock vanilla kernel, most of them ship with kernels who include numerous patches who are not part of the vanilla kernel. If Linus does not make a patch, someone else will. And chances are h
  • by uchi ( 534979 ) on Wednesday May 18, 2005 @08:31AM (#12565368) Homepage
    If Linus is the dictator, does that make RMS the court jester? On second thought, do dictators even have jesters? This does not look good for RMS.
  • by databyss ( 586137 ) on Wednesday May 18, 2005 @08:31AM (#12565369) Homepage Journal
    The all powerful Dvorak said linux had no leaders...
  • by mathmatt ( 851301 ) on Wednesday May 18, 2005 @08:34AM (#12565383) Homepage
    when Linus doesn't understand a problem, he won't fix it

    This is interesting logic: The idea that the creator of an organization must understand minutiae and micro-manage everything that the organization does.

    Interesting indeed...too bad it's fallacious. (Although it might explain what is taking Longhorn so long to come out - I can see Bill Gates searching Google for whitepapers on file systems, search algorithms, GUI's, etc.)
  • At least Linus.... (Score:2, Informative)

    by MarkEst1973 ( 769601 )
    ...has a job. Naturally this guy would disagree with Linus. He's got nothing else to do. I, too, would strongly disagree if someone casually dismissed the past three months of my life.

    From the original article []

    • Where do you work? I'm unemployed. For the past three months, I've spent almost all of my time working on this security flaw -- investigating how serious it was, contacting all of the affected vendors, explaining how this should be fixed, et cetera. I simply haven't had time to go out and ge
    • by mattgreen ( 701203 ) on Wednesday May 18, 2005 @08:58AM (#12565528)
      Nice ad hominem attack. Attack the argument, not the person.
  • by Xpilot ( 117961 ) on Wednesday May 18, 2005 @08:34AM (#12565390) Homepage
    The kernel developers don't seem to agree on the right way to fix this, whether at the kernel level or in userspace []. However, it may affect the performance of the kernel if it's done in kernelspace, and it is impractical to have everyone rewrite their userland software, as someone else pointed out []. The "patch" which is available [] for FreeBSD to fix this problem only disables hyperthreading [] and does not provide a real fix.
    • by redelm ( 54142 ) on Wednesday May 18, 2005 @11:59AM (#12567312) Homepage
      Look: if anybody is seriously concerned about cache snooping, just patch in a WBINVD instruction as part of return-from-interrupt. That will flush the dirty cache lines back to RAM and invalidate the rest. Yes, there's a horrible cost. Perhaps higher than doing without HT. But you will be secure against the boogyman! FWIW, I agree with Linus -- this is a theoretical, negligible threat, vulnerability. It doesn't yield data, and most crypto has fixed (rather than revealing) access patterns.

  • by tezza ( 539307 ) on Wednesday May 18, 2005 @08:39AM (#12565424)
    "even if all the cryptographers in the world are standing against him.""

    All said cyrptographers should buy a non hyperthreaded cpu, or turn it off.

    I mean if you use GPG [] on most machines, it will issue you a warning about Insecure Memory. That is someone could potentially harvest data from disused pages in memory.
    These cryptographers would use a secure memory system. I'm happy hoping that MI6 isn't running a remote memory exploit on my box.

    • by Anonymous Coward
      The insecure memory warning is because GPG doesn't have enough privileges to allocate memory securely. It needs to be suid to work properly. It has nothing to do with a special type of memory for your computer.
    • As far as know, insecure memory is worst than that. insecure memory can be paged to the disk, and stay there for a very long time.

      So even if you did not have any spyware running when you encrypted your secret files on where is the key to satellite that could melt the poles and flood all coastal cities, you would still be in trouble when 007 gets your laptop and searches throught your swap partition and find a suitable random looking bytes that luckily can decrypt everything, once more the free world is sav
  • By being able to reasonably guess what another program is doing, you can design attacks around it. You dont have to target stuff as specific as crypto keys.

    Stuff like timing attacks. A timing attack that might have been difficult or impossible before, may be possible or trivial now.

    No crypto involved.
  • by Raleel ( 30913 ) on Wednesday May 18, 2005 @08:50AM (#12565480)
    It's along the same lines of the "if all you got is a hammer" problem. If you've spent a lot of time working on something, it's obviously important to you. That doesn't mean that it's important to everyone else. This may well be a significant flaw from the crytographer's perspective, but then again, they study crypto a lot and have a vested interest in it.

    As someone pointed out, yay for linux being free. As one or two above pointed out, someone who does care with the knowledge will write a patch. It'll get implemented as an option in the code, and if shown to be unobtrusive enough, may even get turned on by default.
    • they study crypto a lot and have a vested interest in it

      From this it should follow that we listen to them, not that we dismiss what they say!

      I'm glad that the construction engineers who design the bridges we ride over "study [bridges] a lot", and aviation engineers who designed the plane I am about to ride on "study [planes] a lot" and you bet they "have a vested interest" in safety.

      Praise the experts who "study a lot", for without them, we'd all be dead. :-)

    • by julesh ( 229690 ) on Wednesday May 18, 2005 @10:16AM (#12566245)
      If you've spent a lot of time working on something, it's obviously important to you. That doesn't mean that it's important to everyone else.

      Well, no, however it is important to many people.

      I, like many others here, run an e-commerce web site on Linux servers. In my case, my servers are virtual servers shared with other users who I do not have any knowledge of at all.

      If the server used HT, it would be possible for one of those other users to run an exploit on the server to crack my e-commerce site's private key. Fortunately it doesn't, but my ISP could upgrade at any time...

      Hence, this is an issue that effects me and my customers, and I seriously hope that a fix finds itself into either apache mod_ssl or the mainline Linux kernel PDQ.
      • by Otto ( 17870 ) on Wednesday May 18, 2005 @10:52AM (#12566622) Homepage Journal
        Hence, this is an issue that effects me and my customers, and I seriously hope that a fix finds itself into either apache mod_ssl or the mainline Linux kernel PDQ.

        That's really what's up for debate here. Whether the patch should be in the kernel-land or in the code user-space (mod_ssl, for your example).

        The only realistic patch you could do in kernel-land is to simply disable HyperThreading. This works, but seems like a poor way to go. Any other form of patch in kernel-land just makes the attack harder and thus doesn't really work or it degrades performance way too much to be practical.

        But fixing it in userspace is somewhat easier to do, albeit you'd have to fix *every* user-space program that's susceptible to this sort of thing.

        Let's talk about the problem in general terms. When a program is doing some kind of computational stuff on something you want to remain secret, then it has to make some assumptions. Assumptions like the hardware is secure, or that it's not running on a virtual machine that's recording everything it does.. That sort of thing. You can come up with all kinds of ways to crack it like an egg if you work outside the box a bit and have total control of the machine it runs on.

        This problem is attacking one of those assumptions, namely that another process can't time the secret computations accurately enough to perform a timing attack. With HT, you have two things running on the same core, and so it is somewhat easier to do this sort of attack.

        So userspace programs that do secure computations have had one of their assumptions broken by HT. To remedy it, they need to rethink their assumptions. They need to or ensure that they perform equal timings regardless of the computations being done and so on. This is not particularly simple, but it's probably not particularly hard either.

        Of course, the attack is still largely theoretical. All it's been shown is that it's "possible", not that it's "easy" or even that it is indeed "doable". For one thing, without having some kind of clue as to the algorithim involved or some idea of what to look for, all you get are a bunch of timings. You still need to do some things to trigger it at the right time and in the right way as to be able to derive information from this channel.

        But crypto guys are paranoid like nobody else, and so they're naturally worried about this sort of thing. Mainly it's worrying to them because it's not a mathematical attack, which they're more used to. Modern crypto works based on theory and algorithims and such, and the idea that the algorithim being correct (for a given value of "correct") isn't enough to protect the security of the data is extremely worrying. A real world implementation of these algorithims now has to take some more real world facts into account, and this bothers them, of course.

        Linus is basically right here. The kernel is simply the wrong place to fix this. It doesn't ensure that processes cannot spy on other processes via subchannels like this, nor should it. If you're paranoid enough to think this is a real thing to guard against, then your secure code should take it into account. Existing code doesn't do that, and would need to be changed *even* if the kernel was patched. Because how do you know that your kernel has been patched? How do you know that you're not running on an HT processor? You can't know for sure, so you simply assume you are and take steps to make timing attacks fail. Because if you don't, you can't reasonably say that you've attempted to secure the code in this way.
      • If the server used HT, it would be possible for one of those other users to run an exploit on the server to crack my e-commerce site's private key.

        It may be possible, yes. But plausible?

        this is an issue that effects me and my customers

        It MAY affect you and your customers at some later time, but right now it doesn't.

        If you're THAT concerned about this issue, I assume you're going to call up your ISP and transition your site onto dedicated machines? Isn't it worth the extra cost to be assured that so
  • by ausoleil ( 322752 ) on Wednesday May 18, 2005 @08:58AM (#12565522) Homepage
    In layman's terms, this debate is:

    Scene: A wispy cloud scuds across the sunny blue sky. Not much happening, and the cloud is hardly even black.

    Chicken Little: The sky is falling! The Sky is falling!

    The Penguin DictatorNo, not really. It might fall, but it's very, very unlikely. So calm down!

    Chicken Little: I strongly disagree. The sky is falling! And because you do not understand the problem we're all going to die!

    The Penguin Dictator:Listen here. It's almost certainly not going to fall, and I need to worry about real problems!

    Chicken Little: (Runs screaming to the nearest coffeehouse with free wireless, where he types incessently:) The sky is falling! The Sky is falling! Tell Slashdot! Tell Tom's Hardware! Tell Cnet! Tell Linux Business News!

    The Penguin Dictator: Sigh. (And then he gets back to work. He looks up at the audience) They just do not get it, do they?

    The Windows Dark Lord: (Rubs hands together) Excellent, MOST excellent. (Yelling) Bring me my marketing minion!

    Marketing Minion: (being drug in by a bald guy yelling at him) Yes, O Master!?

    The Windows Dark Lord:Tell all the peasants that the sky is raining huge chunks of fire and dung! Tell everyone, tell them now! And have our independent consultants work on this day and night, night and day! Make sure that they independently tell everyone that they can easily avoid falminf chunks of sky dung if they stand behind our Windows! And RAISE the price!

    Some Guy At Some House In Some City Somewhere: "Wow, that was easy. Let me send this up to the Penguin Dictator. No sky ever fell, and that cloud is easily blown away. Nothing happening here, move along."

    The Penguin Dictator "Well that was easy. Include this patch in the next day's weather update!" Marketing Minion: Press Release!!! Millions killed by falling flaming sky chunks of burning dung with brain eating worms who eat children!!! Run for your lives!!!!

    Laura Didio, munching a do-nut"If you would hide behind Windows, the sky would stop falling! Your children would be safer and the world a better place." (looks at stoick ticker, says to self) 'Excellent. MOST excellent. Bring me a donut!'

    The Penguin Dictator "Sigh. Why didn't I just keep Sky 0.7a for myself? Why the bother, wy the bother?"

    EPILOGUE: No one was ever hurt by the piece of sky that never fell, and Chicken Little kept looking upward for another cloud to rant about.

    The End.

    • by Drakonian ( 518722 ) on Wednesday May 18, 2005 @11:59AM (#12567304) Homepage
      There are serious problems with your endearing allegory.

      1. Microsoft is just as potentially vulnerable as Linux. Their dirty laundry just doesn't get aired in public.

      2. The fix is non-trivial and non-obvious. It's not a simple buffer overflow. Any patches are likely to have serious repercussions on kernel performance. e.g. disabled HT, ensure only two threads of the same U.I.D. are scheduled on the same processor, flush cache at every context switch, etc. It looks that Linus is unwilling to accept them unless this vulnerability moves more from the theoretical to proven.

  • Great (Score:2, Insightful)

    by Mensa Babe ( 675349 )
    "it doesn't seem all that worrying in real life."

    Yeah, just like a mouse driver having full access to kernel security structures and raw disk partitions, it doesn't seem all that worrying at all (except when your entire system crashes thanks to a buggy sound driver, or you get rooted, or...).

    Not fixing this design mistake while laughing at respected experts in the field reminds me something []. I was hoping that we as a community might have became a little bit more mature during the last decade, but I seem
    • Re:Great (Score:3, Insightful)

      by Slashcrap ( 869349 )
      Not fixing this design mistake while laughing at respected experts in the field reminds me something. I was hoping that we as a community might have became a little bit more mature during the last decade, but I seem to have been naïve again.

      I don't think Linus was "laughing at respected security experts" at all. For one thing this guy isn't a respected security expert - in my experience they usually have jobs. Secondly he wasn't laughing - his point was that the best way to fix the issue was to patch
    • Re:Great (Score:3, Insightful)

      by Anonymous Coward
      He ran the bloddy "exploit" well over 1000 time to retrieve 30% of an RSA key.

      Stop a mo and take a deep breath.

      Take a look at your (heavily patched I'm sure) machine. If you had an unsupervised 24 hours with that box and an unprivileged account how many other actually useful exploits could you run for key retrieval.

      I can think of about 5 methods right now that are much more likely to yield results within Linux. Even on a very up-to-date system with a decent admin.


      - Storm in a teacup
  • by l3v1 ( 787564 ) on Wednesday May 18, 2005 @09:04AM (#12565570)
    Colin Percival, who published a recent paper on the vulnerability,

    Well, it's obvious that he has to be right then, since he has published a paper on the topic, right ? Right ? Nobody else can "understand a problem", only him, since he's got a paper on it. A real paper.

  • "even if all the cryptographers in the world are standing against him"

    Who would understand what they are saying anyway?
  • The man (Score:3, Insightful)

    by Rinisari ( 521266 ) on Wednesday May 18, 2005 @09:07AM (#12565600) Homepage Journal
    Linus seems to be intelligent enough to understand when to undertake certain tasks. Up to now, no one knew about the vulnerability. There hasn't been solid proof of exploit released in virus form yet. All this is, as of yet, is FUD. Linus doesn't want to reshape his priorities because of newfound FUD, and he's very smart in doing this.

    I'm sure that if an exploit is found, someone will have a patch ready for the next kernel revision - that's the beauty and advantage of Linux.
  • If you've got hackers coding exploits and targetting threads on your machine... perhaps Hyperthreading isn't your biggest problem.
  • ... or in any other general-purpose operating system on a general-purpose computer. PCs are fundamentally insecure. There are a dozen ways to spy on cryptographic operations done in them, ranging from trojans, to hardware side-channel attacks, and dozens more to get copies of keys that they store. This is just one particular attack that may permit an attacker who can't get a trojan running with sufficient privileges to spy on operations directly to obtain some key bits. But if the attacker can't do that, there are lots of other ways to get the keys. General-purpose computers are simply not trustworthy.

    If security is important, you do your crypto in a secure crypto module, like the FIPS 140-2 Level 4 IBM 4758 [] or the Level 3 Luna SA []. Or, you use a general-purpose computer with special-purpose, very simple software and then provide strict physical access control to the machine and very limited network access -- often through a serial link using a custom protocol rather than via a real network. Or you could theoretically use a general-purpose machine with a TCPA chip with a regular, general-purpose operating system that has been modified to make use of the TCPA chip and with keys tightly bound to a well-defined system software configuration. But only if you have good physical security. In many situations it's still better to use a FIPS 140-2 Level 3 or Level 4 device.

    IMO, the existence of weaknesses like this in Linux, and the fact that they're widely known, is a *good* thing, because it helps convince people not to trust that which is inherently untrustworthy. We need more publicity of similar problems in Windows (and there are lots of them).

    • That's good advice, but many people cannot afford to follow it. Specialist crypto hardware is too expensive for most users, and keeping a PC in a physically secure environment can be difficult and contradictory with other important considerations. There are many thousands of small internet-based businesses who simply cannot afford this level of protection, and must rely on "secure" servers rented from virtual server farms. Fixing problems like this quickly after they are discovered is important to help p
      • Specialist crypto hardware is too expensive for most users

        If your secrets are worth enough that an attacker would go to the effort required to use this exploit... no, it is not too expensive. An IBM 4758 costs just over $1000 and provides an extremely high level of security.

        If you want to go really cheap, and don't need high performance, you can also use a $10 smart card with a $10 smart card reader. The result is less secure than with a 4758, or a Luna SA, or any of the other products on the market, in several ways, but it's much, much better than doing the crypto in main memory on a GP CPU.

        and keeping a PC in a physically secure environment can be difficult and contradictory with other important considerations.

        Again, if you need security you have to do what it takes to get security. If security requirements contradict other requirements, you have a problem to solve.

        At bottom, the point is that this is a sophisticated attack. There are much easier ways to dig keys out of a GP computer. If you need to defend against this attack, then you also need to defend against all of those, and defending against all of those requires physical security and use of secure crypto hardware. By the time you've closed all the other avenues of attack, you've closed this one, too.

        This problem is real, and it's a good idea to fix it, on principle. But it's not uncommon that real security holes are simply irrelevant because of other considerations.

        This is analogous to someone pointing out that my house is insecure because the attic vents are made of lightweight sheet metal. An attacker can use a ladder to climb up, use a crowbar to rip the vent off, climb into my attic, find the access panel and drop down into my house. That's all very true. However, compared to all of the *other* ways there are to break into my house, it's simply irrelevant. My house is simply not an appropriate place to store the Hope diamond, and replacing the attic vents with heavy steel ones, or otherwise securing access to the attic, isn't going to change that.

  • Fix the applications (Score:5, Informative)

    by Tom7 ( 102298 ) on Wednesday May 18, 2005 @09:32AM (#12565806) Homepage Journal
    Why should this be fixed in the Kernel?

    This appears to be an application bug, not a kernel one. The kernel never claims to completely isolate processes from one another; though there are memory protections, there are loads of ways that processes can observer each other's actions. This is just a particularly high-resolution one.

    The real "bug" here, IMO, is that openSSL believes that no other process can observe anything about its secret computations. Timing attacks against RSA have been known for some time, particularly with regard to modular exponentiation.

    It wouldn't be too hard to make RSA encryption take the same amount of time no matter what code path is used, and to make its memory access patterns uncorrelated with the keys (perhaps by using randomization during allocation). They should do this--the fact that their application leaks information has nothing to do with the processor it's running on; it's just that HT makes it particularly easy to measure that information. This would have a performance penalty, and I think the OpenBSD folks are too obsessed with performance, and that's why they've not done this. The performance obsession is a serious problem in the Unix world, and software systems in general.

    If implementing openSSL effectively means adding special kernel support for things like constant-length timeslices or cache invalidation between context switches, that's fine. But this is not a bug in the kenel unless the kernel purports to enforce total separation between processes, which it certainly does not.
  • by iabervon ( 1971 ) on Wednesday May 18, 2005 @12:25PM (#12567619) Homepage Journal
    Linus probably would do something about this if all the cryptographers in the whole world said it mattered. But, so far, Percival is the only person who seems to think it's actually a problem. Nothing on the subject from Bruce Schneier. And, while he says Linus should talk to the SELinux people, he probably doesn't realize that they have almost certainly heard about this and didn't comment in the thread.

    It wouldn't be hard to have an option to prevent processes with different owners from running on the same physical CPU at the same time. It wouldn't even affect the case that Linus mentioned. But cryptographers don't seem to think it's a plausible attack anyway, aside from carefully arranged conditions. The discussion was entirely over whether it would be less foolish to prevent it in the kernel or in userspace, and nobody seems to have argued that anything should be done at all.
  • How to fix this (Score:4, Interesting)

    by Animats ( 122034 ) on Wednesday May 18, 2005 @12:48PM (#12567890) Homepage
    OK, we have a covert channel and a way to exploit it. How can that be fixed?

    First, remember that public key exchange is usually a very small component of a cryptographic session. Usually, you do all the public key work at startup, exchange private keys for the session, and then just use the private keys. So an inefficient solution that protects the public key computations is acceptable.

    In the paper, Percival writes "Further, OpenSSL utilizes a "sliding window" method of modular exponentiation, decomposing x := (a^d) mod p into a series of squarings x := x^2 mod p and multiplications x := x ^ (a*2*k+1) mod p." When there's a zero bit in d, the squaring and multiplication are unnecessary, and the SSL implementation apparently skips them. That creates the covert channel. It should be sufficient to revise the code so that it always does the squaring and the multiplication, and then uses the zero bit in D to decide whether or not to use the result. Because some superscalar CPUs might manage to look ahead and avoid the squaring and computation, a nice solution would be to compute both x := (a^d) mod p and x := (a^(d XOR K) mod p, where K is all binary ones out to the maximum length of d. This makes the computation symmetrical, independent of the value of d. This should roughly double the cost of the public key computation, which is probably tolerable.

    It's now important to also examine private key mechanisms for similar vulnerabilities. In particular, DES implementations should be checked. Because those execute millions of times during a long data transfer, even if there's a low-bandwidth leak, an exploit may be possible. Some lookup-table based implementations of DES might have exploitable cache semantics, and that needs to be explored.

"Now this is a totally brain damaged algorithm. Gag me with a smurfette." -- P. Buhr, Computer Science 354