Re: [PATCH] exit: Use READ_ONCE() for all oops/warn limit reads

From: Peter Zijlstra
Date: Mon Dec 19 2022 - 06:40:29 EST


On Fri, Dec 16, 2022 at 12:30:28PM -0800, Kees Cook wrote:
> Use a temporary variable to take full advantage of READ_ONCE() behavior.
> Without this, the report (and even the test) might be out of sync with
> the initial test.
>
> Reported-by: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
> Link: https://lore.kernel.org/lkml/Y5x7GXeluFmZ8E0E@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Fixes: 9fc9e278a5c0 ("panic: Introduce warn_limit")
> Fixes: d4ccd54d28d3 ("exit: Put an upper limit on how often we can oops")

Thanks!

Acked-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>