#
✕ nick:marcan
#asahi-dev · 2022-03-09 16:04
marcanideally we'd use that for u-boot to pick an ESP
#asahi-dev · 2022-03-09 16:04
marcankettenis: new installer UEFI only option now does chainloading, and also should be setting /chosen/efi-partition to the ESP PARTUUID
#asahi-dev · 2022-03-09 09:52
marcanhonestly, given Apple apparently already have two extra NVMe namespaces for some magic stuff, I don't know why they didn't just stick xARTS there and had to use APFS...
#asahi-dev · 2022-03-09 09:50
marcanwhich would probably be much simpler
#asahi-dev · 2022-03-09 09:50
marcanit's also possible readonly is good enough for u-boot?
#asahi-dev · 2022-03-09 09:49
marcanso it might not be too crazy to actually implement
#asahi-dev · 2022-03-09 09:49
marcannote that we don't need full APFS support, just enough to find the single fixed-size file present in a specific volume, and replace blocks in it
#asahi-dev · 2022-03-09 09:47
marcanultimately, if we want to do this properly, the only real way is to use the SEP, which means either having "static" secureboot all the way to Linux (and SEP + APFS there), or sticking APFS+SEP support into u-boot too
#asahi-dev · 2022-03-09 09:46
marcanwhich the SEP has via secure storage
#asahi-dev · 2022-03-09 09:46
marcanrkjnsn: the problem with those approaches is anti-rollback
#asahi-dev · 2022-03-09 09:46
marcanthe TPM here is the SEP
#asahi-dev · 2022-03-09 09:46
marcankettenis: right
#asahi-dev · 2022-03-09 09:45
marcanthat might work, but it's a bit dodgy and you still need a "machine key" provisioned on first install somehow
#asahi-dev · 2022-03-09 09:35
marcanand probably also doesn't do module signing so you'd want to build your own kernel with that anyway
#asahi-dev · 2022-03-09 09:35
marcanarch doesn't sign their kernels
#asahi-dev · 2022-03-09 09:21
marcanwe could work on building a generic version of something like that, but making it end-user-proof would definitely be a distro's domain
#asahi-dev · 2022-03-09 09:20
marcane.g. one way to solve the bootstrapping issue might be to have a signed recovery kernel/initramfs option (stored in the ESP) that can launch e.g. online or USB recovery, but only after authenticating against SEP
#asahi-dev · 2022-03-09 09:18
marcanno real way around that
#asahi-dev · 2022-03-09 09:18
marcanand either way distros are going to have to cooperate and take on a bunch of the engineering/integration if they want to make it easy for *their* users
#asahi-dev · 2022-03-09 09:18
marcanin the long term, we'll see, once more pieces of the puzzle fall together
#asahi-dev · 2022-03-09 09:18
marcanso yeah, ultimately, in the short term this is going to be a power user thing for people who really care and don't mind e.g. going through 1TR for every secureboot transition they want to make
#asahi-dev · 2022-03-09 09:17
marcanUEFI secure boot/TPM/etc systems aren't... exactly a good inspiration to go by, seeing as the entire x86 secureboot ecosystem is kind of a joke in various ways
#asahi-dev · 2022-03-09 09:15
marcanhow do you do recovery if something goes wrong?
#asahi-dev · 2022-03-09 09:15
marcanlike how do you do distro installs? from USB? that means if you're already doing secureboot then, you have a chain break in the USB boot mechanism
#asahi-dev · 2022-03-09 09:14
marcanthere's a lot of hard bootstrapping problems to this whole secureboot thing
#asahi-dev · 2022-03-09 09:11
marcanand... no.
#asahi-dev · 2022-03-09 09:11
marcanwhich would mean m1n1 APFS driver
#asahi-dev · 2022-03-09 09:11
marcanand that's in APFS
#asahi-dev · 2022-03-09 09:11
marcanproblem is I think the SEP wants xARTS storage for a lot of stuff
#asahi-dev · 2022-03-09 09:10
marcanso at the very least we'll have to provision distro keys in top-level m1n1, and distros will have to ship a signed m1n1+u-boot second stage that then contains the hardcoded UEFI secure boot keys they use for the rest of the story
#asahi-dev · 2022-03-09 09:10
marcanand certainly no *secure* EFI variable storage
#asahi-dev · 2022-03-09 09:09
marcanjannau: UEFI secure boot requires key provisioning, but we don't have sane EFI variable storage to store that
#asahi-dev · 2022-03-09 09:09
marcanthere are probably cases where that fails and requires a full wipe though, no idea what happens if e.g. the GPT is mangled
#asahi-dev · 2022-03-09 09:08
marcanyou can use the "revive" option if you just borked system recovery, and that should leave your OS partition intact, though honestly you'd have to try pretty hard to break that too
#asahi-dev · 2022-03-09 09:07
marcanif you lose recovery you need to DFU restore
#asahi-dev · 2022-03-09 09:06
marcanrecovery mode just sets up a SAMBA share over USB networking or something
#asahi-dev · 2022-03-09 09:06
marcanthere's no target disk mode per se
#asahi-dev · 2022-03-09 09:06
marcanyup
#asahi-dev · 2022-03-09 09:02
marcangiven the hardware security of these machines, and that AIUI all NVMe data should be encrypted at rest by the controller anyway, just that alone should be rather strong security
#asahi-dev · 2022-03-09 09:01
marcanso you couldn't use it to take over stuff stored in the ESP even without signatures
#asahi-dev · 2022-03-09 09:01
marcansince enabling FileVault gates 1TR behind an authentication step
#asahi-dev · 2022-03-09 09:00
marcanthat won't verify things, but will disable any way to take over the machine without a full wipe or disassembling it, in principle
#asahi-dev · 2022-03-09 09:00
marcanfor now, you should probably just enable FileVault in macOS and set up u-boot/grub to disable the console
#asahi-dev · 2022-03-09 08:56
marcanso, all much further in the future, probably by which point we'll want to have not just m1n1 upgrades but stub firmware upgrades implemented too
#asahi-dev · 2022-03-09 08:55
marcanand none of this really makes much sense without SEP support too, to aid in the crypto and take advantage of some of Apple's own engineering
#asahi-dev · 2022-03-09 08:55
marcanbut that's a long-shot goal for us as far as I'm concerned
#asahi-dev · 2022-03-09 08:54
marcanbuilding transparent secureboot for the masses is a much harder problem, which is why it's cool that Apple is doing it :-)
#asahi-dev · 2022-03-09 08:54
marcanmy goal with secureboot is to make it *possible* and engineer things such that we can support it; but I think the majority of users don't care, and those who do will probably want to roll their own tweaks anyway
#asahi-dev · 2022-03-09 08:53
marcanso an end-user ready secureboot option will come much later and will probably involve a full reinstall from our POV; users who want to roll their own transition of course can do that and upgrade from 1TR at that point
#asahi-dev · 2022-03-09 08:52
marcansecureboot only makes sense if you encrypt your rootfs (and ideally hashtree sign it too), which we aren't doing

plus ›