]> git.baikalelectronics.ru Git - kernel.git/commit
net: Fix data-races around sysctl_mem.
authorKuniyuki Iwashima <kuniyu@amazon.com>
Wed, 6 Jul 2022 23:40:00 +0000 (16:40 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 21 Jul 2022 18:59:20 +0000 (20:59 +0200)
commitb92134197d49342c92603b9a069a0d5453074970
treee9c90b978b01ccd6736f207b66539741cdb5d691
parent63394e39506d8213b3a7f183c0a509989c4a589f
net: Fix data-races around sysctl_mem.

[ Upstream commit 804d72d2ec3deaa1baa1ab79413041a7eb73936c ]

While reading .sysctl_mem, it can be changed concurrently.
So, we need to add READ_ONCE() to avoid data-races.

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>
include/net/sock.h