]> git.baikalelectronics.ru Git - kernel.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)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 7 Jun 2022 10:07:46 +0000 (12:07 +0200)
commitbd7c10adab6d800da3ed4262f453fdefaef32d6f
tree3d9d258ea6d32322637e142f80c91cb6425eb660
parentadb9f21e00465743751ddbe4afc9d8dd6b8c91ce
af_unix: Fix a data-race in unix_dgram_peer_wake_me().

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: ebc9ffbf8a17 ("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>
net/unix/af_unix.c