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

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


  • To: Julien Grall <julien@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Sergiy Kibrik <Sergiy_Kibrik@xxxxxxxx>
  • Date: Wed, 26 May 2021 09:28:00 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NffypTio3y26g9xeQCvUmpW46XRwRJGf2AwY7Bi4Ho0=; b=GSmQxXMEfFBt70wvuP/h1N9m5ok6XCfzTs2G+kGs9egMCeOE3GtMjlaOwC6+yv2eMf7USxhsIKVs9RTDzXqyAMA3kGI5jBGemjdFyCbe1Ype4g/XBaVTiKY+aiRJIp8L7Sf4BnbWebRrMDUE4oC3EBurnJ9QU6Ci0Sh2r8p0FdL32Gwtqa2fDHHZIbspBTM3AYV0zpxA3pmIpnGCiuquXjTUpTbzoLgDma7USCwkZW/TZRJZC2v6kjt4CMxtSHALYXTbFJJxpQ6z8On/yBr2ICSidcu72mEOU4f5NfSL/qlXUg0wq5ACjlI/cbv9WnZoiVlrumitN0YYxim5QBixgw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=a5dywmKZw7VnbbuGIocqC1NOHlHG4/BJRXA6PSgS3gFdu4op0czPb/7+FgQLJ6oirWKL7F2SsWbryrJ2XqKqsZLyrqUskXVEBhYW2VSJk9pYFWXUjazUOhO/KBN8BthyziMTKLoQFSXsMYGXCshWgFsnVqdcelS8c/LqFAua5EVNeiKO32SULyRPOu1VsE5wU82DomkXEu5m3X3vqt7Gc9hezNFUI1w1ZY36WtHgJWFP8Bgpfg8JpXOKFnulH8A1FanyT0mO2VaQULLHLI+toKZ82aXOhQ/BGOgP9xWJX74Jupoj5TChaYNZJDeZ9ng/iMqPDK2zh+6a7WiEvCUmOQ==
  • Authentication-results: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=epam.com;
  • Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Wed, 26 May 2021 09:28:18 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHXUJ0pDoWarWZCUEmrgeaODNENvKr1enfA
  • Thread-topic: [XEN PATCH v1] libxl/arm: provide guests with random seed

Hi Julien,

> > 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.

> Also, local variables should be defined at the beginning of the function.
> 

Will fix that.

Thank you for review,
  Sergiy

 


Rackspace

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