]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
af_unix: Fix a data-race in unix_dgram_peer_wake_me().
authorKuniyuki Iwashima <kuniyu@amazon.com>
Sun, 5 Jun 2022 23:23:25 +0000 (16:23 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 Jun 2022 14:59:35 +0000 (16:59 +0200)
commit95f0ba806277733bf6024e23e27e1be773701cca
treea32c1820a35a4e37b37221425c4e4a169f257160
parent8d8ad067b90f231b8fdb14acee673ca4012f6045
af_unix: Fix a data-race in unix_dgram_peer_wake_me().

[ Upstream commit 662a80946ce13633ae90a55379f1346c10f0c432 ]

unix_dgram_poll() calls unix_dgram_peer_wake_me() without `other`'s
lock held and check if its receive queue is full.  Here we need to
use unix_recvq_full_lockless() instead of unix_recvq_full(), otherwise
KCSAN will report a data-race.

Fixes: 7d267278a9ec ("unix: avoid use-after-free in ep_remove_wait_queue")
Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Link: https://lore.kernel.org/r/20220605232325.11804-1-kuniyu@amazon.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/unix/af_unix.c