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)
Sun, Sep 21, 7:01 AM
Unknown Object (File)
Mon, Sep 15, 6:24 PM
Unknown Object (File)
Mon, Sep 15, 12:49 AM
Unknown Object (File)
Sat, Sep 13, 11:05 PM
Unknown Object (File)
Sat, Sep 13, 12:17 PM
Unknown Object (File)
Sat, Sep 13, 8:20 AM
Unknown Object (File)
Sep 9 2025, 2:14 PM
Unknown Object (File)
Sep 8 2025, 11:21 AM
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.