Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 850994

Summary: sys-apps/openrc-0.44.10: urandom service doesn't save random seed on linux kernel 5.18
Product: Gentoo Linux Reporter: Hunor Csordás <csordas.hunor>
Component: Current packagesAssignee: OpenRC Team <openrc>
Status: RESOLVED FIXED    
Severity: normal CC: kfm, sam
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: temporary fix for 0.44

Description Hunor Csordás 2022-06-10 11:54:24 UTC
Created attachment 783857 [details]
temporary fix for 0.44

After upgrading to linux kernel 5.18, the urandom service no longer saves any entropy when stopped (the created /var/lib/misc/random-seed file is empty). This is because the random pool size was reduced to 256 bits in 5.18 when the entropy collector method was changed, while the service script seems to assume the random pool size is always a multiple of 4096 bits.

The problem is (perhaps incidentally) fixed in openrc-0.45 by using the new seedrng service on linux, which doesn't suffer from this problem. Until 0.45 can be stabilized, the attached patch be used to restore the previous functionality.
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-06-10 12:00:50 UTC
I suspect we'd probably prefer to get 0.45 fixed and unmasked but we'll see what William thinks.

(Should be a quick job to fix 0.45, hopefully. Definitely deliberately fixed in 0.45, as zx2c4 was the person who did it.)
Comment 2 William Hubbs gentoo-dev 2022-06-10 16:19:43 UTC
I don't think this fix for 0.44.x would qualify for fast stabilization,
so you will be waiting 30 days for a new release to hit stable for
either 0.44.x or 0.45.x.

OpenRC 0.45.1 has been released and should resolve this issue.