]> git.baikalelectronics.ru Git - kernel.git/commit
net: datagram: fix data-races in datagram_poll()
authorEric Dumazet <edumazet@google.com>
Tue, 9 May 2023 17:31:31 +0000 (17:31 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 30 May 2023 11:44:02 +0000 (12:44 +0100)
commitdc83ea495bffc24758d21127544bf3e0bbf6cafb
tree81c8805890ded9fe57b8ad18df8170149f7e7732
parent853305d4e549935d77a88ac3cf703bf3c25f1013
net: datagram: fix data-races in datagram_poll()

[ Upstream commit 5bca1d081f44c9443e61841842ce4e9179d327b6 ]

datagram_poll() runs locklessly, we should add READ_ONCE()
annotations while reading sk->sk_err, sk->sk_shutdown and sk->sk_state.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Link: https://lore.kernel.org/r/20230509173131.3263780-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/core/datagram.c