<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dw="http://www.dreamwidth.org">
  <id>tag:dreamwidth.org,2011-02-12:696190</id>
  <title>Matthew Garrett</title>
  <subtitle>Matthew Garrett</subtitle>
  <author>
    <name>Matthew Garrett</name>
  </author>
  <link rel="alternate" type="text/html" href="http://mjg59.dreamwidth.org/"/>
  <link rel="self" type="text/xml" href="http://mjg59.dreamwidth.org/data/atom"/>
  <updated>2013-05-07T17:18:31Z</updated>
  <dw:journal username="mjg59" type="personal"/>
  <link rel="hub" href="http://pubsubhubbub.appspot.com/"/>
  <entry>
    <id>tag:dreamwidth.org,2011-02-12:696190:24818</id>
    <link rel="alternate" type="text/html" href="http://mjg59.dreamwidth.org/24818.html"/>
    <link rel="self" type="text/xml" href="http://mjg59.dreamwidth.org/data/atom/?itemid=24818"/>
    <title>A short introduction to TPMs</title>
    <published>2013-05-07T17:18:31Z</published>
    <updated>2013-05-07T17:18:31Z</updated>
    <category term="fedora"/>
    <category term="advogato"/>
    <dw:security>public</dw:security>
    <dw:reply-count>30</dw:reply-count>
    <content type="html">I've been working on TPMs lately. It turns out that they're moderately awful, but what's significantly more awful is basically all the existing documentation. So here's some of what I've learned, presented in the hope that it saves someone else some amount of misery.&lt;br /&gt;&lt;h2&gt;What is a TPM?&lt;/h2&gt;TPMs are devices that adhere to the Trusted Computing Group's Trusted Platform Module specification. They're typically microcontrollers[1] with a small amount of flash, and attached via either i2c (on embedded devices) or LPC[2] (on PCs). While designed for performing cryptographic tasks, TPMs are &lt;em&gt;not&lt;/em&gt; cryptographic accelerators - in almost all situations, carrying out any TPM operations on the CPU instead would be massively faster[3]. So why use a TPM at all? &lt;br /&gt;&lt;h2&gt;Keeping secrets with a TPM&lt;/h2&gt;TPMs can encrypt and decrypt things. They're not terribly fast at doing so, but they have one significant benefit over doing it on the CPU - they can do it with keys that are tied to the TPM. All TPMs have something called a Storage Root Key (or SRK) that's generated when the TPM is initially configured. You can ask the TPM to generate a new keypair, and it'll do so, encrypt them with the SRK (or another key descended from the SRK) and hand it back to you. Other than the SRK (and another key called the Endorsement Key, which we'll get back to later), these keys aren't actually kept on the TPM - the running OS stores them on disk. If the OS wants to encrypt or decrypt something, it loads the key into the TPM and asks it to perform the desired operation. The TPM decrypts the key and then goes to work on the data. For small quantities of data, the secret can even be stored in the TPM's nvram rather than on disk.&lt;br /&gt;&lt;br /&gt;All of this means that the keys are tied to a system, which is great for security. An attacker can't obtain the decrypted keys, even if they have a keylogger and full access to your filesystem. If I encrypt my laptop's drive and then encrypt the decryption key with the TPM, stealing my drive won't help even if you have my passphrase - any other TPM simply doesn't have the keys necessary to give you access.&lt;br /&gt;&lt;br /&gt;That's fine for keys which are system specific, but what about keys that I might want to use on multiple systems, or keys that I want to carry on using when I need to replace my hardware? Keys can optionally be flagged as migratable, which makes it possible to export them from the TPM and import them to another TPM. This seems like it defeats most of the benefits, but there's a couple of features that improve security here. The first is that you need the TPM ownership password, which is something that's set during initial TPM setup and then not usually used afterwards. An attacker would need to obtain this somehow. The other is that you can set limits on migration when you initially import the key. In this scenario the TPM will only be willing to export the key by encrypting it with a pre-configured public key. If the private half is kept offline, an attacker is still unable to obtain a decrypted copy of the key.&lt;br /&gt;&lt;h2&gt;So I just replace the OS with one that steals the secret, right?&lt;/h2&gt;Say my root filesystem is encrypted with a secret that's stored on the TPM. An attacker can replace my kernel with one that grabs that secret once the TPM's released it. How can I avoid that?&lt;br /&gt;&lt;br /&gt;TPMs have a series of Platform Configuration Registers (PCRs) that are used to record system state. These all start off programmed to zero, but applications can extend them at runtime by writing a sha1 hash into them. The new hash is concatenated to the existing PCR value and another sha1 calculated, and then this value is stored in the PCR. The firmware hashes itself and various option ROMs and adds those values to some PCRs, and then grabs the bootloader and hashes that. The bootloader then hashes its configuration and the files it reads before executing them.&lt;br /&gt;&lt;br /&gt;This chain of trust means that you can verify that no prior system component has been modified. If an attacker modifies the bootloader then the firmware will calculate a different hash value, and there's no way for the attacker to force that back to the original value. Changing the kernel or the initrd will result in the same problem. Other than replacing the very low level firmware code that controls the root of trust, there's no way an attacker can replace any fundamental system components without changing the hash values.&lt;br /&gt;&lt;br /&gt;TPMs support using these hash values to decide whether or not to perform a decryption operation. If an attacker replaces the initrd, the PCRs won't match and the TPM will simply refuse to hand over the secret. You can actually see this in use on Windows devices using Bitlocker - if you do anything that would change the PCR state (like booting into recovery mode), the TPM won't hand over the key and Bitlocker has to prompt for a recovery key. Choosing which PCRs to care about is something of a balancing act. Firmware configuration is typically hashed into PCR 1, so changing any firmware configuration options will change it. If PCR 1 is listed as one of the values that must match in order to release the secret, changing any firmware options will prevent the secret from being released. That's probably overkill. On the other hand, PCR 0 will normally contain the firmware hash itself. Including this means that the user will need to recover after updating their firmware, but failing to include it means that an attacker can subvert the system by replacing the firmware.&lt;br /&gt;&lt;h2&gt;What about using TPMs for DRM?&lt;/h2&gt;In theory you could populate TPMs with DRM keys for media playback, and seal them such that the hardware wouldn't hand them over. In practice this is probably too easily subverted or too user-hostile - changing default boot order in your firmware would result in validation failing, and permitting that would allow fairly straightforward subverted boot processes. You really need a finer grained policy management approach, and that's something that the TPM itself can't support.&lt;br /&gt;&lt;br /&gt;This is where Remote Attestation comes in. Rather than keep any secrets on the local TPM, the TPM can assert to a remote site that the system is in a specific state. The remote site can then make a policy determination based on multiple factors and decide whether or not to hand over session decryption keys. The idea here is fairly straightforward. The remote site sends a nonce and a list of PCRs. The TPM generates a blob with the requested PCR values, sticks the nonce on, encrypts it and sends it back to the remote site. The remote site verifies that the reply was encrypted with an actual TPM key, makes sure that the nonce matches and then makes a policy determination based on the PCR state.&lt;br /&gt;&lt;br /&gt;But hold on. How does the remote site know that the reply was encrypted with an actual TPM? When TPMs are built, they have something called an Endorsement Key (EK) flashed into them. The idea is that the only way to have a valid EK is to have a TPM, and that the TPM will never release this key to anything else. There's a couple of problems here. The first is that proving you have a valid EK to a remote site involves having a chain of trust between the EK and some globally trusted third party. Most TPMs don't have this - the only ones I know of that do are recent Infineon and STMicro parts. The second is that TPMs only have a single EK, and so any site performing remote attestation can cross-correlate you with any other site. That's a pretty significant privacy concern.&lt;br /&gt;&lt;br /&gt;There's a theoretical solution to the privacy issue. TPMs never actually sign PCR quotes with the EK. Instead, TPMs can generate something called an Attestation Identity Key (AIK) and sign it with the EK. The OS can then provide this to a site called a PrivacyCA, which verifies that the AIK is signed by a real EK (and hence a real TPM). When a third party site requests remote attestation, the TPM signs the PCRs with the AIK and the third party site asks the PrivacyCA whether the AIK is real. You can have as many AIKs as you want, so you can provide each service with a different AIK.&lt;br /&gt;&lt;br /&gt;As long as the PrivacyCA only keeps track of whether an AIK is valid and not which EK it was signed with, this avoids the privacy concerns - nobody would be able to tell that multiple AIKs came from the same TPM. On the other hand, it makes any PrivacyCA a pretty attractive target. Compromising one would not only allow you to fake up any remote attestation requests, it would let you violate user privacy expectations by seeing that (say) the TPM being used to attest to HolyScriptureVideos.com was also being used to attest to DegradingPornographyInvolvingAnimals.com.&lt;br /&gt;&lt;br /&gt;Perhaps unsurprisingly (given the associated liability concerns), there's no public and trusted PrivacyCAs yet, and even if they were (a) many computers are still being sold without TPMs and (b) even those with TPMs often don't have the EK certificate that would be required to make remote attestation possible. So while remote attestation could theoretically be used to impose DRM in a way that would require you to be running a specific OS, practical concerns make it pretty difficult for anyone to deploy that at any point in the near future.&lt;br /&gt;&lt;h2&gt;Is this just limited to early OS components?&lt;/h2&gt;Nope. The Linux kernel &lt;a href="http://linux-ima.sourceforge.net/"&gt;has support&lt;/a&gt; for measuring each binary run or each module loaded and extending PCRs accordingly. This makes it possible to ensure that the running binaries haven't been modified on disk. There's not a lot of distribution infrastructure for setting this up, but in theory a distribution could deploy an entirely signed userspace and allow the user to opt into only executing correctly signed binaries. Things get more interesting when you add interpreted scripts to the mix, so there's still plenty of work to do there.&lt;br /&gt;&lt;h2&gt;So what can I actually use a TPM for?&lt;/h2&gt;Drive encryption is probably the best example (Bitlocker does it on Windows, and there's a LUKS-based implementation for Linux &lt;a href="https://github.com/shpedoikal/tpm-luks"&gt;here&lt;/a&gt;) - while in theory you could do things like use your TPM as a factor in two-factor authentication or tie your GPG key to it, there's not a lot of existing infrastructure for handling all of that. For the majority of people, the most useful feature of the TPM is probably the random number generator. rngd has support for pulling numbers out of it and stashing them in /dev/random, and it's probably worth doing that unless you have an Ivy Bridge or other CPU with an RNG.&lt;br /&gt;&lt;br /&gt;Things get more interesting in more niche cases. Corporations can bind VPN keys to corporate machines, making it possible to impose varying security policies. Intel use the TPM as part of their anti-theft technology on education-oriented devices like the Classmate. And in the cloud, projects like &lt;a href="https://wiki.openstack.org/wiki/TrustedComputingPools"&gt;Trusted Computing Pools&lt;/a&gt; use remote attestation to verify that compute nodes are in a known good state before scheduling jobs on them.&lt;br /&gt;&lt;h2&gt;Is there a threat to freedom?&lt;/h2&gt;At the moment, probably not. The lack of any workable general purpose remote attestation makes it difficult for anyone to impose TPM-based restrictions on users, and any local code is obviously under the user's control - got a program that wants to read the PCR state before letting you do something? LD_PRELOAD something that gives it the desired response, or hack it so it ignores failure. It's just far too easy to circumvent.&lt;br /&gt;&lt;h2&gt;Summary?&lt;/h2&gt;TPMs are useful for some very domain-specific applications, drive encryption and random number generation. The current state of technology doesn't make them useful for practical limitations of end-user freedom.&lt;br /&gt;&lt;br /&gt;[1] Ranging from 8-bit things that are better suited to driving washing machines, up to full ARM cores&lt;br /&gt;[2] "Low Pin Count", basically ISA without the slots.&lt;br /&gt;[3] Loading a key and decrypting a 5 byte payload takes 1.5 &lt;em&gt;seconds&lt;/em&gt; on my laptop's TPM.&lt;br /&gt;&lt;br /&gt;&lt;img src="http://www.dreamwidth.org/tools/commentcount?user=mjg59&amp;ditemid=24818" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2011-02-12:696190:24463</id>
    <link rel="alternate" type="text/html" href="http://mjg59.dreamwidth.org/24463.html"/>
    <link rel="self" type="text/xml" href="http://mjg59.dreamwidth.org/data/atom/?itemid=24463"/>
    <title>Update on leaked UEFI signing keys - probably no significant risk</title>
    <published>2013-04-05T23:21:05Z</published>
    <updated>2013-04-05T23:21:05Z</updated>
    <category term="fedora"/>
    <category term="advogato"/>
    <dw:security>public</dw:security>
    <dw:reply-count>3</dw:reply-count>
    <content type="html">According to the update &lt;a href="http://adamcaudill.com/2013/04/04/security-done-wrong-leaky-ftp-server/"&gt;here&lt;/a&gt;, the signing keys are supposed to be replaced by the hardware vendor. If vendors do that, this ends up being uninteresting from a security perspective - you could generate a signed image, but nothing would trust it. It should be easy enough to verify, though. Just download a firmware image from someone using AMI firmware, pull apart the capsule file, decompress everything and check whether the leaked public key is present in the binaries.&lt;br /&gt;&lt;br /&gt;The real risk here is that even if most vendors have replaced that key, some may not have done. There's certainly an argument that shipping test keys at all increases the probability that a vendor will accidentally end up using those rather than generating their own, and it's difficult to rule out the possibility that that's happened.&lt;br /&gt;&lt;br /&gt;&lt;img src="http://www.dreamwidth.org/tools/commentcount?user=mjg59&amp;ditemid=24463" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2011-02-12:696190:24306</id>
    <link rel="alternate" type="text/html" href="http://mjg59.dreamwidth.org/24306.html"/>
    <link rel="self" type="text/xml" href="http://mjg59.dreamwidth.org/data/atom/?itemid=24306"/>
    <title>Leaked UEFI signing keys</title>
    <published>2013-04-05T19:18:36Z</published>
    <updated>2013-04-05T23:21:47Z</updated>
    <category term="fedora"/>
    <category term="advogato"/>
    <dw:security>public</dw:security>
    <dw:reply-count>2</dw:reply-count>
    <content type="html">(See &lt;a href="http://mjg59.dreamwidth.org/24463.html"&gt;here&lt;/a&gt; for an update to this)&lt;br /&gt;&lt;br /&gt;A hardware vendor &lt;a href="http://adamcaudill.com/2013/04/04/security-done-wrong-leaky-ftp-server/"&gt;apparently had a copy of an AMI private key on a public FTP site&lt;/a&gt;. This is concerning, but it's not immediately obvious how dangerous this is for a few reasons. The first is that this is apparently the firmware signing key, not any of the Secure Boot keys. That means it can't be used to sign a UEFI executable or bootloader, so can't be used to sidestep Secure Boot directly. The second is that it's AMI's key, not a board vendor - we don't (yet) know if this key is used to sign any actual shipping firmware images, or whether it's effectively a reference key. And, thirdly, the code apparently dates from early 2012 - even if it was an actual signing key, it may have been replaced before any firmware based on this code shipped.&lt;br /&gt;&lt;br /&gt;But there's still the worst case scenario that this key &lt;em&gt;is&lt;/em&gt; used to sign most (or all) AMI-based vendor firmware. Can this be used to subvert Secure Boot? Plausibly. The attack would involve producing a new, signed firmware image with Secure Boot either disabled or with an additional key installed, and then to reflash that firmware. Firmware images are very board-specific, so unless you're engaging in a very targeted attack you either need a large repository of firmware for every board you want to attack, or you need to perform in-place modification.&lt;br /&gt;&lt;br /&gt;Taking a look at the firmware update tool used for AMI systems, the latter might be possible. It seems that the AMI firmware driver allows you to dump the existing ROM to a file. It'd then be a matter of pulling apart the firmware image, modifying the key database, putting it back together, signing it and flashing it. It looks like doing this does require that the user enter the firmware password if one's set, so the simplest mitigation strategy would be to do that.&lt;br /&gt;&lt;br /&gt;So. If this key is used by most vendors shipping AMI-based firmware, and if it's a current (rather than test) key, then it may well be possible for it to be deployed in an automated malware attack that subverts the Secure Boot trust model on systems running AMI-based firmware. The obvious lesson here is that handing out your private keys to third parties that you don't trust is a pretty bad idea, as is including them in source repositories.&lt;br /&gt;&lt;br /&gt;(Wow, was &lt;a href="http://lists.debian.org/debian-devel/2004/10/msg01643.html"&gt;this&lt;/a&gt; really as long ago as 2004? How little things change)&lt;br /&gt;&lt;br /&gt;&lt;img src="http://www.dreamwidth.org/tools/commentcount?user=mjg59&amp;ditemid=24306" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2011-02-12:696190:23817</id>
    <link rel="alternate" type="text/html" href="http://mjg59.dreamwidth.org/23817.html"/>
    <link rel="self" type="text/xml" href="http://mjg59.dreamwidth.org/data/atom/?itemid=23817"/>
    <title>Secure Boot and Restricted Boot.</title>
    <published>2013-03-27T00:28:32Z</published>
    <updated>2013-03-27T00:28:32Z</updated>
    <category term="fedora"/>
    <category term="advogato"/>
    <dw:security>public</dw:security>
    <dw:reply-count>28</dw:reply-count>
    <content type="html">I gave a presentation at &lt;a href="http://libreplanet.org/wiki/LibrePlanet:Conference/2013"&gt;Libreplanet&lt;/a&gt; this weekend on the topic of Secure Boot and Restricted Boot. There's a copy of the video &lt;a href="http://www.codon.org.uk/~mjg59/sb/mjg59_secure_restricted_boot.ogv"&gt;here&lt;/a&gt; - it should be up on the conference site at some point. It turned out to be excellent timing, in that a group in Spain &lt;a href="http://www.reuters.com/article/2013/03/26/us-microsoft-eu-idUSBRE92P0E120130326"&gt;filed a complaint with the European Commission this morning&lt;/a&gt; arguing that Microsoft's imposition of Secure Boot on the x86 client PC market is anticompetitive. I suspect that this is unlikely to succeed (the Commission has &lt;a href="http://www.europarl.europa.eu/sides/getAllAnswers.do?reference=E-2012-011084&amp;amp;language=EN"&gt;already stated&lt;/a&gt; that the current implementation appears to conform to EU law), and I fear that it's going to make it harder to fight the real battle we face.&lt;br /&gt;&lt;br /&gt;Secure Boot means different things to different people. I think the &lt;a href="http://www.fsf.org/campaigns/secure-boot-vs-restricted-boot/statement/"&gt;FSF's definition&lt;/a&gt; is a useful one - Secure Boot is any boot validation scheme in which ultimate control is in the hands of the owner of the device, while Restricted Boot is any boot validation scheme in which ultimate control is in the hands of a third party. What Microsoft require for x86 Windows 8 devices falls into the category of Secure Boot - assuming that OEMs conform to Microsoft's requirements, the user must be able to both disable Secure Boot entirely and also leave Secure Boot enabled, but with their own choice of trusted keys and binaries. If the FSF set up a signing service to sign operating systems that met all of their criteria for freeness, Microsoft's requirements would permit an end user to configure their system such that it refused to run non-free software. My system is configured to trust things shipped by Fedora or built locally by me, a decision that I can make because Microsoft require that OEMs support it. Any system that meets Microsoft's requirements is a system that respects the freedom of the computer owner to choose how restrictive their computer's boot policy is.&lt;br /&gt;&lt;br /&gt;This isn't to say that it's ideal. The lack of any common UI or key format between hardware vendors makes it difficult for OS vendors to document the steps users must take to assert this freedom. The presence of Microsoft as the only widely trusted key authority leaves people justifiably concerned as to whether Microsoft will be equally aggressive in blacklisting its own products as it will be in blacklisting third party ones. Implementation flaws in a (very) small number of systems have resulted in correctly signed operating systems failing to boot, requiring users to update their firmware before being able to install anything but Windows.&lt;br /&gt;&lt;br /&gt;But concentrating on these problems misses the wider point. The x86 market remains one where users are able to run whatever they want, but the x86 market is shrinking. Users are purchasing tablets and other ARM-based ultraportables. Some users are using phones as their primary computing device. In contrast to the x86 market, Microsoft's policies for the ARM market restrict user freedom. Windows Phone and Windows RT devices are required to boot only signed binaries, with no option for the end user to disable the signature validation or install their own keys. While the underlying technology is identical, this differing set of default policies means that Microsoft's ARM implementation is better described as Restricted Boot. The hardware vendors and Microsoft define which software will run on these systems. The owner gets no say.&lt;br /&gt;&lt;br /&gt;And, unfortunately, Microsoft aren't alone. Apple, the single biggest vendor in this market, implement effectively identical restrictions. Some Android vendors provide unlockable bootloaders, but others (either through personal preference or at the behest of phone carriers) lock down their platforms. A naive user is likely to end up purchasing a device that will, in the absence of exploited security flaws, refuse to run if any system components are modified. Even in cases where the underlying components are built using free software, there's no guarantee that the user will have the ability to assert any of those freedoms.&lt;br /&gt;&lt;br /&gt;Why does this matter? Some of these platforms (notably Windows RT and iOS, but also some Android-based devices) will even refuse to run unsigned applications. Users are unable to write their own software and distribute it to others without agreeing to often onerous restrictions. Users with the misfortune of living in the wrong country may be forbidden from even that opportunity. The vendor may choose to block applications that compete with their own, reducing innovation. The ability to explore and tinker with the components of the system is restricted, making it harder for users to learn how modern operating systems work. If I own a perfectly functional phone that no longer receives vendor updates, I don't even have the option of paying a third party to ensure that I can't be compromised by a malicious website and risk the loss of passwords or financial details. The user is directly harmed by these restrictions.&lt;br /&gt;&lt;br /&gt;I won't argue that there are no benefits to curated software ecosystems. I won't even argue against devices shipping with a locked down policy by default. I will &lt;em&gt;strongly&lt;/em&gt; argue that the owner of a device should not only have the freedom to choose whether they wish to remain within those locked-down boundaries, but should also have the freedom to impose their own boundaries. There should be no forced choice between freedom and security.&lt;br /&gt;&lt;br /&gt;Those who argue against Secure Boot risk depriving us of the freedom to make a personal decision as to who we trust. Those who argue against Secure Boot while ignoring Restricted Boot risk depriving us of even more. The traditional PC market is decreasing in importance. Unless we do anything about it, free software will be limited to a niche group of enthusiasts who've carefully chosen from a small set of devices that respect user freedom. We should have been campaigning against Restricted Boot 10 years ago. Don't delay it even further by fighting against implementations that already respect user freedom.&lt;br /&gt;&lt;br /&gt;&lt;img src="http://www.dreamwidth.org/tools/commentcount?user=mjg59&amp;ditemid=23817" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2011-02-12:696190:23554</id>
    <link rel="alternate" type="text/html" href="http://mjg59.dreamwidth.org/23554.html"/>
    <link rel="self" type="text/xml" href="http://mjg59.dreamwidth.org/data/atom/?itemid=23554"/>
    <title>Using pstore to debug awkward kernel crashes</title>
    <published>2013-03-19T18:31:24Z</published>
    <updated>2013-03-19T18:31:24Z</updated>
    <category term="fedora"/>
    <category term="advogato"/>
    <dw:security>public</dw:security>
    <dw:reply-count>5</dw:reply-count>
    <content type="html">The problem with Samsung laptops bricking themselves turned out to be down to the UEFI variable store becoming more than 50% full and Samsung's firmware being dreadful, but the trigger was us writing a crash dump to the nvram. I ended up using this feature to help someone get a backtrace from a kernel oops during suspend today, and realised that it's not been terribly well publicised, so.&lt;br /&gt;&lt;br /&gt;First, make sure pstore is mounted. If you're on 3.9 then do:&lt;br /&gt;&lt;br /&gt;mount -t pstore /sys/fs/pstore /sys/fs/pstore&lt;br /&gt;&lt;br /&gt;For earlier kernels you'll need to find somewhere else to stick it. If there's anything in there, delete it - we want to make sure there's enough space to save future dumps. Now reboot twice[1]. Next time you get a system crash that doesn't make it to system logs, mount pstore again and (with luck) there'll be a bunch of files there. For tedious reasons these need to be assembled in reverse order (part 12 comes before part 11, and so on) but you should have a crash log. Report that, delete the files again and marvel at the benefits that technology has brought to your life.&lt;br /&gt;&lt;br /&gt;[1] UEFI implementations generally handle variable deletion by flagging the space as reclaimable rather than immediately making it available again. You need to reboot in order for the firmware to garbage collect it. Some firmware seems to require two reboot cycles to do this properly. Thanks, firmware.&lt;br /&gt;&lt;br /&gt;&lt;img src="http://www.dreamwidth.org/tools/commentcount?user=mjg59&amp;ditemid=23554" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2011-02-12:696190:23400</id>
    <link rel="alternate" type="text/html" href="http://mjg59.dreamwidth.org/23400.html"/>
    <link rel="self" type="text/xml" href="http://mjg59.dreamwidth.org/data/atom/?itemid=23400"/>
    <title>Supporting third-party keys in a Secure Boot world</title>
    <published>2013-02-27T14:38:33Z</published>
    <updated>2013-02-27T14:46:55Z</updated>
    <category term="fedora"/>
    <category term="advogato"/>
    <dw:security>public</dw:security>
    <dw:reply-count>60</dw:reply-count>
    <content type="html">It's fairly straightforward to boot a UEFI Secure Boot system using something like &lt;a href="http://mjg59.dreamwidth.org/20303.html"&gt;Shim&lt;/a&gt; or the &lt;a href="http://blog.hansenpartnership.com/linux-foundation-secure-boot-system-released/"&gt;Linux Foundation's loader&lt;/a&gt;, and for distributions using either the LF loader or the generic version of Shim that's pretty much all you need to care about. The physically-present end user has had to explicitly install new keys or hashes, and that means that you no longer need to care about Microsoft's security policies or (assuming there's no exploitable flaws in the bootloader itself) fear any kind of revocation.&lt;br /&gt;&lt;br /&gt;But what about if you're a distribution that cares about booting without the user having to install keys? There's several reasons to want that (convenience for naive users, ability to netboot, that kind of thing), but it has the downside that your system can now be used as an attack vector against other operating systems. Do you care about that? It depends how you weigh the risks. First, someone would have to use your system to attack another. Second, Microsoft would have to care enough to revoke your signature. The first hasn't happened yet, so we have no real idea how likely the second is. However, it doesn't seem awfully unlikely that Microsoft would be willing to revoke a distribution signature if that distribution were being used to attack Windows.&lt;br /&gt;&lt;br /&gt;How do you avoid that scenario? There's various bits of security work you need to do, but one of them is to require that all your kernel modules be signed. That's easy for the modules in the distribution, since you just sign them all before shipping them. But how about third party modules? There's three main options here:&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Don't support third party modules on Secure Boot systems&lt;li&gt;Have the distribution sign the modules&lt;li&gt;Have the vendor sign the modules&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;The first option is easy, but not likely to please users. Or hardware vendors. Not ideal.&lt;br /&gt;&lt;br /&gt;The second option is irritating for a bunch of reasons, and a pretty significant one is license-related. If you sign a module, does that mean you're endorsing it in some way? Does signing the nvidia driver mean that you think there's no license concerns? Even ignoring that, how do you decide whose drivers to sign? We can probably assume that companies like AMD and nvidia are fairly reputable, but how about Honest John's Driver Emporium? Verifying someone's identity is astonishingly expensive to do a good job of yourself, and not hugely cheaper if you farm it out to a third party. It's also irritating for the driver vendor, who needs a separate signature for every distribution they support. So, while possible, this isn't an attractive solution.&lt;br /&gt;&lt;br /&gt;The third option pushes the responsibility out to other people, and it's always nice to get other people to do work instead of you. The problem then is deciding whose keys you trust. You can push that off to the user, but it's not the friendliest solution. The alternative is to trust any keys that are signed with a trusted key. But what is a trusted key? Having the distribution sign keys just pushes us back to option (2) - you need to verify everyone's identity, and they need a separate signing key for every distribution they support. In an ideal world, there'd be a key that we already trust and which is owned by someone willing to sign things with it.&lt;br /&gt;&lt;br /&gt;The good news is that such a key exists. The bad news is that it's owned by Microsoft.&lt;br /&gt;&lt;br /&gt;The &lt;a href="https://lkml.org/lkml/2013/2/21/196"&gt;recent discussion&lt;/a&gt; on LKML was about a patchset that allowed the kernel to install new keys if they were inside a PE/COFF binary signed by a trusted key. It's worth emphasising that this patchset doesn't change the set of keys that the kernel trusts - the kernel trusts keys that are installed in your system firmware, so if your system firmware trusts the Microsoft key then your kernel already trusts the Microsoft key. The reasoning here is pretty straightforward. If your firmware trusts things signed by Microsoft, and if a bad person can get things signed by Microsoft, the bad person can already give you a package containing a backdoored bootloader. Letting them sign kernel modules doesn't alter the power they already have over your system. Microsoft will sign PE/COFF binaries, so a vendor would just have to sign up with Microsoft, pay $99 to Symantec to get their ID verified, wrap their key in a PE/COFF binary and then get it signed by Microsoft. The kernel would see that this object was signed by a trusted key and extract and install the key.&lt;br /&gt;&lt;br /&gt;Linus is, to put it mildly, unenthusiastic about this idea. It adds some extra complexity to the kernel in the form of a binary parser that would only be used to load keys from userspace, and the kernel already has an interface for that in the form of X509 certificates. The problem we have is that Microsoft won't sign X509 certificates, and there's no way to turn a PE/COFF signature into an X509 signature. Someone would have to re-sign the keys, which starts getting us back to option (2). One way around this would be to have an automated service that accepts PE/COFF objects, verifies that they're signed by Microsoft, extracts the key, re-signs it with a new private key and spits out an X509 certificate. That avoids having to add any new code to the kernel, but it means that there would have to be someone to run that service and it means that their public key would have to be trusted by the kernel by default.&lt;br /&gt;&lt;br /&gt;Who would that third party be? The logical choice might be the Linux Foundation, but since we have members of the Linux Foundation Technical Advisory Board saying that they think &lt;a href="https://lkml.org/lkml/2013/2/25/369"&gt;module signing is unnecessary&lt;/a&gt; and that &lt;a href="https://lkml.org/lkml/2013/2/25/441"&gt;there's no real risk of revocation&lt;/a&gt;, it doesn't seem likely that they'll be enthusiastic. A distribution could do it, but there'd be arguments about putting one distribution in a more privileged position than others. So far, nobody's stood up to do this.&lt;br /&gt;&lt;br /&gt;A possible outcome is that the distributions who care about signed modules will all just carry this patchset anyway, and the ones who don't won't. That's probably going to be interpreted by many as giving too much responsibility to Microsoft, but it's worth emphasising that these patches change nothing in that respect - if your firmware trusts Microsoft, you already trust Microsoft. If your firmware doesn't trust Microsoft, these patches will not cause your kernel to trust Microsoft. If you've set up your own chain of trust instead, anything signed by Microsoft will be rejected.&lt;br /&gt;&lt;br /&gt;What's next? It wouldn't surprise me too much if nothing happens until someone demonstrates how to use a signed Linux system to attack Windows. Microsoft's response to that will probably determine whether anyone ends up caring.&lt;br /&gt;&lt;br /&gt;&lt;img src="http://www.dreamwidth.org/tools/commentcount?user=mjg59&amp;ditemid=23400" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2011-02-12:696190:23113</id>
    <link rel="alternate" type="text/html" href="http://mjg59.dreamwidth.org/23113.html"/>
    <link rel="self" type="text/xml" href="http://mjg59.dreamwidth.org/data/atom/?itemid=23113"/>
    <title>Linux Foundation Secure Boot support released - what does it mean?</title>
    <published>2013-02-10T17:16:19Z</published>
    <updated>2013-02-10T17:16:19Z</updated>
    <category term="fedora"/>
    <category term="advogato"/>
    <dw:security>public</dw:security>
    <dw:reply-count>4</dw:reply-count>
    <content type="html">The UEFI bootloader that the Linux Foundation have been working on has &lt;a href="http://blog.hansenpartnership.com/linux-foundation-secure-boot-system-released/"&gt;just been released&lt;/a&gt;. That means we now have two signed bootloaders available - this one and &lt;a href="http://mjg59.dreamwidth.org/20303.html"&gt;shim&lt;/a&gt;.&lt;br /&gt;&lt;h3&gt;Does this mean Linux distributions can now support Secure Boot?&lt;/h3&gt;They've actually been able to for a while. Ubuntu shipped with Secure Boot support last October, and Fedora shipped with Secure Boot support in January. Both used Shim rather than the Linux Foundation loader, and Shim's also being used by a variety of smaller distributions. The LF loader is a different solution to the same problem.&lt;br /&gt;&lt;h3&gt;Is the Linux Foundation the preferred loader for distributions?&lt;/h3&gt;Probably not in most cases. One of the primary functional differences between Shim and the LF loader is that the LF loader is based around cryptographic hashes rather than signing keys. This means that the user has to explicitly add a hash to the list of permitted binaries whenever a distribution updates their bootloader or kernel. Doing that involves being physically present at the machine, so it's kind of a pain.&lt;br /&gt;&lt;h3&gt;Why use it at all, then?&lt;/h3&gt;Being hash based means that you don't need to maintain any signing infrastructure. This means that distributions can support Secure Boot without having to change their build process at all. Shim already supports this use case (and some distributions are using it), but the LF loader has nicer UI for managing it.&lt;br /&gt;&lt;h3&gt;Any other reasons?&lt;/h3&gt;Actually, yes. Shim implements Secure Boot loading in a less than entirely ideal way - it duplicates the firmware's entire binary loading, validation, relocation and execution code. This is necessary because the UEFI specification doesn't provide any mechanism for adding additional authentication mechanisms. The main downside of this is that the standard UEFI LoadImage() and StartImage() calls don't work under Shim. The LF loader hooks into the low-level security architecture and installs its own handlers, which means the standard UEFI interfaces work. The upshot is that you can use bootloaders like Gummiboot or efilinux without having to modify them to call out to Shim.&lt;br /&gt;&lt;h3&gt;Why doesn't Shim do the same?&lt;/h3&gt;The UEFI architecture is slightly complicated. The UEFI specification itself defines the upper layers of the firmware, basically covering everything that UEFI applications and operating systems need. It doesn't define the lower layers of a UEFI implementation. Those are contained in the UEFI Platform Initialization spec, and that's what defines the security architecture interfaces that the LF loader hooks into. The problem is that it's completely valid to implement the UEFI specification without implementing the Platform Initialization specification, and if anyone does that then the LF loader will fail.&lt;br /&gt;&lt;h3&gt;Can't you try both approaches?&lt;/h3&gt;Yes, and that's actually pretty much the plan now. I'm working on integrating the LF loader's UI and security code into Shim with the aim of producing one loader that'll satisfy the full set of use cases, and James is &lt;a href="http://blog.hansenpartnership.com/linux-foundation-secure-boot-system-released/#comment-4152"&gt;happy with this&lt;/a&gt;.&lt;br /&gt;&lt;h3&gt;Which should I use?&lt;/h3&gt;Depends. If you want to support gummiboot (and aren't willing to patch it to call out to Shim), you'll need to use the LF loader. If you want to use key-based signing setups to avoid forcing re-enrolment on updates, you'll need to use Shim. If you're somewhere in the middle, you can probably use either. Once we've got the code merged, you won't have to make a choice.&lt;br /&gt;&lt;br /&gt;&lt;img src="http://www.dreamwidth.org/tools/commentcount?user=mjg59&amp;ditemid=23113" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2011-02-12:696190:22855</id>
    <link rel="alternate" type="text/html" href="http://mjg59.dreamwidth.org/22855.html"/>
    <link rel="self" type="text/xml" href="http://mjg59.dreamwidth.org/data/atom/?itemid=22855"/>
    <title>Samsung laptop bug is not Linux specific</title>
    <published>2013-02-09T04:00:15Z</published>
    <updated>2013-02-09T04:00:15Z</updated>
    <category term="fedora"/>
    <category term="advogato"/>
    <dw:security>public</dw:security>
    <dw:reply-count>53</dw:reply-count>
    <content type="html">I bricked a Samsung laptop today. Unlike most of the reported cases of Samsung laptops refusing to boot, I never booted Linux on it - all experimentation was performed under Windows. It seems that the bug we've been seeing is simultaneously simpler in some ways and more complicated in others than we'd previously realised.&lt;br /&gt;&lt;br /&gt;So, some background. The original belief was that the samsung-laptop driver was doing something that caused the system to stop working. This driver was coded to a Samsung specification in order to support certain laptop features that weren't accessible via any standardised mechanism. It works by searching a specific area of memory for a Samsung-specific signature. If it finds it, it follows a pointer to a table that contains various magic values that need to be written in order to trigger some system management code that actually performs the requested change. This is unusual in this day and age, but not unique. The problem is that the magic signature is still present on UEFI systems, but attempting to use the data contained in the table causes problems.&lt;br /&gt;&lt;br /&gt;We're not quite sure what those problems are yet. Originally we assumed that the magic values we wrote were causing the problem, so the samsung-laptop driver was patched to disable it on UEFI systems. Unfortunately, this doesn't actually fix the problem - it just avoids the easiest way of triggering it. It turns out that it wasn't the writes that caused the problem, it was what happened next. Performing the writes triggered a hardware error of some description. The Linux kernel caught and logged this. In the old days, people would often never see these logs - the system would then be frozen and it would be impossible to access the hard drive, so they never got written to disk. There's code in the kernel to make this easier on UEFI systems. Whenever a severe error is encountered, the kernel copies recent messages to the UEFI variable storage space. They're then available to userspace after a reboot, allowing more accurate diagnostics of what caused the crash.&lt;br /&gt;&lt;br /&gt;That crash dump takes about 10K of UEFI storage space. Microsoft require that Windows 8 systems have at least 64K of storage space available. We only keep one crash dump - if the system crashes again it'll simply overwrite the existing one rather than creating another. This is all completely compatible with the UEFI specification, and Apple actually do something very similar on their hardware. Unfortunately, it turns out that some Samsung laptops will fail to boot if too much of the variable storage space is used. We don't know what "too much" is yet, but writing a bunch of variables from Windows is enough to trigger it. I put some sample code &lt;a href="http://www.codon.org.uk/~mjg59/scratch/brick_samsung.txt"&gt;here&lt;/a&gt; - it writes out 36 variables each containing a kilobyte of random data. I ran this as an administrator under Windows and then rebooted the system. It never came back.&lt;br /&gt;&lt;br /&gt;This is pretty obviously a firmware bug. Writing UEFI variables is expressly permitted by the specification, and there should never be a situation in which an OS can fill the variable store in such a way that the firmware refuses to boot the system. We've seen similar bugs in Intel's reference code in the past, but they were all fixed early last year. For now the safest thing to do is not to use UEFI on any Samsung laptops. Unfortunately, if you're using Windows, that'll require you to reinstall it from scratch.&lt;br /&gt;&lt;br /&gt;&lt;img src="http://www.dreamwidth.org/tools/commentcount?user=mjg59&amp;ditemid=22855" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2011-02-12:696190:22736</id>
    <link rel="alternate" type="text/html" href="http://mjg59.dreamwidth.org/22736.html"/>
    <link rel="self" type="text/xml" href="http://mjg59.dreamwidth.org/data/atom/?itemid=22736"/>
    <title>The Samsung laptop issue is not fixed</title>
    <published>2013-02-07T18:41:23Z</published>
    <updated>2013-02-07T18:41:23Z</updated>
    <category term="fedora"/>
    <category term="advogato"/>
    <dw:security>public</dw:security>
    <dw:reply-count>6</dw:reply-count>
    <content type="html">The recent &lt;a href="http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commitdiff;h=e0094244e41c4d0c7ad69920681972fc45d8ce34"&gt;Linux kernel commits&lt;/a&gt; avoid one mechanism by which Samsung laptops can be bricked, but the information we now have indicates that there are other ways of triggering this. It also seems likely that it's possible for a userspace application to cause the same problem under Windows. We're still trying to figure out the full details, but until then you're safest ensuring that you're using BIOS mode on Samsung laptops no matter which operating system you're running.&lt;br /&gt;&lt;br /&gt;&lt;img src="http://www.dreamwidth.org/tools/commentcount?user=mjg59&amp;ditemid=22736" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2011-02-12:696190:22465</id>
    <link rel="alternate" type="text/html" href="http://mjg59.dreamwidth.org/22465.html"/>
    <link rel="self" type="text/xml" href="http://mjg59.dreamwidth.org/data/atom/?itemid=22465"/>
    <title>Don't like Secure Boot? Don't buy a Chromebook.</title>
    <published>2013-02-04T16:58:42Z</published>
    <updated>2013-02-06T17:47:02Z</updated>
    <category term="fedora"/>
    <category term="advogato"/>
    <dw:security>public</dw:security>
    <dw:reply-count>84</dw:reply-count>
    <content type="html">(Edit: It's been suggested that the title of this could give the wrong impression. "Don't like Secure Boot? That's not a reason to buy a Chromebook" may have been better)&lt;br /&gt;&lt;br /&gt;People are, unsurprisingly, upset that Microsoft have imposed UEFI Secure Boot on the x86 market. A situation in which one company gets to determine which software will boot on systems by default is obviously open to abuse. What's more surprising is that many of the people who are upset about this are completely fine with encouraging people to buy Chromebooks.&lt;br /&gt;&lt;br /&gt;Out of the box, Chromebooks are even more locked down than Windows 8 machines. The Chromebook firmware validates the kernel, and the kernel verifies the filesystem. Want to run a version of Chrome you've built yourself? Denied. Thankfully, Google have provided a way around this - you can (depending on the machine) either flip a physical switch or perform a special keystroke in the firmware to disable the validation. Doing so deletes all your data in the process, in order to avoid the situation where a physically present attacker wants to steal your data or backdoor your system unnoticed, but after that it'll boot any OS you want. The downside is that you've lost the security that you previously had. If a remote attacker manages to replace your kernel with a backdoored one, the firmware will boot it anyway. Want the same level of security as the stock firmware? You can't. There's no way for you to install your own signing keys, and Google won't sign third party binaries. Chromebooks are either secure and running Google's software, or insecure and running your software.&lt;br /&gt;&lt;br /&gt;Much like Chromebooks, Windows 8 certified systems are required to permit the user to disable Secure Boot. In contrast to Chromebooks, Windows 8 certified systems are required to permit the user to install their own keys. And, unlike Google, Microsoft will sign alternative operating systems. Windows 8 certified systems provide greater user freedom than Chromebooks.&lt;br /&gt;&lt;br /&gt;Some people don't like Secure Boot because they don't trust Microsoft. If you trust Google more, then a Chromebook is a reasonable choice. But some people don't like Secure Boot because they see it as an attack on user freedom, and those people should be willing to criticise Google's stance. Unlike Microsoft, Chromebooks force the user to choose between security and freedom. Nobody should be forced to make that choice.&lt;br /&gt;&lt;br /&gt;(Updated to add that some Chromebooks have a software interface for disabling validation)&lt;br /&gt;&lt;br /&gt;&lt;img src="http://www.dreamwidth.org/tools/commentcount?user=mjg59&amp;ditemid=22465" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2011-02-12:696190:22028</id>
    <link rel="alternate" type="text/html" href="http://mjg59.dreamwidth.org/22028.html"/>
    <link rel="self" type="text/xml" href="http://mjg59.dreamwidth.org/data/atom/?itemid=22028"/>
    <title>The current state of UEFI and Linux</title>
    <published>2013-02-01T05:48:37Z</published>
    <updated>2013-02-01T05:48:37Z</updated>
    <category term="fedora"/>
    <category term="advogato"/>
    <dw:security>public</dw:security>
    <dw:reply-count>39</dw:reply-count>
    <content type="html">Executive summary: Most things work fine.&lt;br /&gt;&lt;br /&gt;Things we know are broken:&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.pcworld.com/article/2026807/booting-linux-via-uefi-can-brick-some-samsung-laptops.html"&gt;Some Samsung laptops&lt;/a&gt;. The samsung-laptop driver is a slightly weird thing. By 2010 (when it first appeared) most vendors had moved over to using some level of firmware abstraction, either using ACPI or WMI. Samsung still seemed to be stuck around a decade earlier - they were providing a region of memory at a known address, and you'd read that address to find a bunch of offsets. Then you'd write magic values based on those offsets to magic system IO ports based on those offsets and something would happen. Those writes were triggering &lt;a href="http://en.wikipedia.org/wiki/System_Management_Mode"&gt;System Management Mode&lt;/a&gt;, a special x86 CPU mode where the processor executes code from memory that the OS can't see, without telling the OS that it's doing so. There's nothing especially new in this (SMM first appeared in the 386sl back in 1990), but it also means that you depend on the system vendor not changing the interface without telling you. Turns out that Samsung apparently changed their platform interface when they moved to UEFI, but didn't actually do anything to prevent old drivers from breaking things - performing exactly the same series of accesses on some modern Samsung laptops gives an uncorrectable machine check exception (in the best case) or destroys your firmware (in the worst case). Given that the driver was written to Samsung's specifications, this is pretty obviously Samsung's fault, but that's probably little consolation to anyone who ended up with a dead laptop. Although, given &lt;a href="http://forum.xda-developers.com/showthread.php?t=2048511"&gt;Samsung's track record&lt;/a&gt;, this may not be surprising.&lt;br /&gt;&lt;br /&gt;On the bright side, some of the machines that are affected by this predate Secure Boot, so at least it's not a Secure Boot bug.&lt;br /&gt;&lt;li&gt;&lt;a href="https://bugzilla.redhat.com/show_bug.cgi?id=896212"&gt;Some Toshibas won't boot Linux&lt;/a&gt;. This turns out to be some staggering incompetence on the part of Toshiba (or, more likely, their third-party vendor) - they managed to leave the signing key out of the database that's used to validate binaries, and managed to leave the signature database signing key out of the database that's used to provide whitelist or blacklist updates. The good news is that this is a blatant violation of Microsoft's Windows 8 certification guidelines, and that seems to have encouraged Toshiba to actually fix their BIOS. The bad news is that any of the affected machines that are currently available are still broken, and Toshiba don't seem to be willing to actually give you the firmware update yet.&lt;br /&gt;&lt;li&gt;&lt;a href="http://mjg59.dreamwidth.org/20187.html"&gt;Some Lenovos will only boot Windows or Red Hat Enterprise Linux&lt;/a&gt;. I recommend drinking, because as far as I know they haven't actually got around to doing anything useful about this yet.&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Not an amazingly positive list, but as far as I know that's about it - other than some Samsungs, one range of Toshibas and one range of Lenovo desktops, Linux should be fine. If you have any other UEFI system that's unable to install Fedora 18, let me know and we'll do our best to work out what's going on.&lt;br /&gt;&lt;br /&gt;&lt;img src="http://www.dreamwidth.org/tools/commentcount?user=mjg59&amp;ditemid=22028" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2011-02-12:696190:21890</id>
    <link rel="alternate" type="text/html" href="http://mjg59.dreamwidth.org/21890.html"/>
    <link rel="self" type="text/xml" href="http://mjg59.dreamwidth.org/data/atom/?itemid=21890"/>
    <title>ITWire still has problems with basic accuracy</title>
    <published>2013-01-22T21:29:24Z</published>
    <updated>2013-01-22T21:29:56Z</updated>
    <category term="fedora"/>
    <category term="advogato"/>
    <dw:security>public</dw:security>
    <dw:reply-count>9</dw:reply-count>
    <content type="html">ITWire ran a story on the 12th of January entitled "Fedora still has problems with secure boot". It ends up discussing two issues with the author's experience with the Fedora installer - that he can't reclaim any free space on existing drives, and that the installer didn't automatically add entries for Windows to the grub menu. These are certainly legitimate issues, and I don't want to suggest that it's reasonable for people to have to manually alter their configuration in order to support dual boot. But they're not issues with Fedora's support for secure boot, despite the enthusiasm with which certain people have jumped on the story. We've received one credible report of a secure boot related problem with Fedora on a couple of Toshiba laptops, which &lt;em&gt;appears&lt;/em&gt; (and I want to stress that we're still working on diagnosing it) to be a firmware bug rather than any kind of problem with Fedora.&lt;br /&gt;&lt;br /&gt;Mistakes happen in journalism, and sometimes there are differences of opinion. But this story is simply wrong. When asked about it in the comments, the author failed to support his position. When contacted, the editor in chief was willing to add a note saying that I disputed the arguments but was unwilling to remove the incorrect claims. As a result, the internet remains full of links and reposts of an article that unashamedly tells users that the current Linux distribution with the best UEFI hardware support has issues with something it has no issues with.&lt;br /&gt;&lt;br /&gt;For reasons that are unclear to me, ITWire seems to have some sort of well regarded status in the Australian technical industry. It seems entirely undeserved.&lt;br /&gt;&lt;br /&gt;&lt;img src="http://www.dreamwidth.org/tools/commentcount?user=mjg59&amp;ditemid=21890" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2011-02-12:696190:21694</id>
    <link rel="alternate" type="text/html" href="http://mjg59.dreamwidth.org/21694.html"/>
    <link rel="self" type="text/xml" href="http://mjg59.dreamwidth.org/data/atom/?itemid=21694"/>
    <title>Upcoming conferences</title>
    <published>2013-01-20T04:02:24Z</published>
    <updated>2013-01-20T14:28:55Z</updated>
    <category term="fedora"/>
    <category term="advogato"/>
    <dw:security>public</dw:security>
    <dw:reply-count>4</dw:reply-count>
    <content type="html">Unfortunately I'm not going to make it to LCA this year, but there's still plenty of UEFI coverage - Dong Wei, Vice President of the UEFI forum, will be giving an &lt;a href="http://linux.conf.au/schedule/30021/view_talk?day=None"&gt;introduction to UEFI&lt;/a&gt;, and James Bottomley, who's been working on the Linux Foundation's UEFI bootloader solution, will be talking about &lt;a href="http://linux.conf.au/schedule/30115/view_talk?day=thursday"&gt;Secure Boot&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;For those of you on this side of the Pacific (or who just can't get enough of listening to my melodious voice), I'll be keynoting the &lt;a href="http://www.socallinuxexpo.org/scale11x"&gt;Southern California Linux Expo&lt;/a&gt; next month. This will be a discussion of the more social aspects of our work on Secure Boot over the past year and a half - an epic tail of astonishment, terror, politics, confusion and hard won victories, and the remaining issues that are yet unsolved. Clearly not to be missed. If California's too far for you, then come March I'll be at the &lt;a href="http://www.northeastlinuxfest.org/"&gt;North East Linux Fest&lt;/a&gt;. I'll be talking about how to make sure that your Linux distribution works with Secure Boot, and, assuming I've got the code finished by then, a little about how to break it.&lt;br /&gt;&lt;br /&gt;&lt;img src="http://www.dreamwidth.org/tools/commentcount?user=mjg59&amp;ditemid=21694" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2011-02-12:696190:21299</id>
    <link rel="alternate" type="text/html" href="http://mjg59.dreamwidth.org/21299.html"/>
    <link rel="self" type="text/xml" href="http://mjg59.dreamwidth.org/data/atom/?itemid=21299"/>
    <title>Experiences with depression</title>
    <published>2013-01-17T15:45:50Z</published>
    <updated>2013-01-17T15:45:50Z</updated>
    <category term="fedora"/>
    <category term="advogato"/>
    <dw:security>public</dw:security>
    <dw:reply-count>19</dw:reply-count>
    <content type="html">I've been lucky in life. I've known several people who've killed
themselves, but I've been friendly with them rather than friends with them.
Their deaths have saddened me, but haven't left giant gaping holes that
I have trouble imagining filling. I've also been lucky in that I'm not
especially predisposed towards depression, and even luckier that the one
serious episode I had ended well. That luck means I'm not qualified to
speak authoritatively on the topic, but this seems like a good
time to share.
&lt;p&gt;
Most of 2002 wasn't great for me. Many of my friends had graduated and
moved away. My PhD, which was what I'd spent the past few years of my life working towards,
was going horribly wrong. The girl I liked didn't like me. Lots of individual small
things that didn't fundamentally matter, but which build up into overall
feelings of isolation and failure at life. I was spending an increasing
number of days not leaving bed and not talking to people. It wasn't that
I couldn't have fun - socialising was still pleasurable, and I didn't
actively avoid people, but it was always tempered with the knowledge
that this was temporary and I'd be returning to the unhappiness
afterwards. I couldn't see any sequence of events that would turn my
life around and restore my happiness. This was how life was, and this
was how life was going to be. I'd irrevocably fucked up, and this was
my future.
&lt;p&gt;
Looking back, what strikes me is how reasonable this seemed. I could
point at specific things that were making me unhappy, and nobody could
argue that it was unreasonable to be unhappy about them. There wasn't any
point in speaking to people about it, because what would they be able to
do except agree that I was justifiably unhappy? I thought about suicide.
Not seriously, because overall life still seemed worthwhile, but I could
conceive of a level of further unhappiness that would make it seem like
the best choice. I don't think it would ever have occured to me to speak
to someone about it first. It seemed like it would be the same argument
- I'm justifiably unhappy, I already feel like I'm letting my friends
down, what could they do other than tell me that my feelings are wrong
or make me feel even more guilty? So, when I saw exhortions for people
to speak to someone if they felt suicidal, it seemed like they were
talking to people who hadn't thought this through as well as me. It felt
like I'd thought this all through carefully and rationally and come to a
completely logical decision. If changes in circumstances and further
consideration made it seem like suicide was the better choice, that
would be because it was the better choice. Maybe other people weren't
thinking about this as logically as I was. Maybe they'd have their minds
changed by speaking to a friend or a professional. I wouldn't. Of course, with hindsight I was rationalising the way I already felt rather than making entirely rational decisions. I could have rationalised myself to death even though there were (in my case) straightforward ways to make my life better.
&lt;p&gt;
In any case, I've no idea how close I ever got to that point. Things
were at their worst in August - by September I had a new job and new
house, and things just got better from there. In the end, the friends I
was convinced could do nothing for me ended up giving me the opportunity
to find gainful employment and made sure I had somewhere to live.
Without them, things might have been different. As it was, I spent less
than nine months depressed and it was still the most hellish experience
of my life. The thought of returning to that state is terrifying. I was
lucky. I might not be again.
&lt;p&gt;
There's no terribly good moral here. If I'd known more about depression
beforehand, I might have been able to identify what was happening to me
and seek professional help. Other than that, I didn't learn anything
about how to avoid or deal with depression. The experience didn't make
me a better person. I've no advice for people in the same situation. The
only thing I gained from it all was the realisation that if I'd
felt any worse and knew that this was what I faced for the rest of my
life, death might not have been the worst choice I had.
&lt;p&gt;
Depression is a huge social problem and we deal with it badly. We refuse
to talk about it, and when we do talk about it we mostly limit ourselves
to platitudes about how things will get better or placing the blame on
depressed people for not wanting to talk to those around them. Sometimes
it doesn't get better. Sometimes talking to those around you will make
things worse. People need to be aware of what the effects of depression
are and get better at identifying it in others, rather than assuming
that they'll be able to ask for help themselves. Society as a whole
needs to be better at ensuring that professional support is there for
people who need it. And, unless we can make massive improvements in our
understanding of the causes of depression and effective mechanisms for
countering it, we need to accept that it will cost us friends. Let's
redirect the anger we feel at their choice to avoid a lifetime of misery
into anger at the society that still hasn't done everything it can to
help them.&lt;br /&gt;&lt;br /&gt;&lt;img src="http://www.dreamwidth.org/tools/commentcount?user=mjg59&amp;ditemid=21299" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2011-02-12:696190:21189</id>
    <link rel="alternate" type="text/html" href="http://mjg59.dreamwidth.org/21189.html"/>
    <link rel="self" type="text/xml" href="http://mjg59.dreamwidth.org/data/atom/?itemid=21189"/>
    <title>No, Linux won't be easy to run on a Microsoft Surface</title>
    <published>2012-12-29T18:39:43Z</published>
    <updated>2012-12-29T18:39:43Z</updated>
    <category term="fedora"/>
    <category term="advogato"/>
    <dw:security>public</dw:security>
    <dw:reply-count>18</dw:reply-count>
    <content type="html">The Microsoft Surface is a fairly attractive bit of tablet hardware, and as a result people have shown interest in running Linux on it. The immediate problem is that (like many ARM devices) it has a locked-down firmware that will only run signed binaries - unlike many other ARM devices, this is implemented using an existing standard (UEFI Secure Boot). Microsoft provide a signing service for UEFI binaries, so it's tempting to think that getting around this restriction would be as simple as taking an existing Linux bootloader, signing it and then booting. Unfortunately Microsoft's signing service signs binaries using a different key (the "Microsoft Windows UEFI Driver Publisher" key) to the one used to sign Windows, and the Surface doesn't carry that key. Booting Linux on these devices would involve finding a flaw in the firmware and using that to run arbitrary code.&lt;br /&gt;&lt;br /&gt;Could this also be a problem on x86? In theory - Microsoft don't require that vendors carry the driver publisher key, and so a system could be Windows 8 certified and still not carry it. It's unlikely to occur in practice, though, since any third party expansion hardware will then fail on that device. As a result, anything with PCIe or Expresscard slots is effectively certain to have this key. If anyone finds any counterexamples, please let me know.&lt;br /&gt;&lt;br /&gt;&lt;img src="http://www.dreamwidth.org/tools/commentcount?user=mjg59&amp;ditemid=21189" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2011-02-12:696190:20916</id>
    <link rel="alternate" type="text/html" href="http://mjg59.dreamwidth.org/20916.html"/>
    <link rel="self" type="text/xml" href="http://mjg59.dreamwidth.org/data/atom/?itemid=20916"/>
    <title>Booting signed versions of Linux on Windows 8 machines</title>
    <published>2012-12-28T00:54:35Z</published>
    <updated>2012-12-28T00:54:35Z</updated>
    <category term="fedora"/>
    <category term="advogato"/>
    <dw:security>public</dw:security>
    <dw:reply-count>16</dw:reply-count>
    <content type="html">Some people have complained that they can't install Linux on new machines because their firmware won't let them choose a boot device. This is part of Windows 8's fast boot support - the keyboard may not be initialised until after the OS has started. To deal with this, insert the install media and reboot your computer. Wait for Windows 8 to start. While holding down shift, click on the power icon and click on restart. When the menu appears, click "Use a device" and then click your install media. If it's listed more than once, choose the one that says "UEFI" in front of it. Your system will now restart and boot off the install media.&lt;br /&gt;&lt;br /&gt;&lt;img src="http://www.dreamwidth.org/tools/commentcount?user=mjg59&amp;ditemid=20916" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2011-02-12:696190:20522</id>
    <link rel="alternate" type="text/html" href="http://mjg59.dreamwidth.org/20522.html"/>
    <link rel="self" type="text/xml" href="http://mjg59.dreamwidth.org/data/atom/?itemid=20522"/>
    <title>Secure Boot distribution support</title>
    <published>2012-12-28T00:52:48Z</published>
    <updated>2012-12-28T00:52:48Z</updated>
    <category term="fedora"/>
    <category term="advogato"/>
    <dw:security>public</dw:security>
    <dw:reply-count>38</dw:reply-count>
    <content type="html">It's after Christmas, and some number of people doubtless ended up with Windows 8 PCs and may want to install Linux on them. If you'd like to do that without fiddling with firmware settings, here are your options.&lt;ul&gt;&lt;li&gt;Ubuntu 12.10&lt;br /&gt;The 64-bit version of Ubuntu 12.10 ships with an older version of Shim that's been signed by Microsoft. It should boot out of the box on most systems, but it doesn't have some of the most recent EFI patches that improve compatibility on some machines. Grab it &lt;a href="http://www.ubuntu.com/download/desktop/questions?distro=desktop&amp;amp;bits=64&amp;amp;release=latest"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;li&gt;Fedora 18&lt;br /&gt;Fedora 18 isn't quite released yet, but the latest 64-bit test builds include a Microsoft signed copy of the current version of Shim, including the MOK functionality described &lt;a href="https://www.suse.com/blogs/uefi-secure-boot-details/"&gt;here&lt;/a&gt;. Fedora 18 has some additional EFI support patches that have just been merged into mainline, which should improve compatibility on some machines - especially ones with Radeon graphics. It also has improved support for booting on Macs. You can get it &lt;a href="https://alt.fedoraproject.org/pub/alt/stage/18-TC3/"&gt;here&lt;/a&gt;, but do bear in mind that it's a test release.&lt;br /&gt;&lt;li&gt;Sabayon&lt;br /&gt;According to &lt;a href="http://wiki.sabayon.org/index.php?title=UEFI_Boot"&gt;the wiki&lt;/a&gt;, Sabayon now supports UEFI Secure Boot out of the box. I don't know if the current CD images do, though. My understanding is that it's based on the Microsoft signed Shim I discussed &lt;a href="http://mjg59.dreamwidth.org/20303.html"&gt;here&lt;/a&gt;, and you'll have to manually install the key once you've booted the install media. Straightforward enough.&lt;br /&gt;&lt;li&gt;Other distributions&lt;br /&gt;Suse will be using a version of Shim signed by Microsoft, but I don't think it's in any pre-release versions yet. Debian have just merged UEFI support into their installer, but don't have any UEFI Secure Boot support at the moment. I'm not sure what other distributions are planning on doing, but let me know and I'll update the list.&lt;br /&gt;&lt;li&gt;The Linux Foundation loader&lt;br /&gt;The Linux Foundation have still to obtain a signed copy of their bootloader. There's no especially compelling reason to use it - the use case it supports is where you have users who can follow instructions sufficiently to press "y" but not to choose to enrol a key. The most interesting feature it has is the ability to use the MOK database via the usual UEFI LoadImage and StartImage calls, which means bootloaders like gummiboot work. Unfortunately it implements this by hooking into low-level functionality that's not actually required to be present, so relying on this may be somewhat dubious.&lt;br /&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="http://www.dreamwidth.org/tools/commentcount?user=mjg59&amp;ditemid=20522" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2011-02-12:696190:20303</id>
    <link rel="alternate" type="text/html" href="http://mjg59.dreamwidth.org/20303.html"/>
    <link rel="self" type="text/xml" href="http://mjg59.dreamwidth.org/data/atom/?itemid=20303"/>
    <title>Secure Boot bootloader for distributions available now</title>
    <published>2012-12-01T01:43:10Z</published>
    <updated>2012-12-01T01:43:10Z</updated>
    <category term="fedora"/>
    <category term="advogato"/>
    <dw:security>public</dw:security>
    <dw:reply-count>113</dw:reply-count>
    <content type="html">I'm pleased to say that a usable version of shim is now available for &lt;a href="http://www.codon.org.uk/~mjg59/shim-signed/"&gt;download&lt;/a&gt;. As I discussed &lt;a href="http://mjg59.dreamwidth.org/17542.html"&gt;here&lt;/a&gt;, this is intended for distributions that want to support secure boot but don't want to deal with Microsoft. To use it, rename shim.efi to bootx64.efi and put it in /EFI/BOOT on your UEFI install media. Drop MokManager.efi in there as well. Finally, make sure your bootloader binary is called grubx64.efi and put it in the same directory.&lt;br /&gt;&lt;br /&gt;Now generate a certificate and put the public half as a binary DER file somewhere on your install media. On boot, the end-user will be prompted with a 10-second countdown and a menu. Choose "Enroll key from disk" and then browse the filesystem to select the key and follow the enrolment prompts. Any bootloader signed with that key will then be trusted by shim, so you probably want to make sure that your grubx64.efi image is signed with it.&lt;br /&gt;&lt;br /&gt;If you want, you're then free to impose any level of additional signing restrictions - it's entirely possible to use this signing as the basis of a complete chain of trust, including kernel lockdowns and signed module loading. However, since the end-user has explicitly indicated that they trust your code, you're under no obligation to do so. You &lt;em&gt;should&lt;/em&gt; make it clear to your users what level of trust they'll be able to place in their system after installing your key, if only to allow them to make an informed decision about whether they want to or not.&lt;br /&gt;&lt;br /&gt;This binary does not contain any built-in distribution certificates. It does contain a certificate that was generated at build time and used to sign MokManager - you'll need to accept my assurance that the private key was deleted immediately after the build was completed. Other than that, it will only trust any keys that are either present in the system db or installed by the end user.&lt;br /&gt;&lt;br /&gt;A couple of final notes: As of 17:00 EST today, I am officially (rather than merely effectively) no longer employed by Red Hat, and this binary is being provided by me rather than them, so don't ask them questions about it. Special thanks to everyone at Suse who came up with the MOK concept and did most of the implementation work - without them, this would have been impossible. Thanks also to Peter Jones for his work on debugging and writing a signing tool, and everyone else at Red Hat who contributed valuable review feedback.&lt;br /&gt;&lt;br /&gt;&lt;img src="http://www.dreamwidth.org/tools/commentcount?user=mjg59&amp;ditemid=20303" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2011-02-12:696190:20187</id>
    <link rel="alternate" type="text/html" href="http://mjg59.dreamwidth.org/20187.html"/>
    <link rel="self" type="text/xml" href="http://mjg59.dreamwidth.org/data/atom/?itemid=20187"/>
    <title>More in the series of bizarre UEFI bugs</title>
    <published>2012-11-15T05:12:22Z</published>
    <updated>2012-11-15T05:12:22Z</updated>
    <category term="fedora"/>
    <category term="advogato"/>
    <dw:security>public</dw:security>
    <dw:reply-count>55</dw:reply-count>
    <content type="html">A (well, now former) coworker let me know about a problem he was having with a Lenovo Thinkcentre M92p. It booted Fedora UEFI install media fine, but after an apparently successful installation refused to boot. UEFI installs on Windows worked perfectly. Secure Boot was quickly ruled out, but this could still have been a number of things. The most interesting observation was that the Fedora boot option didn't appear in the firmware boot menu at all, but Windows did. We spent a little while comparing the variable contents, gradually ruling out potential issues - Linux was writing an entry that had an extra 6 bytes in a structure, for instance[1], and a sufficiently paranoid firmware implementation may have been tripping up on that. Fixing that didn't help, though. Finally we tried just taking the Windows entry and changing the descriptive string. And it broke.&lt;br /&gt;&lt;br /&gt;Every UEFI boot entry has a descriptive string. This is used by the firmware when it's presenting a menu to users - instead of "Hard drive 0" and "USB drive 3", the firmware can list "Windows Boot Manager" and "Fedora Linux". There's no reason at all for the firmware to be parsing these strings. But the evidence seemed pretty strong - given two identical boot entries, one saying "Windows Boot Manager" and one not, only the first would work. At this point I downloaded a copy of the firmware and started poking at it. Turns out that yes, actually, there is a function that compares the descriptive string against "Windows Boot Manager" and appears to return an error if it doesn't match. What's stranger is that it also checks for "Red Hat Enterprise Linux" and lets that one work as well.&lt;br /&gt;&lt;br /&gt;This is, obviously, bizarre. A vendor appears to have actually written additional code to check whether an OS claims to be Windows before it'll let it boot. Someone then presumably tested booting RHEL on it and discovered that it didn't work. Rather than take out that check, they then addded another check to let RHEL boot as well. We haven't yet verified whether this is an absolute string match or whether a prefix of "Red Hat Enterprise Linux" is sufficient, and further examination of the code may reveal further workarounds. For now, if you want to run Fedora[2] on these systems you're probably best off changing the firmware to perform a legacy boot.&lt;br /&gt;&lt;br /&gt;[1] &lt;tt&gt;src/include/efi.h:	uint8_t  padding[6]; /* Emperically needed */&lt;/tt&gt;, says the efibootmgr source code. Unhelpful.&lt;br /&gt;[2] Or Ubuntu, or Suse, or…&lt;br /&gt;&lt;br /&gt;&lt;img src="http://www.dreamwidth.org/tools/commentcount?user=mjg59&amp;ditemid=20187" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2011-02-12:696190:19880</id>
    <link rel="alternate" type="text/html" href="http://mjg59.dreamwidth.org/19880.html"/>
    <link rel="self" type="text/xml" href="http://mjg59.dreamwidth.org/data/atom/?itemid=19880"/>
    <title>VMware are as bad as Microsoft</title>
    <published>2012-11-13T05:46:52Z</published>
    <updated>2012-11-13T14:12:47Z</updated>
    <category term="fedora"/>
    <category term="advogato"/>
    <dw:security>public</dw:security>
    <dw:reply-count>55</dw:reply-count>
    <content type="html">Everything &lt;a href="http://mjg59.dreamwidth.org/14955.html?thread=618603"&gt;here&lt;/a&gt; applies to &lt;a href="http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob;f=drivers/net/vmxnet3/vmxnet3_defs.h;h=4d84912c99bae05f19eec5abf04632e077c1cc4f;hb=HEAD#l395"&gt;this&lt;/a&gt; as well. Thanks, VMware. In Microsoft's case it turned out that nothing was using that value and it could be replaced without breaking things. With luck that's true here as well.&lt;br /&gt;&lt;br /&gt;&lt;img src="http://www.dreamwidth.org/tools/commentcount?user=mjg59&amp;ditemid=19880" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2011-02-12:696190:19695</id>
    <link rel="alternate" type="text/html" href="http://mjg59.dreamwidth.org/19695.html"/>
    <link rel="self" type="text/xml" href="http://mjg59.dreamwidth.org/data/atom/?itemid=19695"/>
    <title>Last day at Red Hat</title>
    <published>2012-11-09T17:02:04Z</published>
    <updated>2012-11-09T17:02:04Z</updated>
    <category term="fedora"/>
    <category term="advogato"/>
    <dw:security>public</dw:security>
    <dw:reply-count>19</dw:reply-count>
    <content type="html">After four and a half years at Red Hat, I'm about to take the three weeks of holiday I've built up and am then  heading off to &lt;a href="http://www.nebula.com"&gt;Nebula&lt;/a&gt; at the beginning of December. I'm still planning on being active in UEFI and Secure Boot development, and don't expect anything to change in terms of my Fedora involvement. It's been a fun time here, so just imagine that I'm writing something about exciting future challenges while I go back to saying goodbye to people.&lt;br /&gt;&lt;br /&gt;&lt;img src="http://www.dreamwidth.org/tools/commentcount?user=mjg59&amp;ditemid=19695" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2011-02-12:696190:19448</id>
    <link rel="alternate" type="text/html" href="http://mjg59.dreamwidth.org/19448.html"/>
    <link rel="self" type="text/xml" href="http://mjg59.dreamwidth.org/data/atom/?itemid=19448"/>
    <title>A detailed technical description of Shim</title>
    <published>2012-10-30T19:55:18Z</published>
    <updated>2012-10-30T19:55:18Z</updated>
    <category term="fedora"/>
    <category term="advogato"/>
    <dw:security>public</dw:security>
    <dw:reply-count>20</dw:reply-count>
    <content type="html">Shim is the first stage bootloader we've been implementing for supporting Secure Boot. It's called Shim because it serves as an object to fit the gap between the Microsoft trust root and our own trust root. As originally envisaged it would do nothing other than load and execute appropriately signed binaries, but it's got a little more complicated than that now. It is, however, basically feature complete at this point - I don't expect it to grow significantly further.&lt;br /&gt;&lt;br /&gt;(For those of you following along at home, the Shim source code I'm talking about is &lt;a href="https://github.com/mjg59/shim/tree/mok"&gt;here&lt;/a&gt;)&lt;br /&gt;&lt;br /&gt;First, it checks whether the user has disabled local signature verification in check_mok_sb(). This is done by reading the MokSBState UEFI variable and verifying that it has the correct variable attributes, ensuring that it was created in the trusted boot services environment. If so, and if it's set appropriately, signature verification is disabled for the rest of Shim. Shim then pauses for a couple of seconds while displaying a message indicating that it's running in insecure mode.&lt;br /&gt;&lt;br /&gt;Next, Shim checks whether the user has set any variables that indicate that a Mok request has been made in check_mok_request(). If so, it launches MokManager. The mechanism by which this is done is described later.&lt;br /&gt;&lt;br /&gt;Shim then copies the Mok key database into a runtime variable, which makes it accessible to the kernel (mirror_mok_list()). The kernel can then use the Mok keys when performing module signature verification. Next, as the last step before launching the next stage bootloader, Shim installs a UEFI protocol that permits other applications to call back into Shim. We're now ready to branch off from Shim into the actual bootloader.&lt;br /&gt;&lt;br /&gt;To do this, Shim has to do a few things. First, we need to get the bootloader off disk. This involves finding Shim's path, which we can do by opening the loaded image protocol on Shim's image handle, turning that into a string, walking backwards along it until we find a directory separator, stripping the filename and appending the path to the second stage bootloader. This is then turned back into a binary device path, all of this happening in generate_path(). The binary is then read off disk in load_image(), using the simple filesystem protocol. We open the device, open a reference to the file, check how large the file is, allocate a buffer to hold the file and then read it off disk into that buffer. Everything so far has been fairly straightforward, but now things get more complicated.&lt;br /&gt;&lt;br /&gt;handle_image() is the real meat of Shim. First it has to examine the header data in read_header(), copying the relevant bits into a context structure that will be used later. Some basic sanity checks on the binary are also performed here. If we're running in secure mode (ie, Secure Boot is enabled and we haven't been toggled into insecure mode) we then need to verify that the binary matches the signature and hasn't been blacklisted.&lt;br /&gt;&lt;br /&gt;verify_buffer() has to implement the Microsoft Authenticode specification, which details which sections of the binary have to be hashed and in which order. The actual hashing is done in generate_hash(), which calls into the crypto code to add each binary section to the hashed data. The comments in generate_hash() describe what's going on there clearly enough. The crypto code itself is a copy of the crypto library extracted from the Tiano source tree. It's a relatively thin layer on top of OpenSSL, so the code's been fairly well tested.&lt;br /&gt;&lt;br /&gt;Once we have the hash, we need to verify the signature. First, we ensure that the Mok database hasn't been modified from the OS (verify_mok()). Next, we check whether the binary's hash or signature have been blacklisted (check_blacklist()). This is done for each of the SHA1 and SHA256 hashes of the binary (the two hashes implemented in Tiano) and the certificate. If any of these match an entry in the dbx variable or a built-in blacklist, Shim will refuse to run them. Next, we simply do the same for the whitelist. If the binary's hash is either in the db variable or the Mok list, or if it's signed with a certificate that chains back to an entry in either db or the Mok list, we'll run it. Finally, the signature is checked against any built-in keys. Certificate verification is carried out with the AuthenticodeVerify() function, which again comes from Tiano's crypto library and is mostly implemented in OpenSSL.&lt;br /&gt;&lt;br /&gt;If the binary passed signature validation we return to handle_image() and now load the binary's sections into their desired addresses. That buffer is handed to relocate_coff() which runs through the binary's relocation entries and fixes them up. There's one last subtlety, which is that because we've been fixing this up by hand, the image handle still refers to the shim binary. We fix the ImageBase and ImageSize values in the loaded image protocol to match the newly relocated binary, which is vital because otherwise grub is unable to find its built in modules. Finally, we jump into the binary's entry point. What the binary does next is up to it - if it's a bootloader, there's a good chance that it'll simply launch an OS and we'll never return. If it does return, we restore ImageBase and ImageSize, uninstall the protocol we installed and exit ourselves. If Shim exits (either because the second stage bootloader wasn't present, didn't verify, or exited) then control will simply pass on to the next boot option in the UEFI priority list. If there's nothing else, the platform will do something platform defined.&lt;br /&gt;&lt;br /&gt;And that's how Shim works.&lt;br /&gt;&lt;br /&gt;&lt;img src="http://www.dreamwidth.org/tools/commentcount?user=mjg59&amp;ditemid=19448" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2011-02-12:696190:18945</id>
    <link rel="alternate" type="text/html" href="http://mjg59.dreamwidth.org/18945.html"/>
    <link rel="self" type="text/xml" href="http://mjg59.dreamwidth.org/data/atom/?itemid=18945"/>
    <title>An overview of our Secure Boot implementation</title>
    <published>2012-10-30T19:08:59Z</published>
    <updated>2012-10-30T19:08:59Z</updated>
    <category term="fedora"/>
    <category term="advogato"/>
    <dw:security>public</dw:security>
    <dw:reply-count>20</dw:reply-count>
    <content type="html">I've written rather a lot about how we're implementing our Secure Boot support, but there's been a range of subtle changes over time. Here's an overview of how it all fits together.&lt;h2&gt;Secure Boot and signing&lt;/h2&gt;Secure Boot is part of the UEFI specification. When enabled, systems will refuse to boot any UEFI executables (such as an OS bootloader) unless they've been signed by a trusted key. The only trusted key effectively guaranteed to be present is Microsoft's, and Microsoft will sign binaries if you have access to the Windows hardware dev center. You gain access to this by purchasing a certificate from Verisign that verifies your identity and then use that to create a developer account at the &lt;a href="http://sysdev.microsoft.com"&gt;Sysdev website&lt;/a&gt;. Once you've agreed to the legal contracts, you can submit a UEFI executable and Microsoft will then send you back a signed one. The signature is added to the end of the binary, so it's trivial to verify that your executable hasn't otherwise been modified in the process.&lt;br /&gt;&lt;h2&gt;Avoiding signing round trips&lt;/h2&gt;We didn't want to have to get binaries re-signed every time we updated our bootloader or kernel, so we came up with a compromise approach. We implemented a shim bootloader (cunningly called "Shim") which is signed by Microsoft and includes a copy of a public key that's under our control. Shim will launch any binary signed with either a key installed in the system firmware or the public key built into it. This allows us to build and sign all other binaries ourselves.&lt;br /&gt;&lt;h2&gt;Preventing Secure Boot circumvention&lt;/h2&gt;Secure Boot is intended to prevent scenarios where untrusted code can be run before an OS kernel. Locking down the boot environment avoids the simple case of using a modified bootloader, and requiring that the kernel also be signed avoids simply booting arbitrary attack code that looks roughly like a kernel but does nothing to prevent the more complex case of using a running kernel to launch another kernel. To do that we've had to restrict the behaviour of the kernel in Secure Boot environments. Direct hardware access from userspace has been blocked, and modules must be signed by a key the kernel trusts.&lt;br /&gt;&lt;h2&gt;Providing user control over trust&lt;/h2&gt;Microsoft requires that it be possible to modify the key database on all Windows-certified x86 systems, but the UI to do so may be inconsistent and awkward. Suse developed a plan to avoid this, involving adding an additional key database to the system. The user enrols a key from the running OS and enters a password. On the next reboot, shim detects that a key is awaiting enrolment and drops to a prompt. If the user does nothing or just hits enter, the system continues to boot. If the user chooses to enrol a new key, the user is asked to re-enter the password in order to confirm that they're the same user that initiated the original request. If successful, the key is then copied into a boot services variable which cannot be directly modified from the OS. Anything signed with the user's key will then be trusted.&lt;br /&gt;&lt;h2&gt;Providing user control over signature verification&lt;/h2&gt;Some users (such as kernel developers) may be hampered by Secure Boot - forcing them to sign every new kernel they build is time consuming and unhelpful. Windows-certified x86 hardware will be required to provide an option to disable Secure Boot, but again that UI may be inconsistent. We've added an option where a user can generate a request to disable signature validation, again requiring a password. On next boot the user must explicitly choose the "Toggle signature validation" menu item and will then be requested to enter three randomly chosen characters from their password. After confirmation, signature validation in Shim will then be disabled.&lt;br /&gt;&lt;h2&gt;Supporting other distributions&lt;/h2&gt;Not all distributions will want (or be able) to sign via Microsoft. They'll be able to take any other signed version of Shim and put it on their boot media. If their second stage bootloader is signed by a key that Shim doesn't trust, Shim will pop up a menu permitting the user to choose to enrol a new key off the install media. The user can select this, navigate a file browser and select the key. After confirmation, the key will be added to Shim's trusted key list. The user can then install the distribution.&lt;br /&gt;&lt;h2&gt;Third party modules&lt;/h2&gt;There's two approaches here. The first is for the third party to provide a module key that the user can install into Shim's database. The kernel will import this at boot time and trust any modules signed with it. The second is for the third party to provide a key signed by Microsoft. David Howells has come up with with the idea of utilising &lt;a href="http://blog.uncooperative.org/blog/2012/06/25/another-benefit-of-secure-boot/"&gt;this&lt;/a&gt; approach of embedding a public key in a pe binary, with the kernel then having support for importing this key, noticing that it's signed by a trusted key and adding it to the kernel keyring.&lt;br /&gt;&lt;h2&gt;How about ARM?&lt;/h2&gt;We're not planning on supporting Secure Boot on ARM, for two reasons. The first is that Microsoft require that it be impossible to disable Secure Boot on ARM, and we don't want to support systems unless it's guaranteed that the user will be able to run what they want. The second is that there's no strong expectation that the signing key used for signing third party UEFI binaries will be present on ARM systems.&lt;br /&gt;&lt;h2&gt;What are other distributions doing?&lt;/h2&gt;As far as I know, Suse and Fedora will be shipping the same code. Ubuntu is shipping an older version of Shim but should pick up the local key management code in the next release. The only significant difference is that Ubuntu doesn't require that kernel modules be signed.&lt;br /&gt;&lt;br /&gt;&lt;img src="http://www.dreamwidth.org/tools/commentcount?user=mjg59&amp;ditemid=18945" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2011-02-12:696190:18773</id>
    <link rel="alternate" type="text/html" href="http://mjg59.dreamwidth.org/18773.html"/>
    <link rel="self" type="text/xml" href="http://mjg59.dreamwidth.org/data/atom/?itemid=18773"/>
    <title>Getting started with UEFI development</title>
    <published>2012-10-30T15:34:47Z</published>
    <updated>2012-10-30T15:34:47Z</updated>
    <category term="fedora"/>
    <category term="advogato"/>
    <dw:security>public</dw:security>
    <dw:reply-count>23</dw:reply-count>
    <content type="html">It's not difficult to write a UEFI application under Linux. You'll need three things:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;An installed copy of the gnu-efi library and headers&lt;br /&gt;&lt;li&gt;A copy of the UEFI specification from &lt;a href="http://www.uefi.org/specs/agreement"&gt;here&lt;/a&gt;&lt;br /&gt;&lt;li&gt;Something running UEFI (&lt;a href="http://sourceforge.net/apps/mediawiki/tianocore/index.php?title=OVMF"&gt;OVMF&lt;/a&gt; is a good option if you don't have any UEFI hardware)&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;So, let's write a trivial UEFI application. Here's one from the gnu-efi source tree:&lt;br /&gt;&lt;pre&gt;#include &amp;lt;efi.h&amp;gt;
#include &amp;lt;efilib.h&amp;gt;

EFI_STATUS
efi_main (EFI_HANDLE image, EFI_SYSTEM_TABLE *systab)
{
        SIMPLE_TEXT_OUTPUT_INTERFACE *conout;

        conout = systab-&amp;gt;ConOut;
        InitializeLib(image, systab);
        uefi_call_wrapper(conout-&amp;gt;OutputString, 2, conout, L"Hello World!\n\r");

        return EFI_SUCCESS;
}&lt;/pre&gt;The includes are fairly obvious. efi.h gives you UEFI functions defined by the specification, and efilib.h gives you functions provided by gnu-efi. The runtime will call efi_main() rather than main(), so that's our main function. It returns an EFI_STATUS which will in turn be returned to whatever executed the binary. The EFI_HANDLE image is a pointer to the firmware's context for this application, which is used in certain calls. The EFI_SYSTEM_TABLE *systab is a pointer to the UEFI system table, which in turn points to various other tables.&lt;br /&gt;&lt;br /&gt;So far so simple. Now things get interesting. The heart of the UEFI programming model is a set of protocols that provide interfaces. Each of these interfaces is typically a table of function pointers. In this case, we're going to use the simple text protocol to print some text. First, we get a pointer to the simple text output table. This is always referenced from the system table, so we can simply assign it. InitializeLib() just initialises some internal gnu-efi functions - it's not technically required if we're purely calling native UEFI functions as we are here, but it's good style since forgetting it results in weird crashes.&lt;br /&gt;&lt;br /&gt;Anyway. We now have conout, a pointer to a SIMPLE_TEXT_OUTPUT_INTERFACE structure. This is described in section 11.4 of the UEFI spec, but looks like this:&lt;pre&gt;typedef struct _EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL {
    EFI_TEXT_RESET Reset;
    EFI_TEXT_STRING OutputString;
    EFI_TEXT_TEST_STRING TestString;
    EFI_TEXT_QUERY_MODE QueryMode;
    EFI_TEXT_SET_MODE SetMode;
    EFI_TEXT_SET_ATTRIBUTE SetAttribute;
    EFI_TEXT_CLEAR_SCREEN ClearScreen;
    EFI_TEXT_SET_CURSOR_POSITION SetCursorPosition;
    EFI_TEXT_ENABLE_CURSOR EnableCursor;
    SIMPLE_TEXT_OUTPUT_MODE *Mode;
} EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL;
&lt;/pre&gt;The majority of these are functions - the only exception is the SIMPLE_TEXT_OUTPUT_MODE pointer, which points to the current mode. In an ideal world you'd be able to just call these directly, but sadly UEFI and Linux calling conventions are different and we need some thunking. That's where the uefi_call_function() call comes in. This takes a UEFI function as its first argument (in this case, conout-&amp;gt;OutputString), the number of arguments (2, in this case) and then the arguments. Checking the spec for OutputString, we see this:&lt;pre&gt;typedef
EFI_STATUS
(EFIAPI *EFI_TEXT_STRING) (
    IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
    IN CHAR16 *String
);&lt;/pre&gt;The first argument is a pointer to the specific instance of the simple text output protocol. This permits multiple instances of the same protocol to exist on a single machine, without having to duplicate all of the code. The second argument is simply a UCS-2 string. Our conout pointer is a pointer to the protocol, so we pass that as the first argument. For the second argument, we pass L"Hello World!\n", with the L indicating that this is a wide string rather than a simple 8-bit string. uefi_call_function() then rearranges these arguments into the appropriate calling convention and calls the UEFI function. The firmware then prints "Hello World!" on the screen. Success.&lt;br /&gt;&lt;br /&gt;(Warning: uefi_call_function() does no type checking on its arguments, so if you pass in a struct instead of a pointer it'll build without complaint and then give you a bizarre error at runtime)&lt;br /&gt;&lt;br /&gt;Finally, we clean up by simply returning EFI_SUCCESS. Nothing more for us to worry about. That's the simple case. What about a more complicated one? Let's do something with that EFI_HANDLE that got passed into efi_main().&lt;br /&gt;&lt;pre&gt;#include &amp;lt;efi.h&amp;gt;
#include &amp;lt;efilib.h&amp;gt;

EFI_STATUS
efi_main (EFI_HANDLE image, EFI_SYSTEM_TABLE *systab)
{
        EFI_LOADED_IMAGE *loaded_image = NULL;
        EFI_GUID loaded_image_protocol = LOADED_IMAGE_PROTOCOL;
        EFI_STATUS status;

        InitializeLib(image, systab);
        status = uefi_call_wrapper(systab-&amp;gt;BootServices-&amp;gt;HandleProtocol,
                                3,
                                image, 
                                &amp;loaded_image_protocol, 
                                (void **) &amp;loaded_image);
        if (EFI_ERROR(status)) {
                Print(L"handleprotocol: %r\n", status);
        }

        Print(L"Image base        : %lx\n", loaded_image-&amp;gt;ImageBase);
        Print(L"Image size        : %lx\n", loaded_image-&amp;gt;ImageSize);
        Print(L"Image file        : %s\n", DevicePathToStr(loaded_image-&amp;gt;FilePath));
        return EFI_SUCCESS;
}&lt;/pre&gt;UEFI handles can have multiple protocols attached to them. A handle may represent a piece of physical hardware, or (as in this case) it can represent a software object. In this case we're going to get a pointer to the loaded image protocol that's associated with the binary we're running. To do this we call the HandleProtocol() function from the Boot Services table. Boot services are documented in section 6 of the UEFI specification and are the interface to the majority of UEFI functionality. HandleProtocol takes an image and a protocol identifier, and hands back a pointer to the protocol. UEFI protocol identifiers are all GUIDs and defined in the specification. If you call HandleProtocol on a handle that doesn't implement the protocol you request, you'll simply get an error back in the status argument. No big deal.&lt;br /&gt;&lt;br /&gt;The loaded image protocol is fairly different to the simple text output protocol in that it's almost entirely data rather than function pointers. In this case we're printing the address that our executable was loaded at and the size of our relocated executable. Finally, we print the path of the file. UEFI device paths are documented in section 9.2 of the UEFI specification. They're a binary representation of a file path, which may include the path of the device that the file is on. DevicePathToStr is a gnu-efi helper function that converts the objects it understands into a textual representation. It doesn't cover the full set of specified UEFI device types, so in some corner cases it may print "Unknown()".&lt;br /&gt;&lt;br /&gt;That covers how to use protocols attached to the image handle. How about protocols that are attached to other handles? In that case we can do something like this:&lt;pre&gt;#include &amp;lt;efi.h&amp;gt;
#include &amp;lt;efilib.h&amp;gt;

EFI_STATUS
efi_main (EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *systab)
{
        EFI_STATUS status;
        EFI_GRAPHICS_OUTPUT_PROTOCOL *gop;
        EFI_GUID gop_guid = EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID;

        InitializeLib(image_handle, systab);

        status = uefi_call_wrapper(systab-&amp;gt;BootServices-&amp;gt;LocateProtocol,
                                   3,
                                   &amp;gop_guid,
                                   NULL,
                                   &amp;gop);

        Print(L"Framebuffer base is at %lx\n", gop-&amp;gt;Mode-&amp;gt;FrameBufferBase);

        return EFI_SUCCESS;
}&lt;/pre&gt;This will find the first (where first is an arbitrary platform ordering) instance of a protocol and return a pointer to it. If there may be multiple instances of a protocol (as there often are with the graphics output protocol) you should use LocateHandleBuffer() instead. This returns an array of handles that implement the protocol you asked for - you can then use HandleProtocol() to give you the instance on the specific handle. There's various helpers in gnu-efi like LibLocateHandle() that make these boilerplate tasks easier. You can find the full list in /usr/include/efi/efilib.h. &lt;br /&gt;&lt;br /&gt;That's a very brief outline of how to use basic UEFI functionality. The spec documents the full set of UEFI functions available to you, including things like direct block access, filesystems and networking. The process is much the same in all cases - you locate the handle that you want to interact with, open the protocol that's installed on it and then make calls using that protocol.&lt;h2&gt;Building these examples&lt;/h2&gt;Building these examples is made awkward due to UEFI wanting PE-COFF binaries and Linux toolchains building ELF binaries. You'll want a makefile something like this:&lt;pre&gt;ARCH            = $(shell uname -m | sed s,i[3456789]86,ia32,)
LIB_PATH        = /usr/lib64
EFI_INCLUDE     = /usr/include/efi
EFI_INCLUDES    = -nostdinc -I$(EFI_INCLUDE) -I$(EFI_INCLUDE)/$(ARCH) -I$(EFI_INCLUDE)/protocol

EFI_PATH        = /usr/lib64/gnuefi
EFI_CRT_OBJS    = $(EFI_PATH)/crt0-efi-$(ARCH).o
EFI_LDS         = $(EFI_PATH)/elf_$(ARCH)_efi.lds

CFLAGS          = -fno-stack-protector -fpic -fshort-wchar -mno-red-zone $(EFI_INCLUDES)
ifeq ($(ARCH),x86_64)
        CFLAGS  += -DEFI_FUNCTION_WRAPPER
endif

LDFLAGS         = -nostdlib -znocombreloc -T $(EFI_LDS) -shared -Bsymbolic -L$(EFI_PATH) -L$(LIB_PATH) \
                  $(EFI_CRT_OBJS) -lefi -lgnuefi

TARGET  = test.efi
OBJS    = test.o
SOURCES = test.c

all: $(TARGET)

test.so: $(OBJS)
       $(LD) -o $@ $(LDFLAGS) $^ $(EFI_LIBS)

%.efi: %.so
        objcopy -j .text -j .sdata -j .data \
                -j .dynamic -j .dynsym  -j .rel \
                -j .rela -j .reloc -j .eh_frame \
                --target=efi-app-$(ARCH) $^ $@&lt;/pre&gt;There's rather a lot going on here, but the important stuff is the CFLAGS line and everything after that. First, we need to disable the stack protection code - there's nothing in the EFI runtime for it to call into, so we'll build a binary with unresolved symbols otherwise. Second, we need to build position independent code, since UEFI may relocate us anywhere. short-wchar is needed to indicate that strings like L"Hi!" should be 16 bits per character, rather than gcc's default of 32 bits per character. no-red-zone tells the compiler not to assume that there's 256 bytes of stack available to it. Without this, the firmware may modify stack that the binary was depending on.&lt;br /&gt;&lt;br /&gt;The linker arguments are less interesting. We simply tell it not to link against the standard libraries, not to merge relocation sections, and to link in the gnu-efi runtime code. Nothing very exciting. What's more interesting is that we build a shared library. The reasoning here is that we want to perform all our linking, but we don't want to build an executable - the Linux executable runtime code would be completely pointless in a UEFI binary. Once we have our .so file, we use objcopy to pull out the various sections and rebuild them into a PE-COFF binary that UEFI will execute.&lt;br /&gt;&lt;br /&gt;&lt;img src="http://www.dreamwidth.org/tools/commentcount?user=mjg59&amp;ditemid=18773" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2011-02-12:696190:18505</id>
    <link rel="alternate" type="text/html" href="http://mjg59.dreamwidth.org/18505.html"/>
    <link rel="self" type="text/xml" href="http://mjg59.dreamwidth.org/data/atom/?itemid=18505"/>
    <title>Ted Ts'o is a rape apologist and why this matters</title>
    <published>2012-10-29T21:06:43Z</published>
    <updated>2012-11-06T03:27:50Z</updated>
    <category term="fedora"/>
    <category term="advogato"/>
    <dw:security>public</dw:security>
    <dw:reply-count>248</dw:reply-count>
    <content type="html">(This post contains some discussion of rape and sexual assault but does not go into any specifics)&lt;br /&gt;&lt;br /&gt;There was a brief controversy at Linux.conf.au back in 2011. The final keynote speaker gave a compelling presentation on online privacy, including some slides containing sexualised imagery. This was against the terms of the conference policies, and resulted in an apology from the conference organisers and the speaker. The situation was unfortunate but well handled, and that should have been the end of it.&lt;br /&gt;&lt;br /&gt;Afterwards, there was some pushback on the conference mailing list. Concerns were raised about the policy being overly restrictive and the potential for it to be used to stifle speech that influential groups disagreed with. I don't agree with these arguments, but discussion of why policies have been implemented is completely natural and provides an opportunity for a community to determine what its expected standards are.&lt;br /&gt;&lt;br /&gt;And then Ted Ts'o &lt;a href="http://www.codon.org.uk/~mjg59/ted_mail/0037.html"&gt;effectively called rape victims liars&lt;/a&gt;[1]. At first I assumed that this was just some sort of horrific failure to understand the implications of what he was saying, so I emailed him to check. The &lt;a href="http://www.codon.org.uk/~mjg59/ted/reply.txt"&gt;reply I got&lt;/a&gt; drew a pretty clear distinction between the case of a drunk college student raping another drunk college student in their room and the case of knifepoint rape in a dark park. You know, the difference between accidental rape and rape rape. The difference between the one any of us might have done and the one that only bad people do. Legitimate rape and the "rape" that those feminists talk about. The distinction that lets rapists convince themselves that they didn't really rape anyone because they weren't holding a knife at the time.&lt;br /&gt;&lt;br /&gt;Ted Ts'o argues that only a small percentage of rape really counts as what people think of as rape. Ted Ts'o is a rape apologist.&lt;br /&gt;&lt;br /&gt;There's an ongoing scandal in the UK at the moment. A well known DJ, Jimmy Savile, died last year. He grew up in a working class family, but through hard work and natural talent was one of the most significant figures in promoting pop music in the UK in the 50s and 60s, and worked in various parts of the BBC for the best part of 30 years. He spent significant amounts of time raising money for charity, and it's estimated that he raised over £40 million for various causes. Since his death, around 300 people have accused him of sexually abusing them. The BBC is desperately trying to explain why it cancelled an expose shortly before it aired. Multiple people who worked there at the time claim that everyone knew he was involved in indecent activities, but saying anything would risk both their career and the charities that depended on his fundraising. Nobody said anything, and he was allegedly free to continue his abuse.&lt;br /&gt;&lt;br /&gt;Ted Ts'o is a significant figure in the Linux kernel community. He has expressed abhorrent beliefs that damage that community. Condemnation was limited to a mailing list with limited readership, meaning, effectively, that nobody said anything. Last week the Ada Initiative published a blog post &lt;a href="https://adainitiative.org/2012/10/open-source-software-open-to-all/"&gt;pointing out the damage that did&lt;/a&gt;, and I realised that my effective silence was not only helping to alienate 50% of the population from involving themselves with Linux, it was also implicitly supporting my community leadership. I was giving the impression that I was basically fine with our community leaders telling people that it wasn't really rape if you were both drunk enough. I was increasing the chances of members of our community being sexually assaulted. Silence is endorsement. Saying nothing is not ok.&lt;br /&gt;&lt;br /&gt;In the absence of an apology and explanation from Ted, I'll be interacting with him to the bare minimum that I'm compelled to as a result of my job. I won't be attending any Linux Foundation events he's involved in organising. If I'm running any events, I won't be inviting him. At a time when we're finally making progress in making our community more open and supportive, we don't need leaders who undermine that work. Support &lt;a href="http://donate.adainitiative.org/"&gt;organisations who encourage that progress&lt;/a&gt;, not the people who help drag us back.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Footnotes&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;[1]The original archive has vanished. I've put up a copy of the relevant thread &lt;a href="http://www.codon.org.uk/~mjg59/ted_mail/"&gt;here&lt;/a&gt;. Throughout, Ted states that he's actually arguing against the idea that women need to be frightened of sexual assault, and not against the definition of rape. Except saying things like &lt;q&gt;This one does a pretty good job of taking apart the Koss / Ms. Magazine study, which is the source for the "1 in 4" number. For example, it points out that over half of those cases were ones where undergraduates were plied with alcohol, and did not otherwise involve using physical force or other forms of coercion&lt;/q&gt; is difficult to read in any way other than "Half of the people you're counting as having been raped haven't really been raped", and favourably referring to an article that asserts that the rate of false rape reports is probably close to 50% is pretty strong support for the idea that many rape victims are liars.&lt;br /&gt;&lt;br /&gt;(Update 2012/10/30: Adam Williamson suggests in &lt;a href="http://mjg59.dreamwidth.org/18505.html?thread=697161#cmt697161"&gt;this comment&lt;/a&gt; that &lt;a href="http://www.codon.org.uk/~mjg59/ted_mail/0038.html"&gt;this mail&lt;/a&gt; is a better example of Ted's behaviour - there's some explicit victim blaming and a lot of "Is that rape" questioning with the obvious implication that the answer should be "no". Ted Ts'o is a victim blaming rape apologist.)&lt;br /&gt;&lt;br /&gt;(Update 2012/11/05: It's been suggested that I haven't been sufficiently clear about which of Ted's statements justify my claims. So, here we go.&lt;br /&gt;&lt;br /&gt;In &lt;a href="http://www.codon.org.uk/~mjg59/ted_mail/0037.html"&gt;this mail&lt;/a&gt;, Ted links to and endorses &lt;a href="http://www.city-journal.org/2008/18_1_campus_rape.html"&gt;this article&lt;/a&gt;. He explicitly links to it because of its treatment of rape statistics. Quoting directly from that article:&lt;br /&gt;&lt;q&gt;the rate of false reports is at least 9 percent and probably closer to 50 percent&lt;/q&gt;&lt;br /&gt;Ted explicitly endorses an article that claims that a significant percentage of reported rapes are false. The study that generated that figure is held in poor regard by other researchers in the field - Australian police figures indicate that &lt;a href="https://www.ncjrs.gov/app/abstractdb/AbstractDBDetails.aspx?id=243182"&gt;2.1% of rape accusations were classified as false&lt;/a&gt;. Ted asserts that he was trying to argue against poor use of statistics, so it's a fair assumption that he agrees with the alternative statistics that he's citing. Ted believes that many rape victims are making false accusations. Ted believes that many rape victims are liars.&lt;br /&gt;&lt;br /&gt;Again in &lt;a href="http://www.codon.org.uk/~mjg59/ted_mail/0037.html"&gt;this mail&lt;/a&gt;, Ted argues against a claimed figure that 1 in 4 women have been sexually assaulted. One of his arguments is that &lt;q&gt;Also found in the Koss study, although not widely reported, was the statistic that of the women whom she classified as being raped (although 73% refused to self-classify the event as rape), 46% of them had subsequent sex with the reported assailant&lt;/q&gt;. Ted disagrees with a statistic because some rape victims subsequently have sex with the reported assailant. This means that Ted believes that this indicates that they were not really raped. Ted is a rape apologist.)&lt;br /&gt;&lt;br /&gt;&lt;img src="http://www.dreamwidth.org/tools/commentcount?user=mjg59&amp;ditemid=18505" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
</feed>
