Page MenuHomeFreeBSD

dev/psci: Use the correct SMCCC TRNG field
ClosedPublic

Authored by andrew on Jun 23 2025, 12:46 PM.
Tags
None
Referenced Files
F175289095: D50979.id157449.diff
Fri, Oct 9, 5:10 PM
Unknown Object (File)
Thu, Sep 24, 6:37 AM
Unknown Object (File)
Thu, Sep 24, 5:55 AM
Unknown Object (File)
Fri, Sep 11, 1:26 PM
Unknown Object (File)
Sep 8 2026, 10:37 PM
Unknown Object (File)
Sep 8 2026, 8:29 AM
Unknown Object (File)
Sep 6 2026, 2:13 AM
Unknown Object (File)
Sep 5 2026, 1:49 PM
Subscribers

Details

Summary

The TRNG service will return random data in x3. Use the correct field
when filling the buffer in trng_read.

This driver has not been in any release, so no security advisory is
needed.

Sponsored by: Arm Ltd

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bz added a subscriber: bz.
bz added inline comments.
sys/dev/psci/smccc_trng.c
116

Why are we limiting ourselves to 64 bits when the TRNG can return 192 on SMC64? Or do I misread https://developer.arm.com/documentation/den0098/latest/ ?
it leads to the next question below:

125

While true for 64bit of entropy as limited above for SMC64, I assume we do not use this on SCM32 (seems we don't).

Can we extend this to allow up-to 192 bits of entropy and use A3..A2..A1 for [0..63][64..127][128..191]? Does it make sense to do so?

This revision is now accepted and ready to land.Jun 24 2025, 8:47 PM
sys/dev/psci/smccc_trng.c
116

random_sources_feed only ever asks for 64-bits so it simplifies the code to just read that

This revision was automatically updated to reflect the committed changes.