←back to thread

279 points the_why_of_y | 1 comments | | HN request time: 0.23s | source
Show context
nkurz ◴[] No.11153467[source]
For context, this is in reference to a bug that was discussed a couple weeks ago: https://news.ycombinator.com/item?id=10999335

  Systemd mounted efivarfs read-write, allowing motherboard bricking via 'rm' 
Essentially, systemd defaulted to a configuration where the computer's motherboard could be permanently destroyed by removing a 'file' from the command line. The bug reporter argued that this was unduly dangerous, but the systemd developers thought that systemd was working as intended.

Here's a reasonably impartial discussion on a FreeBSD list that gives an overview: https://forums.freebsd.org/threads/54951/

And from that thread, here's a link to Matthew Garrett (the creator of efivarfs) saying that efivarfs is at fault here rather than systemd: https://twitter.com/mjg59/status/693494314941288448

replies(3): >>11153507 #>>11153589 #>>11153676 #
eeZi ◴[] No.11153676[source]
If you mount to r/o, a bunch of userspace applications break. Mounting it r/w is correct.
replies(1): >>11153703 #
captainmuon ◴[] No.11153703[source]
I'm curious, what kind of userspace application needs r/w access to EFI vars?

I would think a) this are mostly system tools like boot managers and b) these tools need root (or setuid root) anyway, so why can't they just mount it themselves temporarily?

Edit: It seems it is mostly grub-install, efibootmgr, and `systemctl reboot --firmware` that need this mounted rw. The first two aren't something that a casual user uses very often, and if someone does, a "Filesystem is mounted read-only" message will point them in the right direction. The latter is part of systemd and could easily be changed to mount efivarfs itself, no third party involved.

replies(4): >>11153774 #>>11153826 #>>11157276 #>>11157704 #
1. EmanueleAina ◴[] No.11157704[source]
What happens if a stray `rm` runs while `grub-install` runs?

The kernel fix prevents that, using mount flags alone only restrict the vulnerability but it doesn't make it go away.