]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
epoll: annotate racy check
authorChristian Brauner <brauner@kernel.org>
Wed, 25 Sep 2024 09:05:16 +0000 (11:05 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 14 Dec 2024 18:51:34 +0000 (19:51 +0100)
commitac98b8c1034686ea6dd803b46fc0ad687430c712
treefb97e2a285e9d4336b177ee5fdab148c330c3c89
parentdc02407ea952e20c544a078a6be2e6f008327973
epoll: annotate racy check

[ Upstream commit 6474353a5e3d0b2cf610153cea0c61f576a36d0a ]

Epoll relies on a racy fastpath check during __fput() in
eventpoll_release() to avoid the hit of pointlessly acquiring a
semaphore. Annotate that race by using WRITE_ONCE() and READ_ONCE().

Link: https://lore.kernel.org/r/66edfb3c.050a0220.3195df.001a.GAE@google.com
Link: https://lore.kernel.org/r/20240925-fungieren-anbauen-79b334b00542@brauner
Reviewed-by: Jan Kara <jack@suse.cz>
Reported-by: syzbot+3b6b32dc50537a49bb4a@syzkaller.appspotmail.com
Signed-off-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/eventpoll.c
include/linux/eventpoll.h