Skip to content

Attester: remove libtdx feature for TDX attester#1470

Open
Xynnn007 wants to merge 3 commits into
confidential-containers:mainfrom
Xynnn007:attester/tdx-remove-ioctl
Open

Attester: remove libtdx feature for TDX attester#1470
Xynnn007 wants to merge 3 commits into
confidential-containers:mainfrom
Xynnn007:attester/tdx-remove-ioctl

Conversation

@Xynnn007
Copy link
Copy Markdown
Member

No description provided.

@mythi
Copy link
Copy Markdown
Contributor

mythi commented May 13, 2026

Thanks! Just one quick comment: I know at least Openshift does not have RTMRs available so TDX_CMD_GET_REPORT0 ioctl is still needed to do MRCONFIGID parsing.

Could this PR be about dropping tdx-attest-dcap-ioctls featured code only?

@Xynnn007
Copy link
Copy Markdown
Member Author

Xynnn007 commented May 14, 2026

@mythi Thanks for the information. Do you mean that

  1. read/write rtmrs via configfs sysfs
  2. read mrconfigid via configfs
    are not supported by Openshift?

@mythi
Copy link
Copy Markdown
Contributor

mythi commented May 14, 2026

Yes. mrconfigid for initdata is read from report0 ioctl which is available without the DCAP wrapper in the default configuration.

Another clarification: the rtmr abi is not related to configfs reports abi

@Xynnn007 Xynnn007 force-pushed the attester/tdx-remove-ioctl branch 3 times, most recently from 5d91279 to 0397f03 Compare May 14, 2026 08:28
This patch adds the initdata (mr_configid) reading and RTMR
reading/writes via sysfs on TDX platform.

This is a feature of kernel >= 6.16 version.

Signed-off-by: Xynnn007 <xynnn@linux.alibaba.com>
@Xynnn007 Xynnn007 force-pushed the attester/tdx-remove-ioctl branch from 0397f03 to c2e5040 Compare May 14, 2026 09:08
Xynnn007 added 2 commits May 14, 2026 17:26
Now with new version of guest kernel it's practical to use TSM to do
quote generation and use sysfs to do initdata reading/rtmr
read-writing.

This patch deprecates legacy libtdx related features to get quotes.
Also, natively use ioctl to get reports for initdata/rtmr reading on
kernel version < 6.16 and use sysfs to do initdata reading/rtmr
read-writing on kernel version >= 6.16.

Signed-off-by: Xynnn007 <xynnn@linux.alibaba.com>
The tests are ignored because they require to be run inside a TDX guest.

Signed-off-by: Xynnn007 <xynnn@linux.alibaba.com>
@Xynnn007 Xynnn007 force-pushed the attester/tdx-remove-ioctl branch from c2e5040 to dccb63e Compare May 14, 2026 09:26
@Xynnn007 Xynnn007 changed the title Attester: remove ioctl/libtdx feature for TDX attester Attester: remove libtdx feature for TDX attester May 14, 2026
@Xynnn007
Copy link
Copy Markdown
Member Author

Intel's DCAP internally has a compiler switch called V3_DRIVER that controls the type of ioctl writes for RTMR. I've implemented support for this in my PR. For IOR scenarios, the iocuddle crate can only make read requests with the req parameter using unsafe. Maybe there is better ways I did not know to avoid unsafe.

@Xynnn007 Xynnn007 marked this pull request as ready for review May 14, 2026 11:01
@Xynnn007 Xynnn007 requested a review from a team as a code owner May 14, 2026 11:01
@Xynnn007
Copy link
Copy Markdown
Member Author

Test with all configfs/sysfs/ioctl scenarios.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants