Matthew Garrett: Filling in the holes in Linux boot chain measurement, and the TPM measurement log
When I wrote about TPM attestation via 2FA, I mentioned that you needed a bootloader that actually performed measurement. I've now written some patches for Shim and Grub that do so.The Shim code does a couple of things. The obvious one is to measure the second-stage bootloader into PCR 9. The perhaps less expected one is to measure the contents of the MokList and MokSBState UEFI variables into PCR 14. This means that if you're happy simply running a system with your own set of signing keys and just want to ensure that your secure boot configuration hasn't been compromised, you can simply seal to PCR 7 (which will contain the UEFI Secure Boot state as defined by the UEFI spec) and PCR 14 (which will contain the additional state used by Shim) and ignore all the others.
The grub code is a little more complicated because there's more ways to get it to execute code. Right now I've gone for a fairly extreme implementation. On BIOS systems, the grub stage 1 and 2 will be measured into PCR 9[1]. That's the only BIOS-specific part of things. From then on, any grub modules that are loaded will also be measured into PCR 9. The full kernel image will be measured into PCR10, and the full initramfs will be measured into PCR11. The command line passed to the kernel is in PCR12. Finally, each command executed by grub (including those in the config file) is measured into PCR 13.
That's quite a lot of measurement, and there are probably fairly reasonable circumstances under which you won't want to pay attention to all of those PCRs. But you've probably also noticed that several different things may be measured into the same PCR, and that makes it more difficult to figure out what's going on. Thankfully, the spec designers have a solution to this in the form of the TPM measurement log.
Rather than merely extending a PCR with a new hash, software can extend the measurement log at the same time. This is stored outside the TPM and so isn't directly cryptographically protected. In the simplest form, it contains a hash and some form of description of the event associated with that hash. If you replay those hashes you should end up with the same value that's in the TPM, so for attestation purposes you can perform that verification and then merely check that specific log values you care about are correct. This makes it possible to have a system perform an attestation to a remote server that contains a full list of the grub commands that it ran and for that server to make its attestation decision based on a subset of those.
No promises as yet about PCR allocation being final or these patches ever going anywhere in their current form, but it seems reasonable to get them out there so people can play. Let me know if you end up using them!
[1] The code for this is derived from the old Trusted Grub patchset, by way of Sirrix AG's Trusted Grub 2 tree.
[As You Like It, Act III, Scene V]
Hey Beautiful
I thought of you on the Fourth of July; which does not, in and of itself,
distinguish the day from any other since I met you. It was remarkable
only in that it was justifiable, given our conversation about fireworks
displays. Of course, I'm happy to take the flimsiest of displays as an
excuse to mark you.
I'm home alone right now, after watching The Bad Seed. Truth be told,
the shadows keep spooking me. I can't seem to stop myself from imagining
precocious blonde murderers in them. It's a manageable silliness, but
made a little less so by the fact that I forgot to lock the door. Less
troublesome than the night I spent after Ringu (the original Japanese
version of The Ring). I finished watching it in the wee hours of the
morning, and I wanted to go to sleep. I was in half a stupor, but the
incessant inner critic in me kept imagining all the changes that could
have been made to make the movie more truly unsettling until visions of
Obake were swimming around me.
Ordinarily I doubt I'd be bothered particularly by a 50's classic, but
went back up to Boston this afternoon. 's at a conference in
Finland, so I invited him down to visit while I have the apartment all
to myself. It was strange to have a visitor actually in my home for
whom I didn't have to play at being contented. At any rate, being
around for three days essentially meant carrying on a three-day-long
conversaiton, and the abrupt drop of sociability makes me feel my
isolation a little more acutely.
We watched The Way We Were together, and agreed that it should be
remade with casting that actually works. I hadn't seen it before, and
was surprised to find it unusually nuanced and substantial, yet still
not good. It was nice to have someone around who would dissect it with
me afterward. It's been a while since I actually discussed a film with
someone. Partly out of my own fault; I don't always enjoy verbalizing
my opinions of movies immediately after watching them if I've found them
in the least bit moving. I guess I consider the aftertaste part of the
experience. In this case, we both felt the film had missed its
emotional mark so it wasn't so much of an issue. On the other hand, I
don't find most movies moving. I find them frustratingly flawed, and by
the time they end I'm raring to rant about their petty contradictions
and failures of logic. I think it might give people the impression that
I don't actually make any effort to tease out the messages filmmakers
weave into their work. Or maybe I'm just making excuses for having
uninteresting friends. Either way, it was pleasant to be in the company
of someone eager to tolerate the convolutions of my thought process.
On Wednesday night, I have a date to meet up with some former
co-workers/friends that I've been passively avoiding for several years
now. Every time I fail to carefully manage my visibility, people seem
to come flooding back into my life. This time the culprit was a day
spent logged into instant messaging without stringent privacy settings.
I should feel lucky for that, I suppose. I'm not sure how I actually
feel. One of the formers is a woman I was very close to, as far as
most of the world her included could discern. The other is a Boston
boy I admired for the touch of golden child in the air that hung about
him. The main theme of his life was (and I suspect still is) getting
to drinks with friends at one of his regular bars at the end of every
evening. Which did not at all stop him from being productive,
interested in the world, and bright. If he had been a girl I would
have been hateful with envy. Instead he's always stood out in my
memory as the only person I've had a bit of a crush on despite not
finding him particularly intellectually stimulating. A month or so
ago he sold his company to google. Now he spends a lot of time out of
town giving lectures. I suspect I may be generally happy for him,
and I'm not quite sure what to do with that.
Thursday I'm leaving for a few days in Denver. I wish I hadn't
scheduled it for a time when I could have been the sole occupant of
my domicile, but other than that I'm looking forward to it. I've
no idea what I'll do there, but at least that means I really am
going someplace that wouldn't occur to me outside of a peculiar set
of constraints. I think it would be advisable to work out the
transportation system before I depart, though.
I hope this letter finds you relatively satisfied, at a minimum.
I don't actually need to tell you how much I miss talking to you, do I?
You're wonderful.
Affectionally, as always,
I have a Dell

I stumbled over this CD a few weeks ago, and immediately ordered it from some second-hand dealer in the US: International Sad Hits Volume 1: Altaic Group. Four artists from different countries (2x Japan, Korea, Turkey) and very different music style, but connected in one thing: That they don t fit into the happy-peppy culture of AKB48, JPOP, KPOP and the like, but singers and songwriters that probe the depths of sadness. With two of my favorite Japanese appearing in the list (
The four artist combined in this excellent CD are:
And yet another upstream
Trsteno (near Botanical gardens)
Kolo ep bay, from Villa Ruza
In order to automatically update my monitor setup and activate/deactivate my
external monitor when plugging my ThinkPad into its dock, I found a way to
hook into the ACPI events and run arbitrary scripts.
This was tested on a T420 with a