Skip to content

fix: replace panic with error return in TdxQuote NVIDIA env check#381

Open
sylvaincormier wants to merge 1 commit into0gfoundation:mainfrom
sylvaincormier:fix/phala-panic-to-error
Open

fix: replace panic with error return in TdxQuote NVIDIA env check#381
sylvaincormier wants to merge 1 commit into0gfoundation:mainfrom
sylvaincormier:fix/phala-panic-to-error

Conversation

@sylvaincormier
Copy link
Copy Markdown

Summary

In api/common/tee/phala.go:132, the TdxQuote function calls panic(err) when CheckPythonEnv fails for NVIDIA trust packages. This crashes the entire broker process instead of returning an error to the caller.

Every other error path in this function correctly returns ("", error). This one should too.

Changes

  • Replaced panic(err) with return "", errors.Wrap(err, "failed to check Python environment for NVIDIA trust packages")

Test plan

  • Verify that missing Python environment for NVIDIA packages returns a proper error response instead of crashing the broker
  • Existing TEE attestation flows unaffected (non-NVIDIA paths unchanged)

The CheckPythonEnv call for NVIDIA trust packages uses panic(err) on
failure. This crashes the entire broker process when the Python
environment is misconfigured, instead of returning an error to the
caller. Replace with proper error return consistent with the rest of
the function.
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.

1 participant