jaseg,
@jaseg@chaos.social avatar

So my just catastrophically self-destructed. I was using arch with the yubikey full-disk encryption package, when the machine hung and crashed during a system update. The machine crashed exactly after the old initramfs files were cleaned up, and before the new ones were written to disk. Since the yubkikey fde thing stores the seed ("challenge") for the luks key in the initramfs, all copies of the seed are gone now, and the data on that disk is unrecoverable.

jaseg,
@jaseg@chaos.social avatar

Quite the failure mode if you ask me. I guess I will be scraping that yubikey fde thing from all of my machines now, and go back to plain passphrases. Deleting the old seed files before the new ones have been written and flushed to disk is a pretty bad design error.

chetwisniewski,
@chetwisniewski@securitycafe.ca avatar

@jaseg That is a terrible design. Thanks for the warning, will avoid

gsuberland,
@gsuberland@chaos.social avatar

@jaseg that's super shit. it should really be writing the new seed, issuing a sync, purging the disk I/O cache, doing readback and verifying that it was written correctly, marking that new seed as primary and the old seed as ready for deletion, then only actually deleting that old seed once you've rebooted and successfully authenticated to the new seed. that way you always have the option to roll back, right up until you've successfully used the new seed.

jaseg,
@jaseg@chaos.social avatar

Update: The backup has worked and I have restored the system to working order with minimal data loss.

jaseg,
@jaseg@chaos.social avatar

Update to the update: The creators of the yubikey full disk encryption thing have responded to my bug report with what is essentially a shrug emoji and the line "I hope you had [a backup]".

I don't think that's an appropriate reponse from the maintainers of a critical piece of software like this. I think if you choose to release software like this, you have a responsibility to either make it good or to at the very least warn users that it's bad.

jaseg,
@jaseg@chaos.social avatar

Here's the github link. Please don't brigade the thread.

https://github.com/agherzan/yubikey-full-disk-encryption/issues/106

EA8DHY,
@EA8DHY@mastodon.radio avatar

@jaseg after reading it, it sounds like a good and correct answer to me. The real problem here is mkinitcpio deleting the initramfs after creating the new one. Also, his answer about having a warning at the readme about making a backup seems right to me. But doing it automatically in a hardcoded path doesn't sound good to me.

jaseg,
@jaseg@chaos.social avatar

@EA8DHY If they can't figure out the path automatically, just prompt the user.
With the mkinitcpio thing, I don't have the time to take on that fight. For me it doesn't matter if it's their tool or their upstream, the end result is the same: Their tool can't be used safely.

I believe they have the best intentions, but unfortunately the result sucks despite those good intentions.

jannem,
@jannem@fosstodon.org avatar

@jaseg
I ran Arch for four months recently. Even the Arch maintainers themselves describe it as a distribution building kit, not a distribution, and they're not wrong.

Using it was a fun experience and mostly very pleasant. But it made it crystal clear to me nobody should run plain Arch on a machine that would cause issues if it was suddenly lost.

If I had to choose between Arch and yubikey, I'd pick yubikey.

jaseg,
@jaseg@chaos.social avatar

@jannem I mean I have been running arch for about ten years now and this is the first time I have had an issue like this.

jhwgh1968,
@jhwgh1968@chaos.social avatar

@jaseg I'll simply say, as a fellow Arch user

Holy fuck that sucks 💔

EDIT: whew, you have a backup

waldi,
@waldi@chaos.social avatar

@jaseg So this mode requires extra data apart from the LUKS headers? Well, that's beyond broken.

jaseg,
@jaseg@chaos.social avatar

@waldi it uses the yubikey in challenge-response mode instead of plain password mode so you can't read the luks passphrase out of the yubikey without the computer.

viq,
@viq@hackerspace.pl avatar

@jaseg LUKS allows for multiple slots to be defined, I think 8? So you can have it be automatically unlocked by yubi, but you can also have a separate password to unlock it, for situations like this.
Yes, this situation sucks. This is meant as a hint how you can protect yourself in the future.

psotle,
@psotle@mendeddrum.org avatar

@viq @jaseg this is the only practicable workaround. Hardware keys aren't designed to be a replacement for passphrases, just a convienence.

jaseg,
@jaseg@chaos.social avatar

@psotle @viq I have a backup for cases like physical damage or loss to the hardware key. That I have to resort to that backup because of an avoidable snafu like this is lame.

wonka,
@wonka@chaos.social avatar

@jaseg Ooof. Debian generates a new initramfs image and keeps the old one around as .old...

How can one NOT change from old to new image with an atomic operation??!?

jaseg,
@jaseg@chaos.social avatar

@wonka I'm not sure, but I suspect whatever wrote the new files didn't make sure they were flushed to disk before deleting the old files.

wonka,
@wonka@chaos.social avatar

@jaseg that's one sync call in a shell script...

  • All
  • Subscribed
  • Moderated
  • Favorites
  • linux
  • DreamBathrooms
  • InstantRegret
  • thenastyranch
  • magazineikmin
  • everett
  • rosin
  • Youngstown
  • slotface
  • cubers
  • cisconetworking
  • kavyap
  • GTA5RPClips
  • osvaldo12
  • tacticalgear
  • JUstTest
  • khanakhh
  • mdbf
  • Durango
  • ngwrru68w68
  • normalnudes
  • tester
  • ethstaker
  • anitta
  • modclub
  • megavids
  • Leos
  • provamag3
  • lostlight
  • All magazines