Skip to content
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

[Bug Report] Fails to establish TPM connection #3431

Open
emilm opened this issue Feb 15, 2024 · 1 comment
Open

[Bug Report] Fails to establish TPM connection #3431

emilm opened this issue Feb 15, 2024 · 1 comment
Labels
bug Something isn't working.

Comments

@emilm
Copy link

emilm commented Feb 15, 2024

Context

  • OS, version, SKU and CPU architecture used: yocto kirkstone with kernel 5.15, arm32v7
  • Application's .NET Target Framework : 6.0
  • Device: Raspberry PI3
  • SDK version used: Microsoft.Azure.Devices.Provisioning.Security.Tpm Version 1.15.0-preview-00

Description of the issue

Fails to acquire TPM device. It worked before but I have upgraded OS and kernel etc so it might be that or the container image being too old. I am not sure where that response comes from, whether it's a generic error or if the return codes have changed or at what level.

I use cr.microsoft.com/dotnet/runtime:6.0.15-bullseye-slim-arm32v7.
With packages:
libtss2-tcti-tabrmd-dev
tpm2-tools
tpm2-abrmd \

Host OS has :
tpm2-tss 3.2.2
tpm2-tools 5.2
tpm2-abrmd 2.4.1

Code sample exhibiting the issue

using var secProvTpm = new SecurityProviderTpmHsm(deviceId);
var authenticationMethod = new DeviceAuthenticationWithTpm(deviceId, secProvTpm);
_logger.LogInformation("Creating Device Client with TPM");
deviceClient = DeviceClient.Create(iotHubHostName, authenticationMethod, Util.GetTransportTypeFromEnvironment());

Console log of the issue

`Closing TCTI conn
TCTI conn closed!
AbrmdWrapper: Got pointer to TctiProvInfo from abrmd!
AbrmdWrapper: Unmarshaled TctiProvInfo
AbrmdWrapper: Initial call to tcti_init_fn() returned 0; ctxSize = 88
AbrmdWrapper: Successfully initialized TCTI ctx

** (process:1): WARNING **: 15:28:19.955: Failed to create connection with service: Method ?CreateConnection? returned type ?(t)?, but expected ?(aht)?
AbrmdWrapper: Unmarshaled TCTI_CTX`

@emilm emilm added the bug Something isn't working. label Feb 15, 2024
@emilm
Copy link
Author

emilm commented Feb 15, 2024

I upgraded to mcr.microsoft.com/dotnet/runtime:6.0.27-bookworm-slim-arm32v7 in the container and the error disappeared but the process natively crashes:

ANOM_ABEND auid=4294967295 uid=0 gid=0 ses=4294967295 pid=9000 comm=2E4E455420546872656164506F6F6C exe="/usr/share/dotnet/dotnet" sig=11 res=1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working.
Projects
None yet
Development

No branches or pull requests

1 participant