Linus Torvalds writes: (Summary) wrote:
Delaying sounds ok, I guess.
But the "obvious" implementation may be simple: But the "obvious" implementation may be simple: static void efi_ratelimit(void)
[...]
we just add a delay to each call so that we can't exceed the limit. Delaying sounds ok, I guess.Delaying sounds ok, I guess.
But the "obvious" implementation may be simple: But the "obvious" implementation may be simple: static void efi_ratelimit(void)
{ static DEFINE_RATELIMIT_STATE(ratelimit, HZ, 100); If you put this all inside a lock like a mutex, you can generate basically arbitrary delays, and you're back to the DoS schenario. A fair lock will allow thousands of waiters to line up and make the delay be But maybe I'm missing some really obvious way. Then one user cannot delay another one.