@jarkko good timing indeed, a colleague at work was just trying out TPM bus sniffing against Windows and Linux targets. Didn't read the full patch set, does this prevent passive sniffing on existing systems that just use tpm2_nvread without any sessions or are user space changes necessary as well?
@lindi2 @pid_eins good news, Linus pulled my PR’s in queue:https://social.kernel.org/notice/AhrCE3Z7RqcBa1p1Hc. So the changes are now in the mainline.
For security research: HMAC pipe is for the kernel clients we do not want to layer /dev/tpm0
. It can be done just as well in the user space (and should be when required).
I.e. right now for trusted keys, and soon’ish for asymmetric keys (feature requried for x.509 certificates [1]). You can also grep the call sites by:
$ git grep "tpm2_start_auth_session(.*);"
drivers/char/tpm/tpm2-cmd.c: rc = tpm2_start_auth_session(chip);
drivers/char/tpm/tpm2-cmd.c: err = tpm2_start_auth_session(chip);
include/linux/tpm.h:int tpm2_start_auth_session(struct tpm_chip *chip);
security/keys/trusted-keys/trusted_tpm2.c: rc = tpm2_start_auth_session(chip);
security/keys/trusted-keys/trusted_tpm2.c: rc = tpm2_start_auth_session(chip);
security/keys/trusted-keys/trusted_tpm2.c: rc = tpm2_start_auth_session(chip);
x.509 part will be 6.11 feature.
[1] https://datatracker.ietf.org/doc/draft-woodhouse-cert-best-practice/ NOTE: a bit out of date, I chatted quickly with David and he is planning to remove TPM 1.2 and DSA keys from the draft.