ip: Fix a data-race around sysctl_fwmark_reflect.
authorKuniyuki Iwashima <kuniyu@amazon.com>
Wed, 13 Jul 2022 20:51:57 +0000 (13:51 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 15 Jul 2022 10:49:55 +0000 (11:49 +0100)
commit85d0b4dbd74b95cc492b1f4e34497d3f894f5d9a
tree473cbabb0ef1250f586ab45b70f0993ff607e9c1
parent0db232765887d9807df8bcb7b6f29b2871539eab
ip: Fix a data-race around sysctl_fwmark_reflect.

While reading sysctl_fwmark_reflect, it can be changed concurrently.
Thus, we need to add READ_ONCE() to its reader.

Fixes: e110861f8609 ("net: add a sysctl to reflect the fwmark on replies")
Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/ip.h