]> git.baikalelectronics.ru Git - kernel.git/commit
ratelimit: Fix data-races in ___ratelimit().
authorKuniyuki Iwashima <kuniyu@amazon.com>
Tue, 23 Aug 2022 17:46:48 +0000 (10:46 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 24 Aug 2022 12:46:57 +0000 (13:46 +0100)
commit3a82e726674fc0bd83a5a7a3f8e58d4b3fb9fe32
tree6b4e9de4005b45f341c5ef7e66f133e82bb90972
parent984b41ca7e20ea5062ee099024adcab5a9c1406b
ratelimit: Fix data-races in ___ratelimit().

While reading rs->interval and rs->burst, they can be changed
concurrently via sysctl (e.g. net_ratelimit_state).  Thus, we
need to add READ_ONCE() to their readers.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
lib/ratelimit.c