Re: [PATCH v7 0/1] MR10174: bcryptprimitives: Abort if `ProcessPrng` fails
On Wed Feb 25 18:54:58 2026 +0000, Paul Gofman wrote:
I don't really understand why we're doing this in the first place. The documentation often claims things that are wrong especially as related to edge cases. If there's not a foreseeable case where RtlGenRandom() could fail (and I don't think memory exhaustion counts as foreseeable either) then I don't think it's worth touching. Yeah. And I honestly don't see how even memory exhaustion is a bad case here, there is no new allocations on the way. And if page in for previously allocated buffer space fails the process will be OOM killed without our abort. There is actually one real thing in that place: int fd = open( "/dev/urandom", O_RDONLY );
That can fail due to fd exhaustion. But instead of asserting we'd probably be better off caching the fd, file open takes time while getting random values may happen often in some cases (and get_random is used very early for the first time, to fill process cookie). -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10174#note_130526
participants (1)
-
Paul Gofman (@gofman)