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)
Thu, Feb 5, 2:27 AM
Unknown Object (File)
Fri, Jan 30, 9:03 PM
Unknown Object (File)
Sat, Jan 24, 4:47 PM
Unknown Object (File)
Thu, Jan 15, 8:20 PM
Unknown Object (File)
Thu, Jan 15, 8:11 AM
Unknown Object (File)
Dec 7 2025, 2:08 PM
Unknown Object (File)
Nov 26 2025, 5:35 AM
Unknown Object (File)
Nov 22 2025, 1:55 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.