aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/eventpoll.h
diff options
context:
space:
mode:
authorChristian Brauner <brauner@kernel.org>2024-09-25 11:05:16 +0200
committerChristian Brauner <brauner@kernel.org>2024-10-22 11:16:56 +0200
commit6474353a5e3d0b2cf610153cea0c61f576a36d0a (patch)
tree1395d4b47fa1aaf0b08141610ec97a7c2c3f0d57 /include/linux/eventpoll.h
parentfs: support relative paths with FSCONFIG_SET_STRING (diff)
downloadwireguard-linux-6474353a5e3d0b2cf610153cea0c61f576a36d0a.tar.xz
wireguard-linux-6474353a5e3d0b2cf610153cea0c61f576a36d0a.zip
epoll: annotate racy check
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>
Diffstat (limited to '')
-rw-r--r--include/linux/eventpoll.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/eventpoll.h b/include/linux/eventpoll.h
index 3337745d81bd..0c0d00fcd131 100644
--- a/include/linux/eventpoll.h
+++ b/include/linux/eventpoll.h
@@ -42,7 +42,7 @@ static inline void eventpoll_release(struct file *file)
* because the file in on the way to be removed and nobody ( but
* eventpoll ) has still a reference to this file.
*/
- if (likely(!file->f_ep))
+ if (likely(!READ_ONCE(file->f_ep)))
return;
/*