hw_random driver unsafe endianness assumption

Andrew Scull ascull at google.com
Mon Feb 7 09:44:28 PST 2022


I was looking over some uses of the SMCCC TRNG interface and came
across the hw_random driver. In copy_from_registers() from
drivers/char/hw_random/arm_smccc_trng.c, the trailing entropy is
copied out of a1 with memcpy(&buf[copied], &res->a1, chunk). That
appears to make an unsafe assumption about endianness?



More information about the linux-arm-kernel mailing list