Page MenuHomeFreeBSD

dev/psci: Use the correct SMCCC TRNG field
ClosedPublic

Authored by andrew on Mon, Jun 23, 12:46 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Jul 11, 3:26 AM
Unknown Object (File)
Wed, Jun 25, 11:23 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.Tue, Jun 24, 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.