-
Notifications
You must be signed in to change notification settings - Fork 47
Uprev tpm2 tools/tss #1502
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Uprev tpm2 tools/tss #1502
Conversation
|
The changes in commit 8da6c75 are a copy-paste from meta-security (see commit message) while the others are my modifications |
fd72f72 to
2500a48
Compare
|
HUGE stop right there. A much bigger discussion must be had about reverting/downgrading to rsa from ecc. |
It was originally using RSA - I had updated it to ECC with my initial change as it improved the timing of taking TPM ownership, but Chris and I agreed offline that it would have to be revealuated later and I should revert it to RSA for now |
crogers1
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few comments from me. The other thing I'm interested in is if forward sealing worked with the library and API updates. Forward sealing is important because when upgrading the platform, we don't need to boot into an untrusted state to generate a new set of measurements.
seal-system -f
|
|
||
| SUMMARY_initramfs-module-tpm2 = "initramfs support for tpm2" | ||
| RDEPENDS_initramfs-module-tpm2 = "${PN}-base initramfs-module-bootfs tpm2-tools-initrd" | ||
| RDEPENDS_initramfs-module-tpm2 = "${PN}-base initramfs-module-bootfs tpm2-tools tpm2-tss" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only downside here is this brings in all the files in both tpm2-tools and tpm2-tss which greatly increases the size of initrd. The early initramfs only needs to be able to list the pcrs and extend pcr 15. I still think it's worthwhile to define tpm2-tools-initrd and only include the two binaries we need. If we have to eventually .bbappend the tpm2-tools recipe in the future if we incorporate meta-security, that costs virtually nothing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i would recommend naming the package tpm2-tools-pcr, and later we can add any other pcr related utils in it that we might need.
recipes-openxt/xenclient-tpm-scripts/xenclient-tpm-scripts/tpm-functions
Show resolved
Hide resolved
recipes-openxt/xenclient-tpm-scripts/xenclient-tpm-scripts/tpm-functions
Outdated
Show resolved
Hide resolved
|
I'm pretty sure I got forward seal working here:
https://github.com/jandryuk/xenclient-oe/commits/tpm-funcs-5.5/
…On Fri, Jun 27, 2025, 2:11 PM Chris Rogers ***@***.***> wrote:
***@***.**** requested changes on this pull request.
Few comments from me. The other thing I'm interested in is if forward
sealing worked with the library and API updates. Forward sealing is
important because when upgrading the platform, we don't need to boot into
an untrusted state to generate a new set of measurements.
seal-system -f
------------------------------
In recipes-core/initrdscripts/initramfs-framework_%.bbappend
<#1502 (comment)>:
> @@ -57,7 +57,7 @@ RDEPENDS_initramfs-module-tpm = "${PN}-base initramfs-module-bootfs tpm-tools-sa
FILES_initramfs-module-tpm = "/init.d/92-tpm"
SUMMARY_initramfs-module-tpm2 = "initramfs support for tpm2"
-RDEPENDS_initramfs-module-tpm2 = "${PN}-base initramfs-module-bootfs tpm2-tools-initrd"
+RDEPENDS_initramfs-module-tpm2 = "${PN}-base initramfs-module-bootfs tpm2-tools tpm2-tss"
The only downside here is this brings in all the files in both tpm2-tools
and tpm2-tss which greatly increases the size of initrd. The early
initramfs only needs to be able to list the pcrs and extend pcr 15. I still
think it's worthwhile to define tpm2-tools-initrd and only include the
two binaries we need. If we have to eventually .bbappend the tpm2-tools
recipe in the future if we incorporate meta-security, that costs
virtually nothing.
------------------------------
In
recipes-openxt/xenclient-tpm-scripts/xenclient-tpm-scripts/tpm-functions
<#1502 (comment)>:
> ret=$?
- [ ${ret} -ne 0 ] && echo ${err} && return ${ret}
+ rm -f ${h_ctx}
The h_ctx is new with the API changes I'm guessing? Can the filepath for
it be under /tmp instead of wherever this shell is executing?
------------------------------
In
recipes-openxt/xenclient-tpm-scripts/xenclient-tpm-scripts/tpm-functions
<#1502 (comment)>:
> awk -F: '/size:/ { print $2 }' | \
tr -d ' ' )
- # Read the current contents into a temp file.
- # tpm2_nvread could fail, and this ends up being a big pipeline to
- # create an empty file, but that is fine for below.
- tpm2_nvread -x "${tboot_idx}" -a "${TPM_RH_OWNER}" -P "${password}" \
- -s "${size}" -o 0 2>/dev/null \
- | tail -n 1 | tr -d ' ' | hex2bin > "${old_policy}"
+ # Read the current contents into a temp file.
+ # tpm2_nvread could fail, and this ends up being a big pipeline to
+ # create an empty file, but that is fine for below.
+ tpm2_nvread "${tboot_idx}" -C "${TPM_RH_OWNER}" -P "${password}" \
+ -s "${size}" -o "${old_policy}" || true
I would continue to direct output to dev null 2>/dev/null for this
command if the stdout/stderr is still unnecessary.
------------------------------
In recipes-tpm2/tpm2-abrmd/files/tpm2-abrmd-init.sh
<#1502 (comment)>:
> @@ -0,0 +1,65 @@
+#!/bin/sh
Based on the community call we should table the abrmd stuff. Maybe keep it
on a branch on your fork in case we want it down the road, but otherwise I
think we can drop the recipes and support files from this PR.
—
Reply to this email directly, view it on GitHub
<#1502 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAOKZPYSL577RWZSIJTZPXT3FWCNHAVCNFSM6AAAAAB7S7M4PWVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDSNRXGM2DAMZYHE>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
c6dec57 to
2e2fe29
Compare
dpsmith
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't add the bits just to drop them in the next commit. Just squash this commit with the first one and drop all the abrmd changes.
dpsmith
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't do delta commits, this commit is doing nothing but correcting changes you should have done in the prior commits, creating unnecessary churn in the history. Split this up and move the changes back to the respective commits where it belongs.
33b8ff8 to
46eaf45
Compare
dpsmith
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much better, if @crogers1 can confirm an independent build of this commit, then it should be ready to go in.
Thanks, there is also a minor change in the installer I forgot to add you on (fixes one of the TPM commands to align with the new version) - adding you now. As for this PR, I would not merge it yet as I have been having some issues yesterday/today with tpm2_run not executing correctly after the minimal dependency change (tpm2-tss-pcr) causing measured launch to fail. I have an idea of what's going on and will likely push a change for this tomorrow. |
46eaf45 to
9df1489
Compare
|
PR is updated and should be good to go, once Chris does the final review. |
|
Custom build running here: https://openxt.ainfosec.com/buildbot/#/builders/22/builds/97 It includes the installer.git PR as well. |
|
@shahs-ais, I merged the varstore wget PR, rebase this PR,then @crogers1 can kick off the builder to confirm a clean build. |
Deleting old versions of tpm2 tools and tss and replacing with kirkstone implementation in meta-security (commit b9cf9cd639bc8d1b4828eb0bd012b71486d35176), unmodified in this commit
Using direct TPM access (device rather than abrmd TCTI) for now while investigating how to get abrmd working - this aligns with our previous implementation but would like to investigate getting abrmd to work to align with current meta-security impl more closely in the future
These changes align with the uprev to tpm2-tools v5.7 and tpm2-tss v3.2.3, including command line utilities updates and changes in output format of CLI calls - the underlying functionality remains unchanged from the previous version. initramfs recipe was updated to include new dependency with this uprev on tss2 libs.
New tpm2-tools version supports forward sealing, and is implemented here. Conforms to new output format (tpm2_policypcr uses a '=' separator, so convert the ':' used in seal-system). Accounts for systems that may have the extra 'Calling EFI Application from Boot Option' string extended into PCR bank 4.
9df1489 to
bfde7d0
Compare
These changes align with the tpm2 recipe versions used in meta-security, along with tpm2 script modifications corresponding to these new versions.