LWN: Comments on "Secure key handling using the TPM" https://lwn.net/Articles/768419/ This is a special feed containing comments posted to the individual LWN article titled "Secure key handling using the TPM". en-us Thu, 16 Oct 2025 09:43:14 +0000 Thu, 16 Oct 2025 09:43:14 +0000 https://www.rssboard.org/rss-specification lwn@lwn.net TPM proof? https://lwn.net/Articles/769080/ https://lwn.net/Articles/769080/ mjg59 <div class="FormattedComment"> One of the benefits of running the TPM stack on the ME is that MITM becomes a significantly tougher problem (and on chips where the PCH is on package, basically impossible) - I'm actually leaning towards using PTT rather than a physical TPM where possible.<br> </div> Sun, 21 Oct 2018 15:05:28 +0000 TPM proof? https://lwn.net/Articles/769079/ https://lwn.net/Articles/769079/ jboone <div class="FormattedComment"> I suppose there are a few downsides to asking userspace to verify the key.<br> <p> First, if a man-in-the-middle (interposer) sits on the bus between the kernel and the TPM peripheral, then by the time that userspace executes, the kernel may have already been compromised. For example, this MITM can spoof measurements that are extended into PCRs, making it appear as if a malicious kernel is in fact legitimate. A compromised kernel should be able to present the real key to userspace.<br> <p> The kernel could itself verify the key prior to communicating with the TPM (for the purposes of PCR extends, unsealing secrets, etc). But I understand why we may not want to do key verification in the kernel, asking the kernel to keep copies of public keys [1] for every TPM manufacturer is a maintenance problem. As an aside, similar challenges are faced by other peripheral drivers, such as the USB Type-C Authentication scheme [2] and the more recent PCIe Device Security Enhancements [3].<br> <p> The above also holds true for the pre-kernel boot environment. Each boot stage needs to be able to securely communicate with the TPM. As with the kernel, the PCR Extend operations that are performed by the platform's bootloader(s) must be integrity protected. This requires knowledge of the HMAC shared secret, which must be kept hidden from a MITM. So we once again encounter the same problem that is faced by the kernel.<br> <p> [1] <a href="https://www.st.com/content/ccc/resource/technical/digital_certificates/tpm_certificates/group0/1b/0c/f0/6a/76/d4/49/5c/DM00213539/files/en.DM00213539.pdf/jcr:content/translations/en.en.DM00213539.pdf">https://www.st.com/content/ccc/resource/technical/digital...</a><br> [2] <a href="https://community.nxp.com/servlet/JiveServlet/downloadBody/331563-102-3-267311/MHW-N1910%20Authentication%20for%20USB%20Type-C.pdf">https://community.nxp.com/servlet/JiveServlet/downloadBod...</a><br> [3] <a href="https://www.intel.com/content/www/us/en/io/pci-express/pcie-device-security-enhancements-spec.html">https://www.intel.com/content/www/us/en/io/pci-express/pc...</a><br> <p> </div> Sun, 21 Oct 2018 15:03:26 +0000 Secure key handling using the TPM https://lwn.net/Articles/769067/ https://lwn.net/Articles/769067/ pizza <div class="FormattedComment"> That laptop was not sold with Windows 10. <br> <p> Anything sold as new today is unlikely to have been tested with anything other than Windows 10, and even then only in the configuration that MS requires (ie UEFI with secure boot).<br> <p> <p> </div> Sun, 21 Oct 2018 00:10:38 +0000 Secure key handling using the TPM https://lwn.net/Articles/769059/ https://lwn.net/Articles/769059/ dps <div class="FormattedComment"> I have personally run Windows 10 on a laptop without uefi firmware and secure boot. It did have a tpm but I did briefly run Windows 10 with it disabled to upgrade infeon's insecure firmware. Modulo bitlocker there where no problems.<br> <p> I doubt bitlocker is useful enough justify spenfing an extra £300+ more for most people.<br> </div> Sat, 20 Oct 2018 23:48:36 +0000 Secure key handling using the TPM https://lwn.net/Articles/769039/ https://lwn.net/Articles/769039/ mjg59 <div class="FormattedComment"> argon2id is sufficiently RAM intensive that you're going to need to throw significant resources at it even if the user is using a low entropy password. If the user's using a high entropy password then it's effectively unbreakable, whereas a TPM is, well, not. I definitely think there's value in using TPMs, but for this kind of thing I think there's more value in trying to reduce PCR fragility and using them as a way of improving user experience.<br> </div> Sat, 20 Oct 2018 12:58:14 +0000 Secure key handling using the TPM https://lwn.net/Articles/768993/ https://lwn.net/Articles/768993/ jejb <div class="FormattedComment"> A couple of observations on this argument:<br> <p> Firstly neither system protects the case where the attacker got the passphrase by looking over your shoulder and then runs off with your laptop because even in the bitlocker case the measurements won't change when the attacker unlocks.<br> <p> Secondly, I think there is value to having the TPM dictionary attack protections against brute forcing the password. I don't buy the argon2id brute forcing argument because most people do have insecure passphrases which a dictionary attack will eventually crack given enough compute power. I also don't buy the idea that training people not to use memorable words is the way forward because then they tend to write them down (especially if you force them to change their unmemorable passphrase every couple of months), so TPM DA protections do give benefits in the average user case where they're using a memorable word as the passphrase.<br> <p> Plus simply placing the decryption key in the TPM is a big step towards implementing policy based protections around it, so it would be a good first step to take regardless of any additional security benefits.<br> </div> Fri, 19 Oct 2018 15:44:15 +0000 Secure key handling using the TPM https://lwn.net/Articles/768906/ https://lwn.net/Articles/768906/ rdoty <div class="FormattedComment"> The original use case for NBDE was servers in a data center or VPN environment. The addition of TPM2 support adds more security - you can require both TPM and a network server - and opens up new use cases like desktops and laptops. The PIN base architecture of the Clevis client provides a flexible way to add new ways to unlock keys, and the policy capability of Clevis allows you to use multiple PINs.<br> </div> Fri, 19 Oct 2018 12:37:08 +0000 Secure key handling using the TPM https://lwn.net/Articles/768895/ https://lwn.net/Articles/768895/ grawity <div class="FormattedComment"> <font class="QuotedText">&gt; most USB devices can only cope with one or two key pairs, and smart cards tend to only hold three.</font><br> <p> I'd be slightly surprised if that were true for USB-stick-shaped smartcards at least. (Especially when they don't have the size constraints that actual cards do...)<br> <p> Yes, Yubikeys and other tokens implementing the PIV spec have 3 primary keypair slots for specific tasks – but they also have 20 additional "retired key" slots into which an obsolete primary keypair can be moved, so clearly the memory capacity is present, just the firmware is somewhat restrictive about it.<br> <p> Here I have an old Aladdin eToken 72K USB token which uses a more freeform structure, I can upload as many keypairs as the ~72 kB memory will fit – although I've never tried more than six. (Unfortunately it's EOL and won't go above RSA2048 either. But wouldn't modern devices have at least similar capacity?)<br> </div> Fri, 19 Oct 2018 10:10:24 +0000 Secure key handling using the TPM https://lwn.net/Articles/768896/ https://lwn.net/Articles/768896/ nix <div class="FormattedComment"> So long as they're not running it in SGX enclaves. L1tf showed us how much *that* security was worth.<br> <p> </div> Fri, 19 Oct 2018 09:46:28 +0000 Secure key handling using the TPM https://lwn.net/Articles/768891/ https://lwn.net/Articles/768891/ mjg59 <div class="FormattedComment"> So the threat model is one where I have physical access to your computer before I know your passphrase, but don't afterwards?<br> </div> Fri, 19 Oct 2018 08:42:56 +0000 Secure key handling using the TPM https://lwn.net/Articles/768888/ https://lwn.net/Articles/768888/ jgg <div class="FormattedComment"> I thought NBDE was for servers not latops? Interested in the laptop use case here..<br> </div> Fri, 19 Oct 2018 07:56:44 +0000 Secure key handling using the TPM https://lwn.net/Articles/768887/ https://lwn.net/Articles/768887/ jgg <div class="FormattedComment"> It isn't taking the disc that worries people, it is copying it.<br> <p> If I borrow your computer, disassemble it, clone the disk, then put it back, you have no idea it was stolen and I can access your data as soon as I observe the passphrase through some means.<br> <p> With the TPM even if I do all of these steps I can't decrypt the copy of the drive as I need the physical TPM as well.<br> <p> Of course if I steal the entire computer then more options are possible, but at least you'll know the computer was stolen and can take counter-mesaures, ie re-keying online accounts, etc.<br> </div> Fri, 19 Oct 2018 07:54:33 +0000 Secure key handling using the TPM https://lwn.net/Articles/768847/ https://lwn.net/Articles/768847/ zlynx <div class="FormattedComment"> All of the AMD Ryzen CPUs offer what they call a fTPM. f for Fake, maybe? (No, really it is Firmware).<br> <p> It's implemented on the CPU via their PSP (Platform Security Processor). Essentially the same thing as Intel's ME.<br> </div> Thu, 18 Oct 2018 19:49:59 +0000 Secure key handling using the TPM https://lwn.net/Articles/768842/ https://lwn.net/Articles/768842/ mjg59 <div class="FormattedComment"> …although I believe the TPM can be in the form of software running on the ME or SPU.<br> </div> Thu, 18 Oct 2018 18:26:18 +0000 Secure key handling using the TPM https://lwn.net/Articles/768839/ https://lwn.net/Articles/768839/ pizza <div class="FormattedComment"> In order to ship something with Windows 10 (Client), Microsoft mandates use of UEFI, secure boot, and a TPM.<br> <p> <p> <p> </div> Thu, 18 Oct 2018 18:17:40 +0000 Secure key handling using the TPM https://lwn.net/Articles/768816/ https://lwn.net/Articles/768816/ mjg59 <div class="FormattedComment"> If you can borrow the disk then why wouldn't you just borrow the computer? It's going to be massively faster than taking the system apart to extract the disk, and for a bunch of modern laptops with flash on the motherboard you're not even going to be able to do that.<br> </div> Thu, 18 Oct 2018 16:51:24 +0000 Secure key handling using the TPM https://lwn.net/Articles/768815/ https://lwn.net/Articles/768815/ smurf <div class="FormattedComment"> Obtaining an unlock password is easy. You watch the target type it – either directly or via a surveillance camera.<br> <p> Then you borrow the disk for a couple of hours – while they're asleep, off on a date, or whatever.<br> </div> Thu, 18 Oct 2018 16:46:58 +0000 Secure key handling using the TPM https://lwn.net/Articles/768797/ https://lwn.net/Articles/768797/ dps <div class="FormattedComment"> I might be badly informed, or one a weird band that buy memory, cpus, motherboards, etc separately (and don't buy windows). At least 98% of the moderateoy cheap brand new motherboards I have condisdered don't have a tpm.<br> <p> A lot of these mothebostds offer at most minimal uefi support. I find it hard to believe that just people like me are sufficient to make these tpm free motherboards economic.<br> <p> I think that despite the propaganda most people don't have a tpm. Even microsoft probably can't afford not to support those that can't use uefi.<br> </div> Thu, 18 Oct 2018 15:47:18 +0000 " Twelve keys is beyond the capacity of any USB device that he knows of..." https://lwn.net/Articles/768746/ https://lwn.net/Articles/768746/ Herve5 <div class="FormattedComment"> (answering to myself) OK, sorry for second part the above. Obviously, just mounting the Nitrokey encrypted volume means any borked system can access my precious keys...<br> </div> Thu, 18 Oct 2018 12:33:01 +0000 " Twelve keys is beyond the capacity of any USB device that he knows of..." https://lwn.net/Articles/768732/ https://lwn.net/Articles/768732/ Herve5 <div class="FormattedComment"> I understand some of the Nitrokeys can offer 20 RSA key pairs and 30 ECC ones; mine, the 'storage' version, only supports 3 + 3 but also offers Gbytes of encrypted memory that I trust reasonably unreachable... <br> Thus my very naive question : is it really less safe to store keys on an encrypted Nitrokey volume?<br> H.<br> </div> Thu, 18 Oct 2018 09:18:24 +0000 Secure key handling using the TPM https://lwn.net/Articles/768719/ https://lwn.net/Articles/768719/ mjg59 <div class="FormattedComment"> You need to construct a pretty elaborate model to be able to obtain someone's password without either:<br> <p> a) Having physical access to the system, or<br> b) Having enough control over the system to be able to exfiltrate the contents of the disk after it's been unlocked<br> </div> Thu, 18 Oct 2018 07:25:14 +0000 Secure key handling using the TPM https://lwn.net/Articles/768716/ https://lwn.net/Articles/768716/ smurf <div class="FormattedComment"> Again, that depends on the threat model. You're assuming that the adversary has access to the complete computer.<br> <p> If they can "only" get away with [a copy of] the disk, the TPM approach does improve security.<br> </div> Thu, 18 Oct 2018 06:43:32 +0000 Secure key handling using the TPM https://lwn.net/Articles/768690/ https://lwn.net/Articles/768690/ mjg59 <div class="FormattedComment"> If you're able to intercept the user typing the password (or compel the user to provide their password in any other way) then using the TPM gives you no benefit over not using the TPM.<br> </div> Wed, 17 Oct 2018 21:40:47 +0000 Secure key handling using the TPM https://lwn.net/Articles/768679/ https://lwn.net/Articles/768679/ rdoty <div class="FormattedComment"> Doesn't decapping the TPM need to be compared to other ways of _providing_ the disk passphrase? Manual entry of the disk passphrase, for example, is subject to everything from hardware keyloggers to software reading user input. Or am I missing something?<br> </div> Wed, 17 Oct 2018 19:57:58 +0000 Secure key handling using the TPM https://lwn.net/Articles/768675/ https://lwn.net/Articles/768675/ mjg59 <div class="FormattedComment"> Password protection makes some sense here, but it ends up depending somewhat on your threat model. If you're using argon2id as the key derivation function (as is supported in recent versions of cryptsetup) then brute-forcing the disk passphrase isn't realistically possible in any case - it'd be cheaper to decap the TPM and read stuff out of it than it would be to throw enough compute at the brute-force job, so using the TPM is then arguably weaker than not doing so. The only real benefit you're getting is that stealing the drive on its own gets you nothing. Using policy-bound keys at least gives you the advantage of being able to boot an encrypted FS without requiring user interaction, at the cost of needing some reasonable way to handle recovery.<br> </div> Wed, 17 Oct 2018 19:52:52 +0000 TPM proof? https://lwn.net/Articles/768652/ https://lwn.net/Articles/768652/ jejb <div class="FormattedComment"> <font class="QuotedText">&gt; How can the TPM prove that it's really a TPM, instead of some software emulating one?</font><br> <p> TPMs come with an endorsement key (EK) certificate signed by the manufacturer. Thus you run an X509 verification on this key which proves the public part of the EK (provided you trust the manufacturer, of course) and then the TPM itself will give you various proofs signed by the EK which you can externally verify.<br> <p> The proposal for defeating TPM Genie with the in-kernel TPM handling relies on the kernel simply using the NULL seed primary as an encryption key but userspace proving after boot that this is indeed a key genuinely produced by the expected TPM.<br> </div> Wed, 17 Oct 2018 18:09:34 +0000 Secure key handling using the TPM https://lwn.net/Articles/768649/ https://lwn.net/Articles/768649/ jejb <div class="FormattedComment"> <font class="QuotedText">&gt; All the pieces exist to do this in Linux, the problem is that it's a terrible user experience when an update results in them being locked out of their machine.</font><br> <p> Just to clarify: what Matthew is talking about is where you tie keys to policy such as specific measurement values: the policy (and thus the key its tied to) needs to change if the measurements do. In the interests of full disclosure, the openssl engine I was talking about does have the ability to work with policy limited keys. However, because of the difficulty pointed out, I would recommend most people don't use this in their first foray into TPM protections.<br> <p> The other difficulty about Bitlocker and Linux disk encryption is that the TPM cannot protect the keys used because it's far too slow for the bulk encryption requirements, so the TPM is used to store the symmetric disk key and release it under specific requirements for the OS to do the bulk encryption. With bitlocker these release requirements do include a password and an OS measurement policy but we could begin in Linux with simply requiring a password.<br> </div> Wed, 17 Oct 2018 18:05:11 +0000 TPM proof? https://lwn.net/Articles/768651/ https://lwn.net/Articles/768651/ smurf <div class="FormattedComment"> How can the TPM prove that it's really a TPM, instead of some software emulating one?<br> </div> Wed, 17 Oct 2018 18:02:36 +0000 Secure key handling using the TPM https://lwn.net/Articles/768646/ https://lwn.net/Articles/768646/ jejb <div class="FormattedComment"> <font class="QuotedText">&gt; if you can't trust the kernel there are probably equally bad problems as loss of a private key</font><br> <p> So there are things you can do about this. A fully untrusted kernel is a hugely difficult problem but a trusted but vulnerable one (meaning it's your kernel but someone could gain access via an exploit) is much easier because the more interception channels you shut down the less likely the exploit is to gain access.<br> <p> However, the point about the TPM is that even a fully untrusted kernel can't gain access to the key you place in the TPM if you do it correctly. The handheld market is working on this (where you can root the system but can't get access to their credentials) but there's a huge amount of work that goes into "... do it correctly".<br> </div> Wed, 17 Oct 2018 17:58:32 +0000 Secure key handling using the TPM https://lwn.net/Articles/768645/ https://lwn.net/Articles/768645/ mjg59 <div class="FormattedComment"> Windows has the advantage of a sufficiently large security team and support infrastructure that they can support escrowing the Bitlocker keys and allowing users to recover them when system measurements change. All the pieces exist to do this in Linux, the problem is that it's a terrible user experience when an update results in them being locked out of their machine.<br> </div> Wed, 17 Oct 2018 17:36:18 +0000 Secure key handling using the TPM https://lwn.net/Articles/768642/ https://lwn.net/Articles/768642/ rdoty <div class="FormattedComment"> The Clevis module in Network Bound Disk Encryption (NBDE) has added support for TPM2. It is initially included in Fedora 28. Details available at <a href="https://blog.dowhile0.org/2017/10/18/automatic-luks-volumes-unlocking-using-a-tpm2-chip/">https://blog.dowhile0.org/2017/10/18/automatic-luks-volum...</a><br> </div> Wed, 17 Oct 2018 17:24:51 +0000 Secure key handling using the TPM https://lwn.net/Articles/768637/ https://lwn.net/Articles/768637/ GennaroReinger <div class="FormattedComment"> Here's link to the talk. I couldn't find it in the article.<br> <p> <a href="https://kernel-recipes.org/en/2018/talks/tpm-enabling-the-crypto-ecosystem-for-enhanced-security/">https://kernel-recipes.org/en/2018/talks/tpm-enabling-the...</a><br> </div> Wed, 17 Oct 2018 17:06:16 +0000 Secure key handling using the TPM https://lwn.net/Articles/768633/ https://lwn.net/Articles/768633/ jgg <div class="FormattedComment"> What I would really like to see is for distros to start supporting tpm for holding the disk encryption key. It is rediculous how far ahead Windows is here.<br> </div> Wed, 17 Oct 2018 17:03:15 +0000 Secure key handling using the TPM https://lwn.net/Articles/768632/ https://lwn.net/Articles/768632/ jgg <div class="FormattedComment"> The tpm subsystem supports this, and I recall qemu can work with emulated tpm as well.<br> </div> Wed, 17 Oct 2018 17:01:50 +0000 Secure key handling using the TPM https://lwn.net/Articles/768631/ https://lwn.net/Articles/768631/ epa <div class="FormattedComment"> From the sound of it, if access to the TPM is mediated by the kernel, then for some applications you don't need a physical TPM at all. After all, if you can't trust the kernel there are probably equally bad problems as loss of a private key. (This is certainly not true in all applications, hence the desire for a hardware TPM that stays secure even if the kernel is compromised -- but just as certainly there are cases where it does hold, and any attacker who controls the kernel can already do all the bad things you're worried about.)<br> <p> That suggests a virtual TPM in software, but exposed using the same kernel interface, would be a useful thing to have for some virtualization applications, for debugging, and for systems that don't have a hardware TPM but nonetheless want to run software that expects one (at the user's own risk, of course).<br> </div> Wed, 17 Oct 2018 16:58:25 +0000