| Summary: | Add support for paravirtualized hardware random number generator for qemu machines | ||
|---|---|---|---|
| Product: | [Build System, Metadata & Runtime] OE-Core | Reporter: | Cristian Iorga <cristian.iorga> |
| Component: | virtual machines | Assignee: | Saul Wold <sgw> |
| Status: | RESOLVED FIXED | QA Contact: | Costin <costin.c.constantin> |
| Severity: | enhancement | ||
| Priority: | Medium+ | CC: | alexandru.c.georgescu |
| Version: | 2.1 | ||
| Target Milestone: | 2.1 M3 | ||
| Hardware: | Other | ||
| OS: | Multiple | ||
| Whiteboard: | |||
| OS type for building Yocto: | --- | Type of Regression: | --- |
| Verified: | Documentation change: | Don't know | |
| Bug Depends on: | |||
| Bug Blocks: | 8681 | ||
|
Description
Cristian Iorga
2015-12-16 11:33:32 UTC
References: 1. About Random Numbers and Virtual Machines http://log.amitshah.net/2013/01/about-random-numbers-and-virtual-machines/ 2. QEMU Features-Done/VirtIORNG http://wiki.qemu.org/Features-Done/VirtIORNG 3. QEMU/Devices/Virtio https://en.wikibooks.org/wiki/QEMU/Devices/Virtio Design started. Implementation is dependent on Linux features that will be active in 4.4, so implementation is postponed until poky master switches to Linux 4.4. Kernel config fragments: CONFIG_HW_RANDOM=y CONFIG_HW_RANDOM_VIRTIO=y runqemu params: runqemu qemux86-64 core-image-sato kvm qemuparams="-object rng-random,filename=/dev/urandom,id=rng0 -device virtio-rng-pci,rng=rng0" Check paravirtualization: cat /sys/devices/virtual/misc/hw_random/rng_available cat /sys/devices/virtual/misc/hw_random/rng_current cat /dev/hwrng rng-tools are needed: Link /dev/hwrng to /dev/random rngd -r /dev/hwrng RNG-tools Source: http://sourceforge.net/projects/gkernel/files/rng-tools/ Other possible sources: https://qa.debian.org/cgi-bin/vcswatch?package=rng-tools # rngd -r /dev/urandom Takes from /dev/urandom (non-blocking) to generate entropy for /dev/random (blocking) Links that might help: https://wiki.archlinux.org/index.php/Rng-tools http://security.stackexchange.com/questions/39992/is-it-safe-to-use-rng-tools-on-a-virtual-machine #Next Steps# 1. Add rng-tools to core-image-sato image 2. How it can be added only for qemu machines? 3. Create link 4. Update runqemu for the inclusion of paravirtualized random number generator 5. Update the kernel config fragments 6. Move rng-tools from meta-oe to oe-core (??) Pushing to M3 due to change of resources These two patches add rng-tools to the qemu images and increase the availablity of entropy bits http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=6740dd55798641a47744b891aa1d8fa5e04c2cdc http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=ce3df21122d7fc4ede6fe36009afb297004672ef The Kernel configs have been updated to include the HW_RANDOM_VIRTIO and HW_RANDOM in virtio.cfg of the yocto-kernel-cache. |