cipso: Fix data-races around sysctl.
authorKuniyuki Iwashima <kuniyu@amazon.com>
Wed, 6 Jul 2022 23:40:01 +0000 (16:40 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 21 Jul 2022 19:24:21 +0000 (21:24 +0200)
commit07b0caf8aeb9b82e6ecc6c292a3e47c7fcdb1148
tree06558ea309ee0e9bdaca85e5038bcaeea7b33300
parenta5796154b56fcc8f442a499fd3b7a17bf3d82fb1
cipso: Fix data-races around sysctl.

[ Upstream commit dd44f04b9214adb68ef5684ae87a81ba03632250 ]

While reading cipso sysctl variables, they can be changed concurrently.
So, we need to add READ_ONCE() to avoid data-races.

Fixes: 446fda4f2682 ("[NetLabel]: CIPSOv4 engine")
Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Acked-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Documentation/networking/ip-sysctl.rst
net/ipv4/cipso_ipv4.c