Window 7 Support

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Monday, 3 May 2010

On Formally Verified Microkernels (and on attacking them)

Posted on 07:11 by Unknown
Update May 14th, 2010: Gerwin Klein, a project lead for L4.verified, has posted some insightful comments. Also it's worth reading their website here that clearly explains what assumptions they make, and what they really prove, and what they don't.

You must have heard about it before: formally verified microkernels that offer 100% security... Why don't we use such a microkernel in Qubes then? (The difference between a micro-kernel and a type I hypervisor is blurry. Especially in case of a type I hypervisor used for running para-virtualized VMs, such as Xen used in Qubes. So I would call Xen a micro-kernel in this case, although it can also run fully-virtualized VMs, in which case it should be called a hypervisor I think.)

In order to formally prove some property of any piece of code, you need to first assume certain things. One such thing is the correctness of a compiler, so that you can be sure that all the properties you proved for the source code, still hold true for the binary generated from this source code. But let's say it's a feasible assumption -- we do have mature compilers indeed.

Another important assumption you need, and this is especially important in proving kernels/microkernels/hypervisors, is the model of the hardware your kernel interacts with. Not necessarily all the hardware, but at least the CPU (e.g. MMU, mode transitions, etc) and the Chipset.

While the CPUs are rather well understood today, and their architecture (we're talking IA32 here) doesn't change so dramatically from season to season. The chipsets, however, are a whole different story. If you take a spec for any modern chipset, let's say only the MCH part, the one closer to the processor (on Core i5/i7 even integrated on the same die), there are virtually hundreds of configuration registers there. Those registers are used for all sorts of different purposes -- they configure DRAM parameters, PCIe bridges, various system memory map characteristics (e.g. the memory reclaiming feature), access to the infamous SMM memory, and finally VT-d and TXT configuration.

So, how are all those details modeled in microkernels formal verification process? Well, as far as I'm aware, they are not! They are simply ignored. The nice way of saying this in academic papers is to say that "we trust the hardware". This, however, might be incorrectly understood by readers to mean "we don't consider physical attacks". But this is not equal! And I will give a practical example in a moment.

I can bet that even the chipset manufactures (think e.g. Intel) do not have formal models for their chipsets (again, I will give a good example to support this thesis below).

But why are the chipsets so important? Perhaps they are configured "safe by default" on power on, so even if we don't model all the configuration registers, and their effects on the system, and if we won't be playing with them, maybe it's safe to assume all will be fine then?

Well, it might be that way, if we could have secure microkernels without IOMMU/VT-d and without some trusted boot mechanism.

But we need IOMMU. Without IOMMU there is no security benefit of having a microkernel vs. having a good-old monolithic kernel. Let me repeat this statement again: there is no point in building a microkernel-based system, if we don't correctly use IOMMU to sandbox all the drivers.

Now, setting up IOMMU/VT-d permissions require programming the chipset's registers, and is by no means a trivial task (see the the Intel VT-d spec to get an impression, if you don't believe me). Correctly setting up IOMMU is one of the most security-critical tasks to be done by a hypervisor/microkernel, and so it would be logical to expect that they also formally prove that this part is done flawlessly...

The next thing is the trusted boot. I will argue that without proper trusted boot implementation, the system cannot be made secure. And I'm not talking about physical attacks, like Evil Maid. I'm talking about true, remote, software attacks. If you haven't read it already, please go back and read my very recent post on "Remotely Attacking Network Cards". Building on Loic's and Yves-Alexis' recent research, I describe there a scenario how we could take their attack further to compromise even such a securely designed system as Qubes. And this could be possible, because of a flaw in TXT implementation. And, indeed, we demonstrated an attack on Intel Trusted Execution Technology that exploits one such flaw before.

Let's quickly sketch the whole attack in points:

  1. The attacker attacks a flaw in the network card processing code (Loic and Yves-Alexis)

  2. The attacker replaces the NIC's firmware in EEPROM to survive the reboot (Loic and Yves-Alexis)

  3. The new firmware attacks the system trusted boot via a flaw in Intel TXT (ITL)

    • If the system uses SRTM instead, it's even easier -- see the previous post (ITL)

    • If you have new SINIT module that patched our attack, there is still an avenue to attack TXT via SMM (ITL)

  4. The microkernel/hypervisor gets compromised with a rootkit and the attacker gets full control over the system:o

And this is the practical example I mentioned above. I'm sure readers understand that this is just one example, of what could go wrong on the hardware level (and be reachable to a software-only attacker). Don't ignore hardware security! Even for software attacks!

A good question to ask is: would a system with a formally verified microkernel also be vulnerable to such an attack? And the answer is yes! Yes, unless we could model and prove correctness of the whole chipset and the CPU. But nobody can do that today, because it is impossible to build such a model. If it was, I'm pretty sure Intel would already have such a model and they would not release an SINIT module with this stupid implementation bug we found and exploited in our attack.

So, we see an example of a practical attack that could be used to fully compromise a well designed system, even if it had a formally verified microkernel/hypervisor. Compromise it remotely, over the network!

So, are all those whole microkernel/hypervisor formal verification attempts just a waste of time? Are they only good for academics so that they could write more papers for conferences? Or for some companies to use them in marketing?

Perhaps the formal verification of system software will never be able to catch up with the pace of hardware development... By the time people will learn how to build models (and how to solve them) for hardware used today, the hardware manufactures, in the meantime, will present a few new generations of the hardware. For which the academics will need another 5 years to catch up, and so on.

Perhaps the industry will take a different approach. Perhaps in the coming years we will get hardware that would allow us to create untrusted hypervisors/kernels that would not be able to read/write usermode pages (Hey Howard;)? This is currently not possible with the hardware we have, but, hey, why would a hypervisor need access to the Firefox pages?

And how this all will affect Qubes? Well, the Qubes project is not about building a hypervisor or a microkernel. Qubes is about how to take a secure hypervisor/microkernel, and how to build the rest of the system in a secure, and easy to use, way, using the isolation properties that this hypervisor/microkernel is expected to provide. So, whatever kernels we will have in the future (better formally verified, e.g. including the hardware in the model), or based on some exciting new hardware features, still Qubes architecture would make perfect sense, I think.
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Posted in attack, formal verification, philosophical, trusted computing | No comments
Newer Post Older Post Home

0 comments:

Post a Comment

Subscribe to: Post Comments (Atom)

Popular Posts

  • Windows 7 seamless GUI integration coming to Qubes OS!
    Finally, after months of hard work, seamless mode for Windows 7 AppVMs is coming to Qubes OS! The new Windows Support Tools will be releas...
  • Converting untrusted PDFs into trusted ones: The Qubes Way
    Arguably one of the biggest challenges for desktop security is how to handle those overly complex PDFs, DOCs, and similar files, that are ...
  • The MS-DOS Security Model
    Back in the '80s, there was an operating system called MS-DOS . This ancient OS, some readers might not even remember it today, had a ve...
  • The three approaches to computer security
    If we looked at the computer systems and how they try to provide security, I think we could categorize those attempts into three broad categ...
  • Running Vista Every Day!
    More then a month ago I have installed Vista RTM on my primary laptop (x86 machine) and have been running it since that time almost every da...
  • Attacking Xen: DomU vs. Dom0 consideration
    As it usually happens, there is some confusion regarding the attacks presented in our Xen 0wning Trilogy. Some people think they are possibl...
  • Thoughts on Intel's upcoming Software Guard Extensions (Part 2)
    In the first part of this article published a few weeks ago, I have discussed the basics of Intel SGX technology, and also disc...
  • Qubes 2 Beta 2 has been released!
    Qubes R2 Beta 2 with KDE 4.9 environment (click for more screenshots) We're progressing fast and today I would like to anno...
  • Disposable VMs
    While we're still busy with some last few tickets left for Qubes Alpha 2 milestone, Rafal has already started working on a new feature ...
  • SVV Source Code Made Public!
    I decided to publish the full source code of my System Virginity Verifier. The license grants you to do anything with the code, including us...

Categories

  • attack
  • backdoors
  • bad guys attacking joanna
  • BIOS
  • bitlocker
  • challanges
  • chipset
  • cloud
  • company news
  • conferences
  • disk encryption
  • exploit
  • fighting for a better world
  • formal verification
  • general
  • hypervisor rootkits
  • nested virtualization
  • os security
  • personal
  • philosophical
  • qubes
  • rootkits
  • saving-the-world-afterhours
  • secure architecture
  • smm
  • tpm
  • trusted computing
  • trusted execution technology
  • usb
  • virtualization based rootkits
  • xen hacking
  • xen heap exploiting

Blog Archive

  • ►  2013 (7)
    • ►  November (1)
    • ►  September (1)
    • ►  August (1)
    • ►  June (1)
    • ►  March (1)
    • ►  February (2)
  • ►  2012 (8)
    • ►  December (1)
    • ►  September (2)
    • ►  July (1)
    • ►  June (1)
    • ►  March (1)
    • ►  February (1)
    • ►  January (1)
  • ►  2011 (17)
    • ►  December (2)
    • ►  September (3)
    • ►  August (1)
    • ►  June (2)
    • ►  May (4)
    • ►  April (3)
    • ►  March (2)
  • ▼  2010 (15)
    • ►  December (1)
    • ►  October (1)
    • ►  September (4)
    • ►  August (2)
    • ►  July (1)
    • ►  June (1)
    • ▼  May (2)
      • On Formally Verified Microkernels (and on attackin...
      • Evolution
    • ►  April (2)
    • ►  January (1)
  • ►  2009 (21)
    • ►  December (1)
    • ►  October (1)
    • ►  September (2)
    • ►  August (2)
    • ►  July (2)
    • ►  June (3)
    • ►  May (1)
    • ►  March (4)
    • ►  February (2)
    • ►  January (3)
  • ►  2008 (15)
    • ►  September (3)
    • ►  August (4)
    • ►  July (2)
    • ►  May (1)
    • ►  April (4)
    • ►  March (1)
  • ►  2007 (15)
    • ►  October (2)
    • ►  August (2)
    • ►  June (1)
    • ►  May (1)
    • ►  April (2)
    • ►  March (2)
    • ►  February (3)
    • ►  January (2)
  • ►  2006 (8)
    • ►  November (1)
    • ►  October (1)
    • ►  September (1)
    • ►  August (1)
    • ►  July (1)
    • ►  June (1)
    • ►  May (2)
Powered by Blogger.

About Me

Unknown
View my complete profile