wrote a few notes about the current status of shipping GNOME as one of two default options on the MNT Reform series devices https://community.mnt.re/t/gnome-integration-notes-issue-tracking/3168/24
GNOME Integration Notes/Issue Tracking

We’ve mostly rolled out GNOME now and shipping a System Image with a GNOME option replacing Wayfire as one of the two defaults on the batch of classic RK3588 MNT Reforms that we’re shipping out to customers this week. I’m really excited about offering everyone a comfy and easy-to-configure default desktop option for the Reform series. My thanks and appreciation go out to the GNOME team for all the hard work that was and is being put into this desktop environment and GTK4. Here’s how it went, r...

MNT Research Community
@mntmn hi, I just read you have gnome now as an official option on one of your devices. My question is now: Would you be interested in official gnome os support? The most interesting feature would be the security aspect I think.
@lw64 hi, i don't know how gnome os works, what's the security aspect?
@mntmn its called "measured boot", a new systemd feature, but it can only work on image based os's, currently gnome os is the first real os using it.
@mntmn It works with the TPM, though maybe on MNT devices it works all a bit different?
@mntmn @lw64 there isn't a TPM, getting equivalent security would require enrolling key fingerprints into the soc by blowing efuses and utilising rpmb and it would be specific to each version (not doable on some soms) and inhibit some elements of user freedom
@cas @mntmn what kind of user freedom?
@lw64 @mntmn to run unsigned code... it's a one way process on most platforms, typically very involved and mesnt to be done at the factory . if you try to make it possible for users to do it they will screw up and hard brick their boards
@cas @mntmn I guess that sucks a bit. How do phones do it? they update the keys during the os update? and in theory when you interrupt it it could get screwed up too?
@lw64 @mntmn no these are totally different levels
@cas @mntmn you need to explain xD

@lw64 @mntmn

ok here's how the chain of trust works on Qualcomm SoCs in Android phones

So qualcomm socs can hold multiple public key hashes, typically this is for Qualcomms signing key, and for the OEMs. These are literally burnt into the silicon at the factory

some early parts of the boot process that are secure are only signed by Qualcomm and vendors can't modify this code (exactly which pieces this is has changed over the years, in 2018 it was only secure world/trustzone but new socs also have the hypervisor locked down). Other parts of the bootloader like the UEFI implementation and ABL (Android bootloader EFI app) are only signed by the vendor, they can modify them as they place.

these key hashes never change, and can't be changed (... mostly).

there is no "updating the keys"

The Android boot image (Linux kernel/initramfs/dtb etc) are all hashed and that hash is signed also by the vendor (all parts here are vendor signed now), all this is stored in the "vbmeta" partition. The boot partition(s) are hashed and checked against this every boot. This is the Android Verified Boot (AVB) process.

When you "unlock the bootloader" all you're doing is disabling the verification of data against the hashes in the vbmeta partition, it's totally skipped.

In theory you can enroll a custom Android Verified Boot key (AVB key), this is stored in the RPMB (look it up but basically it's some special magic write-once rollback protected storage in the MMC/UFS) and allows you to flash your own boot image and own vbmeta signed with your own key, you may then "re-lock" the bootloader, and now you have Android secure boot with your own key.

For mainline purposes this would allow us to re-lock a bootloader where U-Boot is in the boot image, and U-Boot could have EFI secureboot public keys embedded in it, allowing for EFI secureboot!

However, this is all designed with the expectation that you are running software delivered to you like a custom Android ROM. If you the user want to modify the kernel you can't, because you don't have the keys.

the only way to maintain user freedom is to have the user possess their own private keys. Maybe this is doable with some really good tooling, but you also need the user to definitely back up their keys during provisioning and have methods for them to unlock the bootloader again (oh also you need to disable bootloader unlocking after re-locking which is vendor/device specific in most cases, yay)

ok let's forget about the android stuff, when it comes to the earlier parts of the boot chain i hope it's clear that even if you buy unfused devices and intend to blow the fuses yourself, we don't have access to the software needed to do this, and if we did, expecting users to do it themselves would be absurd and require they're able to store the keys. If we do it (e.g. like SHIFT decided to enable vendor secureboot on the new shiftphone 8) it means that their users can't modify the bootloader.

fundamentally the hardware and firmware on these SoCs is not designed for this usecase.

If we wanna treat it like x86 where you jsut enroll your own keys, we can at least do that but it's way more janky and non-standard.

@cas @lw64 @mntmn

Great insight, thanks

@cas @lw64 @mntmn
but hypothetically, if you had an unfused SoC with complete source code for the whole boot chain, would it be possible to implement a firmware TPM, eg. using the TrustZone or the hypervisor?

@mntmn @wolf480pl @lw64 yes, in fact i did just this for Qualcomm IoT, porting TFA and op-tee which can do fw tpm

we dont have the custom signing part though

this work was done in collaboration with Qualcomm

i gave a talk about the work and the technical process a few weeks ago

https://resources.linaro.org/en/resource/vHqDTR9pHQws49XZEu2Str

see also

https://social.treehouse.systems/@cas/114157445722482006

LIS25-129 TF-A and OP-TEE for Qualcomm IoT platforms

Over the last 2 years, Qualcomm and Linaro have been collaborating to enable support for open sou...

Linaro Resources Hub

@cas @lw64 @mntmn hm. An interested phone vendor like Fairphone coooould probably ship full "laptop-grade" UEFI with ABL as "just a default", right?

(Not sure what impact that would have on Google certification for Play services tho lol)

@lw64 @valpackett @mntmn iff they had a good enough UEFI (what they get from qcom is very screwed up, more so than whats on the x1e laptops)

they could perhaps make it so that when you unlock the bootloader you get full uefi access or let you run a u-boot binary signed by them and get an efi that way

if we figure out how to talk to the tz to enroll secrets in the rpmb (the same mechanism the custom_avb_key thing uses) we could probably use that for storing custom efi secureboot keys (actually maybe we could literally have the key you enroll be used this way)

it would take a lot of finegling to do this securely but i reckon it could be done

@z3ntu may have some additional input

@valpackett @cas @lw64 @mntmn The value of full UEFI would be negative. Also, Android is vastly more secure than desktop Linux (Qubes OS excluded).

@alwayscurious @valpackett @lw64 @mntmn i think your balance sheet might be off...

the value of uefi is too standardise, work around the various insane android bootloader quirks, extend user freedoms, and align linux mobile more with its desktop counterpart

os security is another matter entirely, and of course depends heavily on your threat model

@cas @valpackett @lw64 @mntmn I don’t think my balance sheet is off at all. You may have different priorities, but that doesn’t mean that mine are wrong.

@cas @lw64 @mntmn

some questions:
- how was msm8916 devices able to turn off secure boot?
- to add ur own key, how is that usually done? is it via trustzone or something else entirely (there is an exploit to get into msm8960 trustzone, but i dont know enough about it to see why thats important)

@mntmn @Logical_Error @lw64 need to know more about these msm8916 devices

the underlying mechanism for storing keys is rpmb, typically you have to access it from el3 and the trustzone exposes an API for it

@lw64 @mntmn @cas for msm8916, i think minecrell would know more. he showed imgs a long time ago for that. dunno how he did it

would u know the trustzone api that dumps rpmb? i roughly know theres the opensource trustzone implementation somewhere so i could maybe look at that to figure out how its implemented on my device maybe