I wonder why vfat in kconfig does not select these options:
Noticed this while putting together #systemd image. You really cannot use FAT meaningfully without 437, so there should be IMHO either depends or select relation between these and FAT kconfig options.
In my opinion selecting VFAT in 2024 from kconfig should lead to selecting all the options that are required for filenames at minimum because it has exactly two use cases:
In both cases proper interpretation of filenames is required.
PS. I also wonder why systemd does not list them as its required CONFIG_*. They are not obvious kconfig options in the context of kernel QA ;-) I always begin with tinyconfig and add up from there when doing this. Using ESP is required by practical means with systemd-boot so all three options should exist in this file: https://github.com/systemd/systemd/blob/main/README. I used it as a reference and failed.
Ramping up #systemd #kernel #QA: DONE!
URL: https://gitlab.com/jarkkojs/linux-tpmdd-test
Contents:
CMakeLists.txt
Config.in
LICENSE
README.md
board/x86_64/buildroot.conf
board/x86_64/genimage.cfg
board/x86_64/kselftest-tpm2.exp.in
board/x86_64/linux.config
board/x86_64/post-build.sh
board/x86_64/post-image.sh
board/x86_64/run-qemu.sh.in
board/x86_64/run-tests.sh.in
board/x86_64/ssh_config.in
buildroot-2024.02.3.patch
configs/x86_64_defconfig
external.desc
external.mk
I’ve been editing the history while ramping up this starting point but I will stop this chaotic workflow now and commit to this baseline :-) So no worries if sending pull requests…
This is also CI capable environment assuming that runner has:
The GIF-animation shows the proof that it actually also works.
What do in my custom #BuildRoot and #systemd based image to this error:
[FAILED] Failed to mount EFI System Partition Automount.
See 'systemctl status efi.mount' for details.
[ OK ] Finished Update Boot Loader Random Seed.
tpm_tis MSFT0101:00: 2.0 TPM (device-id 0x1, rev-id 1)
random: crng init done
[ OK ] Started Network Name Resolution.
[ OK ] Reached target Host and Network Name Lookups.
Mounting EFI System Partition Automount...
Starting Virtual Console Setup...
[FAILED] Failed to mount EFI System Partition Automount.
See 'systemctl status efi.mount' for details.
[FAILED] Failed to start Automatic Boot Loader Update.
See 'systemctl status systemd-boot-update.service' for details.
I have no idea what those error messages mean.
The source is here: https://gitlab.com/jarkkojs/linux-tpmdd-test
And here’s the output for the “details”:
# systemctl status systemd-boot-update.service
× systemd-boot-update.service - Automatic Boot Loader Update
Loaded: loaded (/usr/lib/systemd/system/systemd-boot-update.service; enabled; preset: enabled)
Active: failed (Result: exit-code) since Wed 2024-06-12 01:50:17 UTC; 2h 58min left
Docs: man:bootctl(1)
Process: 87 ExecStart=bootctl --no-variables --graceful update (code=exited, status=1/FAILURE)
Main PID: 87 (code=exited, status=1/FAILURE)
CPU: 28ms
Jun 12 01:50:15 tpmdd systemd[1]: Starting Automatic Boot Loader Update...
Jun 12 01:50:17 tpmdd bootctl[87]: Failed to open parent directory of "/efi": No such device
Jun 12 01:50:17 tpmdd systemd[1]: systemd-boot-update.service: Main process exited, code=exited, status=1/FAILURE
Jun 12 01:50:17 tpmdd systemd[1]: systemd-boot-update.service: Failed with result 'exit-code'.
Jun 12 01:50:17 tpmdd systemd[1]: Failed to start Automatic Boot Loader Update.
Actually not yet too successful booting my #BuildRoot image with systemd-boot. With grub-efi I got to the login.
EDIT: I think I got it and it is pretty obvious. I’m still deploying GRUB style configs when I construct the disk image with genimage, so I just fix them up as systemd boot style configs (found a reference for that).
So I just follow along [1] and cross my fingers ;-) I think it is good exercise to build from scratch a systemd image from boot to user space in all cases.
[1] https://www.freedesktop.org/wiki/Software/systemd/systemd-boot/
The summary of #systemd #spam of today:
I “systemd” re-initiated the history of my test repository: https://gitlab.com/jarkkojs/linux-tpmdd-test. From now on I commit on keeping a proper versions on this :-) It had no forks so far so I’m the only person who had consequences on that action.
My #systemd feature awareness is always about two years old because you don’t become aware of its features by doing #kernel development :-)
For instance, I had no idea that systemd already natively supported #TPM2 before month or two ago someone told me about systemd-cryptenroll
. I had seen the utility tho in some article but had a blind spot for the prefix.
Now that I’ve seen systemd’s TPM2 implementation in source level I can only say that it is somewhat bloated but I guess it is working fine :-) It is bloated because it would have been better idea just directly use the device. So not a great implementation, but at least a working one. That said, it is not a major glitch but IMHO could be rewritten at some point, with the motivation of decreasing dependencies and compilation times.
In order to address the 1-2 year turn-over issue, I’ll try to get my #BuildRoot build to generate a fully working #systemd environment.
My lessons learned from #ethprague was these are the key algorithms:
I don’t see really any problem make them a bit more “stack compatible”. So maybe something to look at after I get my TPM2 public key patch set into the mainline.
So like when running bunch of servers, how to seal your keys properly, pretty basic stuff.
#teardown and #bootstrap gpg-agent, pcscd to have a working configuration:
#!/usr/bin/env sh
# Copyright (c) Jarkko Sakkinen 2024
# Bootstrap gpg-agent and pcscd for Yubikey use.
GPG_AGENT_SOCKETS=(gpg-agent-ssh.socket
gpg-agent-browser.socket
gpg-agent-extra.socket
gpg-agent-ssh.socket
gpg-agent.socket)
systemctl --user disable --now "${GPG_AGENT_SOCKETS[@]}"
gpgconf --kill gpg-agent
sudo systemctl disable --now pcscd.socket
systemctl --user enable --now gpg-agent.socket gpg-agent-ssh.socket
sudo systemctl enable --now pcscd.socket
Why Curve25519 uses EdDSA for signing, and SECP-P256-R1 and SECP-P256-K1 use ECDSA?
It’s the scale. Curve25519 field has the size that fits within 255 bits, and two previous have the size that fits within 256 bits.
So from that follows:
There is formal backing for this but pure common sense it is exactly like “if loose some, you must gain some” ;-)
I realized that I have something profound broken in my asymmetric TPM2 key series: TPM2 specific keys should only sign, not verify.
struct public_key
, which is the central structure used for built-in, vendor and machine owner keys, should be able to verify the signature, even when the TPM chip is removed.
As a consequence, I will delete all the verification code from the key type(s) and set the supported_ops
a KEYCTL_SUPPORTS_SIGN
, instead of previous KEYCTL_SUPPORTS_SIGN | KEYCTL_SUPPORTS_VERIFY
.
I’ll also rework tests to have two asymmetric keys: one for signing in the chip and other outside holding only the public key. That should also better verify that the feature is working correctly.