ip: Fix data-races around sysctl_ip_fwd_update_priority.
authorKuniyuki Iwashima <kuniyu@amazon.com>
Wed, 13 Jul 2022 20:51:54 +0000 (13:51 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 15 Jul 2022 10:49:55 +0000 (11:49 +0100)
commit7bf9e18d9a5e99e3c83482973557e9f047b051e7
tree7f30b756947599df61a8d23ca811eeafc3e35745
parent60c158dc7b1f0558f6cadd5b50d0386da0000d50
ip: Fix data-races around sysctl_ip_fwd_update_priority.

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

Fixes: 432e05d32892 ("net: ipv4: Control SKB reprioritization after forwarding")
Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
net/ipv4/ip_forward.c