Messages in this thread | | | From | Linus Torvalds <> | Date | Sun, 19 Jun 2022 15:05:23 -0500 | Subject | Re: [GIT pull] locking/urgent for 5.19-rc3 |
| |
On Sun, Jun 19, 2022 at 11:38 AM Jason A. Donenfeld <Jason@zx2c4.com> wrote: > > This was initially my concern too, which I expressed to Sebastian, but > he made the point that this area here is rather "special". Actually, > randomness isn't really required here.
That wasn't really my point.
My point was that there are a lot of uses of prandom_u32() and friends in random places. Just grepping for it, there's lots of different drivers that use it. Who knows what locking they have.
Clearly nobody *thought* about it. This one issue is purely about RT correctness, but how about all the uses that just want a pseudo-random number and may have performance issues, or may be calling things so much that a lock is just bad.
The thing is, that prandom code used to be FAST. Not just "no locks", but also "fairly simple siphash round because its a PSEUDO random thing and shouldn't be anything more".
The whole "make it use the same randomness" may just have been a huge and fundamental mistake.
We've seen one actual outright bug because of it already. That was easy to fix by avoiding the new thing that now was a mistake. What about all the other uses with lock bouncing or whatever subtler issues that aren't pointed out by outright correctness tests?
Linus
| |