[SRU] hwrng drivers missing in initrd.img
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
initramfs-tools (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Jammy |
Fix Released
|
Undecided
|
Unassigned | ||
Kinetic |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[Impact]
The initialization of the entropy buffer of the urandom device is critical for security.
When booting Jammy 22.04.1 on QEMU riscv64 I see the following warnings:
[ 14.654546] random: lvm: uninitialized urandom read (4 bytes read)
[ 15.247995] random: lvm: uninitialized urandom read (2 bytes read)
[ 22.484719] random: lvm: uninitialized urandom read (4 bytes read)
[ 43.161846] random: lvmconfig: uninitialized urandom read (4 bytes read)
[ 48.862281] random: lvm: uninitialized urandom read (4 bytes read)
Module virtio-rng.ko is missing in initrd.img.
Adding virtio_rng to /etc/initramfs-
Hardware RNG drivers should generally be included in the initrd to provide early entropy.
[Test case]
To reproduce the issue:
Install the prerequisites:
sudo apt-get update
sudo apt-get install opensbi qemu-system-misc u-boot-qemu
Decompress it with
xz -d ubuntu-
Run it in QEMU with
qemu-system-riscv64 \
-machine virt -nographic -m 2048 -smp 4 \
-bios /usr/lib/
-kernel /usr/lib/
-device virtio-
-device virtio-rng-pci \
-drive file=ubuntu-
You can log into the system with user ubuntu, password ubuntu after seeing the message "Cloud-init v. 22.2-0ubuntu1~
Run 'sudo dmesg | grep 'uninitialized urandom'
To test the fix:
Update the initramfs-tools package.
Run 'update-initramfs -k $(uname -r) -u' with MODULES=most (defined in /etc/initramfs-
Unpack the initrd with 'unmkinitramfs /boot/initrd.
Check that [main/]
Reboot and check the kernel log by running 'sudo dmesg | grep 'uninitialized urandom'.
[Where problems could occur]
Adding more drivers increases the size of the initrd. The larger initrd might not fit onto the boot partition. The total size of hw_random drivers on amd64 is less than 150 KiB so this seem improbable.
[Other Info]
n/a
tags: | added: rls-kk-incoming |
information type: | Private Security → Public |
tags: | removed: rls-kk-incoming |
Changed in initramfs-tools (Ubuntu Kinetic): | |
status: | New → Fix Released |
description: | updated |
description: | updated |
description: | updated |
summary: |
- hwrng drivers missing in initrd.img + [SRU] hwrng drivers missing in initrd.img |
Changed in initramfs-tools (Ubuntu Jammy): | |
assignee: | nobody → Heinrich Schuchardt (xypron) |
description: | updated |
description: | updated |
Changed in initramfs-tools (Ubuntu Jammy): | |
assignee: | Heinrich Schuchardt (xypron) → nobody |
Changed in initramfs-tools (Ubuntu Jammy): | |
status: | Confirmed → In Progress |
Sponsored for kinetic.