[Bug 194204] getentropy(2): sys call from openbsd

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Wed Nov 5 13:08:11 UTC 2014


Mateusz Guzik <mjg at FreeBSD.org> changed:

           What    |Removed                     |Added
                 CC|                            |mjg at FreeBSD.org

--- Comment #2 from Mateusz Guzik <mjg at FreeBSD.org> ---
I'm confused with this patch.

OpenBSD implementation returns EIO for too big buffers, although apparently
this was not the behaviour from the start. Previously it filled up to 256
bytes, but also indicated how many bytes were returned.

Your patch fills up to 256 bytes and does not tell the caller how many bytes it
got, which is a big no-no.

We should stick to what is in OpenBSD, so please update the patch to return EIO
when needed.

memset you put there is buggy. explicit_zero or equivalent is needed and if we
don't have that in the kernel one will need to be ported as well.

Cannot comment on arc4rand usefulness for this purpose though.

You are receiving this mail because:
You are the assignee for the bug.

More information about the freebsd-bugs mailing list