[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [XEN PATCH v1] libxl/arm: provide guests with random seed

On 26/05/2021 10:28, Sergiy Kibrik wrote:
Hi Julien,

Hi Sergiy,

diff --git a/tools/libxl/libxl_arm.c b/tools/libxl/libxl_arm.c index
34f8a29056..05c58a428c 100644
--- a/tools/libxl/libxl_arm.c
+++ b/tools/libxl/libxl_arm.c
@@ -342,6 +342,12 @@ static int make_chosen_node(libxl__gc *gc, void
*fdt, bool ramdisk,
           if (res) return res;

+    uint8_t seed[128];

I couldn't find any documentation for the property (although, I have found
code in Linux). Can you explain where the 128 come from?
I didn't find documentation either, probably that part is un-documented yet.
This is kind of tradeoff between ChaCha20 key size of 32 (which is used in 
guest Linux CRNG), and data size that host is expected to provide w/o being 
blocked or delayed
(which is 256 according to getrandom() man page). In case of 128-bytes seed 
each byte of CRNG state will be mixed 4 times using bytes from this seed.

Ok. Can the reasoning be documented in the commit message (with a short summary in the code)? This would be helpful if in the future one decide to change the size of the seed.


Julien Grall



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.