0

I'm trying to initialise the entropy pool in Linux random(4) at kernel build time with data from the building machine's /dev/urandom. Initialising it at boot time is sometimes tricky & this solves that problem in some cases.

I've written code that does that, but it was pretty ugly. Generate source code for an initialised pool[] array, #include it into the driver, & mess with the makefile to ensure the array is rebuilt on every compile & deleted afterward so an enemy cannot read it.

It would be cleaner to just generate a chunk of binary data, say pool.o, & link that into the driver. You'd still need to mess with the makefile some.

My question is: how would I access that array from the rest of the driver code. I suspect I need some incantation along the lines of: static u32 *pool = __pool.o ; but I've no idea exactly what.

Sandy
  • 61
  • 2
  • "so an enemy cannot read it" an enemy doesn't need to know the pool in order to successfully mount a replay attack. It is sufficient that the pool is always the same on every boot. – n. 1.8e9-where's-my-share m. Aug 14 '21 at 13:36

0 Answers0