]> git.proxmox.com Git - mirror_ubuntu-jammy-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)
committerStefan Bader <stefan.bader@canonical.com>
Mon, 17 Oct 2022 09:57:47 +0000 (11:57 +0200)
commit84ee32cfb0400589d6013ce6d0a2d6478c054eea
treedecd3b2cbb946693975c5c632cd86fe526f26a30
parente8344e5b18ff242dc92b32d08e7856e577d6fbf3
ratelimit: Fix data-races in ___ratelimit().

BugLink: https://bugs.launchpad.net/bugs/1991717
[ Upstream commit 6bae8ceb90ba76cdba39496db936164fa672b9be ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
lib/ratelimit.c