Current-Users archive

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

Re: getrandom() error with linux emulation





On 19/11/22 12:31, Brook Milligan wrote:
I am running a linux application (no source code unfortunately) and encountering an error that seems from the message (which is cryptic) to be related to a getrandom() function call.  This is with a NetBSD/amd64 9.99.99 kernel dating from August.

I recall all the discussions floating around about the random generator functions, but did not fully track them.  Now I wonder if that is relevant somehow.

Probably not. I think the /etc/rc.d/ script got updated to provide a smoother system admin experience.

You can run "sysctl kern.entropy.needed" to see if your system is waiting for more entropy. The value should be 0 if your system has enough entropy.

You can also run "rndctl -l" to list entropy sources. There should be at least two rows (and probably only two rows) with a non-zero "Estimated bits" value. One of them will be the "seed" device which is the seed from /var/db/entropy-file, and there should be some other hardware dependent device with a type of "rng" which is your CPU's random number generate (assuming your CPU has one, modern ones do).

Are there differences between between NetBSD and Linux in the getrandom() function or implementations that would cause emulation to fail?

Is there any way to debug this kind of situation?

I generally sift through the output from ktruss and try and infer some kind of application behaviour. Sometimes that works.

Cheers,
Lloyd


Home | Main Index | Thread Index | Old Index