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

Re: [XEN PATCH v1] libxl: use getrandom() syscall for random data extraction



Hi,

On 24/05/2021 09:58, Sergiy Kibrik wrote:
Simplify libxl__random_bytes() routine by using a newer dedicated syscall.
This allows not only to substantially reduce its footprint, but syscall also
considered to be safer and generally better solution:

https://lwn.net/Articles/606141/

getrandom() available on Linux, FreeBSD and NetBSD.

From the man:

VERSIONS
getrandom() was introduced in version 3.17 of the Linux kernel. Support was added to glibc in version 2.25.

If I am not mistaken glibc 2.25 was released in 2017. Also, the call was only introduced in FreeBSD 12.

So I think we want to check if getrandom() can be used. We may also want to consider to fallback to read /dev/urandom if the call return ENOSYS.

Cheers,

--
Julien Grall



 


Rackspace

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