Skip to contentSkip to conversation

eventpoll: Annotate data-race of busy_poll_usecs

PATCH Applied Joe Damato 3 participants 3 messages Aug 6, 2024 – Aug 8, 2024

Subsystems (4)
lore
Share & tools
lore

Joe Damato

author
#0 lore raw

PATCH 1/1 eventpoll: Annotate data-race of busy_poll_usecs

From: Martin Karsten <[email protected]>

A struct eventpoll's busy_poll_usecs field can be modified via a user ioctl at any time. All reads of this field should be annotated with READ_ONCE.

Fixes 85455c795c07 ("eventpoll: support busy poll per epoll instance")
---
 fs/eventpoll.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/eventpoll.c +1 -1
index f53ca4f7fced..6d0e2f547ae7 100644
@@ -420,7 +420,7 @@ static bool busy_loop_ep_timeout(unsigned long start_time,
 
 static bool ep_busy_loop_on(struct eventpoll *ep)
 {
-	return !!ep->busy_poll_usecs || net_busy_loop_on();
+	return !!READ_ONCE(ep->busy_poll_usecs) || net_busy_loop_on();
 }
 
 static bool ep_busy_loop_end(void *p, unsigned long start_time)
Signature · 1 line
2.25.1
maintainer
#1 lore raw
Quoted 10 lines · On Tue, 6 Aug 2024 12:33:01 +0000 Joe Damato wrote:

From: Martin Karsten <[email protected]>

A struct eventpoll's busy_poll_usecs field can be modified via a user ioctl at any time. All reads of this field should be annotated with READ_ONCE.

Fixes 85455c795c07 ("eventpoll: support busy poll per epoll instance")

Christian took the net-next cleanup, I presume he'll take this too.

Signature · 1 line
pw-bot: not-applicable
maintainer Applied
#2 lore raw
In reply to Joe Damato
Quoted 5 lines · Joe Damato

A struct eventpoll's busy_poll_usecs field can be modified via a user ioctl at any time. All reads of this field should be annotated with READ_ONCE.

Applied to the vfs.misc branch of the vfs/vfs.git tree. Patches in the vfs.misc branch should appear in linux-next soon.

Please report any outstanding bugs that were missed during review in a new review to the original patch series allowing us to drop it.

It's encouraged to provide Acked-bys and Reviewed-bys even though the patch has now been applied. If possible patch trailers will be updated.

Note that commit hashes shown below are subject to change due to rebase, trailer updates or similar. If in doubt, please check the listed branch.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs.misc

[1/1] eventpoll: Annotate data-race of busy_poll_usecs

      https://git.kernel.org/vfs/vfs/c/b4988e3bd1f0