]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
inet_diag: annotate data-races around inet_diag_table[]
authorEric Dumazet <edumazet@google.com>
Mon, 22 Jan 2024 11:25:56 +0000 (11:25 +0000)
committerSasha Levin <sashal@kernel.org>
Tue, 26 Mar 2024 22:19:22 +0000 (18:19 -0400)
commit9311cc6658b1a392cdcf8202421f7f62f37cb525
tree0dbe79f38cbf1a47f476eaf008400ac5fcddc8f5
parent96ba0fc3b7a979c1f7670570f7a60167cda2a96b
inet_diag: annotate data-races around inet_diag_table[]

[ Upstream commit e50e10ae5d81ddb41547114bfdc5edc04422f082 ]

inet_diag_lock_handler() reads inet_diag_table[proto] locklessly.

Use READ_ONCE()/WRITE_ONCE() annotations to avoid potential issues.

Fixes: d523a328fb02 ("[INET]: Fix inet_diag dead-lock regression")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Guillaume Nault <gnault@redhat.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/ipv4/inet_diag.c