]> git.baikalelectronics.ru Git - kernel.git/commit
ipv6: Fix data races around sk->sk_prot.
authorKuniyuki Iwashima <kuniyu@amazon.com>
Thu, 6 Oct 2022 18:53:48 +0000 (11:53 -0700)
committerJakub Kicinski <kuba@kernel.org>
Thu, 13 Oct 2022 00:50:37 +0000 (17:50 -0700)
commit73e16f9fd32c6f4d29aee231d99137f0fe8cdbac
tree50c240c1c6b235eef2930d133396fb19cfd34127
parent51e90c02386ed01be471c963184a0a2ef7afb6b3
ipv6: Fix data races around sk->sk_prot.

Commit 049542f33ed4 ("ipv6: annotate some data-races around sk->sk_prot")
fixed some data-races around sk->sk_prot but it was not enough.

Some functions in inet6_(stream|dgram)_ops still access sk->sk_prot
without lock_sock() or rtnl_lock(), so they need READ_ONCE() to avoid
load tearing.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/core/sock.c
net/ipv4/af_inet.c
net/ipv6/ipv6_sockglue.c