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
Unknown Object (File)
Fri, Apr 3, 10:54 AM
Unknown Object (File)
Thu, Apr 2, 9:08 AM
Unknown Object (File)
Thu, Mar 26, 8:18 PM
Unknown Object (File)
Thu, Mar 26, 3:11 PM
Unknown Object (File)
Wed, Mar 25, 1:03 AM
Unknown Object (File)
Tue, Mar 24, 2:39 PM
Unknown Object (File)
Thu, Mar 12, 6:25 PM
Unknown Object (File)
Thu, Mar 12, 5:09 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.