LWN: Comments on "Inline encryption for filesystems" https://lwn.net/Articles/797309/ This is a special feed containing comments posted to the individual LWN article titled "Inline encryption for filesystems". en-us Thu, 02 Oct 2025 22:46:56 +0000 Thu, 02 Oct 2025 22:46:56 +0000 https://www.rssboard.org/rss-specification lwn@lwn.net Inline encryption for filesystems https://lwn.net/Articles/798062/ https://lwn.net/Articles/798062/ robert_s <div class="FormattedComment"> It would be many orders of magnitude harder to do this and not "get caught" at any point in the product's lifetime.<br> </div> Sun, 01 Sep 2019 18:15:09 +0000 Inline encryption for filesystems https://lwn.net/Articles/798008/ https://lwn.net/Articles/798008/ ssmith32 <div class="FormattedComment"> And I just sent a colleague Ken Thompson's trusting trust (to point out you need to trust the writers of software *cough* bitcoin *cough*, there's no magic algo that makes it go away altogether..).<br> <p> Makes me smile that the paper stays relevant after all the years...! <br> </div> Sat, 31 Aug 2019 06:03:48 +0000 Final paper https://lwn.net/Articles/797755/ https://lwn.net/Articles/797755/ CChittleborough <div class="FormattedComment"> Here's the final paper, from the 40th IEEE Symposium on<br> Security and Privacy: <br> <a href="https://www.ieee-security.org/TC/SP2019/papers/310.pdf">https://www.ieee-security.org/TC/SP2019/papers/310.pdf</a><br> <p> Not good news.<br> </div> Thu, 29 Aug 2019 13:28:47 +0000 Inline encryption for filesystems https://lwn.net/Articles/797730/ https://lwn.net/Articles/797730/ LtWorf <div class="FormattedComment"> Yes but building a CPU that understands what is a key and what isn't is a bit complicated. If you have an instruction "set key" it's all suddenly very very easy.<br> </div> Thu, 29 Aug 2019 11:02:13 +0000 Inline encryption for filesystems https://lwn.net/Articles/797705/ https://lwn.net/Articles/797705/ iabervon <div class="FormattedComment"> Is there a single keyslot manager? I thought that was going to be up to each driver to implement, with the risk that some drivers wouldn't do as good a job of it as the implementation in the original patch set.<br> <p> Why not remember a struct key * instead of the data directly? It'd still be a pointer to the secret in kernel memory, but my impression is that they're not generally duplicated, so you could do all your management based on pointer equality, and leaking the values that have to be in your data structures to userspace would be less immediately bad.<br> </div> Thu, 29 Aug 2019 05:19:01 +0000 Inline encryption for filesystems https://lwn.net/Articles/797702/ https://lwn.net/Articles/797702/ Cyberax <div class="FormattedComment"> It's a bit more difficult with AES-NI. You have to somehow store the keys at a pretty good rate, and there's simply not enough space on the CPU die for this.<br> <p> But storing a handful of keys supplied for decryption of fairly large blocks of data? Easy.<br> </div> Thu, 29 Aug 2019 03:09:21 +0000 Inline encryption for filesystems https://lwn.net/Articles/797699/ https://lwn.net/Articles/797699/ ebiggers <div class="FormattedComment"> Sure, and the CPU could do the same when it sees an AES instruction.<br> <p> Ultimately, you always need some level of trust in the hardware...<br> </div> Thu, 29 Aug 2019 03:02:56 +0000 Inline encryption for filesystems https://lwn.net/Articles/797698/ https://lwn.net/Articles/797698/ ebiggers <div class="FormattedComment"> Yes, the code always uses constant-time comparisons when comparing keys, and always zeroizes keys when they're no longer needed.<br> <p> We could try to implement something fancy where the keyslot manager only remembers a cryptographic hash of each programmed key. But that would add extra overhead, and for now wouldn't truly buy us anything since the key still needs to be in kernel memory anyway, in case it needs to be programmed into a keyslot again.<br> </div> Thu, 29 Aug 2019 02:35:46 +0000 Inline encryption for filesystems https://lwn.net/Articles/797696/ https://lwn.net/Articles/797696/ ebiggers <div class="FormattedComment"> As noted by another commenter, you need to trust the SoC vendor anyway.<br> <p> I'll also note that inline encryption is, effectively, already standard practice on mobile devices. All iOS devices use it, and currently the major Android SoC vendors are providing their own inline encryption solutions, including out-of-tree kernel patches, which are already used on most new mid to high end Android devices.<br> <p> It will be much better to have vendor-independent, well-reviewed, and well-tested upstream Linux kernel code to support inline encryption, and common tests that everyone has to pass, rather than continue the status quo of everyone using their own out-of-tree patches.<br> </div> Thu, 29 Aug 2019 02:14:56 +0000 Usual vendor-firmware levels of quality and trustworthiness https://lwn.net/Articles/797693/ https://lwn.net/Articles/797693/ ebiggers <div class="FormattedComment"> Self-encrypting drives normally take a password, which can be changed later; they don't take the encryption key directly. Therefore, they have to implement key generation and wrapping themselves --- which is where the vulnerabilities actually are. It also means that software can't test the encryption for correctness.<br> <p> Inline encryption hardware is different, since for standards complaint (e.g. UFSHCI 2.1) inline encryption hardware, software provides the encryption key(s) directly. Thus, the hardware doesn't do any key generation or wrapping, and the results can be compared with a software implementation.<br> <p> So it's simply not possible to screw up the UFSHCI 2.1 crypto in the same ways that ATA Security and TCG OPAL self-encrypting drives have been screwed up. And if someone does nevertheless screw it up somehow, it's easily detectable by some basic comparison tests, unless the vendor *really* went out of their way to very deliberately do something malicious.<br> </div> Thu, 29 Aug 2019 01:38:27 +0000 Inline encryption for filesystems https://lwn.net/Articles/797692/ https://lwn.net/Articles/797692/ ebiggers <div class="FormattedComment"> Inline encryption has been part of the UFSHCI standard since 2016. See the patchset, which adds support for it to Linux's UFS host controller driver.<br> </div> Thu, 29 Aug 2019 01:02:48 +0000 Inline encryption for filesystems https://lwn.net/Articles/797601/ https://lwn.net/Articles/797601/ mjg59 <div class="FormattedComment"> Using this for devices where the storage is replaceable is already a bad idea - you've then got unencrypted information going over a bus that's trivial to interpose.<br> </div> Wed, 28 Aug 2019 15:20:27 +0000 Inline encryption for filesystems https://lwn.net/Articles/797583/ https://lwn.net/Articles/797583/ markh <div class="FormattedComment"> Trust is important but not the only concern; it is also about greatly increasing the attack surface. It's a lot easier to find a vulnerability if there are several possible software and hardware layers to choose from, many of which were not even designed with security in mind. It is only necessary to find a single weak spot to exploit.<br> </div> Wed, 28 Aug 2019 15:09:16 +0000 Inline encryption for filesystems https://lwn.net/Articles/797580/ https://lwn.net/Articles/797580/ iabervon <div class="FormattedComment"> Even so, the API shown has a surprising number of methods that take key data and seems to be using the key data itself as the identifier of the key, rather than something less secret. Will keyslot_find be implemented in a way that doesn't leak bits of other keys via timing attacks or leave key bits beyond the end of the stack or in memory that could be reused uninitialized?<br> </div> Wed, 28 Aug 2019 15:02:26 +0000 Inline encryption for filesystems https://lwn.net/Articles/797547/ https://lwn.net/Articles/797547/ grove <div class="FormattedComment"> I don't see a need to be "horrified by this". It's a way to make a feature available in some modern hardware available to the end user. If you don't trust all the hardware your information will have to pass through to use this, you should abstain from using that feature of your hardware.<br> <p> For that reason (and probably a couple more) I don't expect the pure software encryption options will go away (we are too many who can see the problems in giving secret information to our hardware), but allowing others to use this feature of their hardware seems fine.<br> </div> Wed, 28 Aug 2019 13:14:13 +0000 Usual vendor-firmware levels of quality and trustworthiness https://lwn.net/Articles/797541/ https://lwn.net/Articles/797541/ hmh <div class="FormattedComment"> Required reading:<br> <p> <a href="https://www.ru.nl/publish/pages/909282/draft-paper.pdf">https://www.ru.nl/publish/pages/909282/draft-paper.pdf</a><br> <p> I am not sure I would trust the SoC vendors would do any better than the SSD vendors named in the paper.<br> </div> Wed, 28 Aug 2019 12:03:03 +0000 Inline encryption for filesystems https://lwn.net/Articles/797538/ https://lwn.net/Articles/797538/ juliank <div class="FormattedComment"> This does not apply to devices where the storage is replaceable.<br> </div> Wed, 28 Aug 2019 10:47:11 +0000 Inline encryption for filesystems https://lwn.net/Articles/797532/ https://lwn.net/Articles/797532/ mjg59 <div class="FormattedComment"> The controller is on the SoC. If the SoC vendor can't be trusted, there are any number of ways they can extract private data already.<br> </div> Wed, 28 Aug 2019 07:45:54 +0000 Inline encryption for filesystems https://lwn.net/Articles/797530/ https://lwn.net/Articles/797530/ markh <div class="FormattedComment"> Am I the only one that is horrified by this?<br> <p> I thought it would be common sense to expect that encryption keys and plaintext would be restricted to the minimum number of layers possible, and that certainly under no circumstances would encryption keys be sent through several software and hardware layers to another possibly external device with its own proprietary firmware. This seems like the perfect architecture, if your goal is to enlarge the attack surface well beyond the ability of any one entity to manage, and maximize the number of potential interception points where keys or plaintext can be stolen.<br> <p> I really hope that I'm missing something and this is not as bad as it sounds.<br> </div> Wed, 28 Aug 2019 07:38:56 +0000 Inline encryption for filesystems https://lwn.net/Articles/797520/ https://lwn.net/Articles/797520/ sbates <div class="FormattedComment"> AFAIK there is no vendor-neutral interface into the engines (compression, encryption etc) that some of these SSDs provide. There is some activity within SNIA to try and remedy this situation and define said interfaces for at least some of the most common engines. The expectation is that this would feed into standards like T10 and NVM Express. However that's going to take time and then the vendors will need to produce product that aligns to those standard interfaces.<br> <p> <a href="https://www.snia.org/computational">https://www.snia.org/computational</a><br> </div> Wed, 28 Aug 2019 02:13:10 +0000 Inline encryption for filesystems https://lwn.net/Articles/797517/ https://lwn.net/Articles/797517/ quotemstr <div class="FormattedComment"> Yeah, but that approach doesn't help you win on benchmarks.<br> </div> Wed, 28 Aug 2019 00:24:26 +0000 Inline encryption for filesystems https://lwn.net/Articles/797516/ https://lwn.net/Articles/797516/ Cyberax <div class="FormattedComment"> Even better, store all the keys and give them out if presented with a special NSA_HERE packet.<br> </div> Wed, 28 Aug 2019 00:22:52 +0000 Inline encryption for filesystems https://lwn.net/Articles/797514/ https://lwn.net/Articles/797514/ quotemstr <div class="FormattedComment"> Oh, wait. Never mind. The controller can lie regardless, can't it? That is, can't it just store the plaintext and encrypt the data on the fly when you read back the "raw" contents?<br> </div> Tue, 27 Aug 2019 23:58:58 +0000 Inline encryption for filesystems https://lwn.net/Articles/797513/ https://lwn.net/Articles/797513/ quotemstr <div class="FormattedComment"> <font class="QuotedText">&gt; read back the encrypted content and verify that the controller is encrypting in the expected manner.</font><br> <p> Preferably after a power cycle so the controller can't lie.<br> </div> Tue, 27 Aug 2019 23:58:00 +0000 Inline encryption for filesystems https://lwn.net/Articles/797503/ https://lwn.net/Articles/797503/ theonewolf <div class="FormattedComment"> Ah, you might be right on that. I haven't explored this deeply (honestly haven't ventured much into Opal).<br> <p> I don't know about reading the raw data back!<br> </div> Tue, 27 Aug 2019 22:06:29 +0000 Inline encryption for filesystems https://lwn.net/Articles/797501/ https://lwn.net/Articles/797501/ mjg59 <div class="FormattedComment"> The distinction is (to my understanding) the degree of control that the OS has over the encryption. In the Opal case, all that's exposed to the OS is the session management and authentication for encrypted regions. In the case being discussed here, you have the ability to define the encryption algorithm and even disable it - you still have direct access to the flash, which means you can read back the encrypted content and verify that the controller is encrypting in the expected manner.<br> </div> Tue, 27 Aug 2019 22:04:07 +0000 Inline encryption for filesystems https://lwn.net/Articles/797496/ https://lwn.net/Articles/797496/ theonewolf <div class="FormattedComment"> SSDs also usually implement it under the TCG OPAL standard. Most SSDs are full self-encrypting drives (SEDs) today.<br> </div> Tue, 27 Aug 2019 21:48:17 +0000 Inline encryption for filesystems https://lwn.net/Articles/797495/ https://lwn.net/Articles/797495/ theonewolf <div class="FormattedComment"> Technically I think SSDs already have this kind of technology: <a href="https://www.micron.com/-/media/documents/products/white-paper/self_encrypting_drives_white_paper.pdf">https://www.micron.com/-/media/documents/products/white-p...</a><br> <p> I think most SSDs ship with it now: <a href="https://www.samsung.com/semiconductor/insights/news-events/samsung-ssd-self-encryption-provides-highest-level-of-protection-against-data-loss/">https://www.samsung.com/semiconductor/insights/news-event...</a><br> <p> They are typically based on the TCG OPAL standard for self-encrypting drives (SEDs): <a href="https://en.wikipedia.org/wiki/Opal_Storage_Specification">https://en.wikipedia.org/wiki/Opal_Storage_Specification</a><br> </div> Tue, 27 Aug 2019 21:47:17 +0000 Inline encryption for filesystems https://lwn.net/Articles/797480/ https://lwn.net/Articles/797480/ mjg59 <div class="FormattedComment"> This is already common in phones, where the flash controller in the SoC has support for doing the encryption in hardware.<br> </div> Tue, 27 Aug 2019 20:55:04 +0000 Inline encryption for filesystems https://lwn.net/Articles/797477/ https://lwn.net/Articles/797477/ Spack <div class="FormattedComment"> What device could specifically benefit from this support? Can we already find such drives on the market? <br> </div> Tue, 27 Aug 2019 20:39:05 +0000