Skip to content

Commit c3c7749

Browse files
CameronNemocnemo-cenic
authored andcommitted
fix(urandom): avoid uninitialized read during boot
Regenerating the stored seed was an attempt to prevent hard shutdowns from leading to seed reuse. Unfortunately, this practice depletes any entropy that was added by the seed. Furthermore on newer kernels which do not credit entropy added from userspace, the operation is often an uninitialized read of urandom.
1 parent abd5e95 commit c3c7749

1 file changed

Lines changed: 0 additions & 1 deletion

File tree

core-services/05-misc.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ halt -B # for wtmp
66
if [ -z "$VIRTUALIZATION" ]; then
77
msg "Initializing random seed..."
88
cp /var/lib/random-seed /dev/urandom >/dev/null 2>&1 || true
9-
( umask 077; bytes=$(cat /proc/sys/kernel/random/poolsize) || bytes=512; dd if=/dev/urandom of=/var/lib/random-seed count=1 bs=$bytes >/dev/null 2>&1 )
109
fi
1110

1211
msg "Setting up loopback interface..."

0 commit comments

Comments
 (0)