netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] eventpoll: Annotate data-race of busy_poll_usecs
@ 2024-08-06 12:33 Joe Damato
  2024-08-08  3:22 ` Jakub Kicinski
  2024-08-08  7:13 ` Christian Brauner
  0 siblings, 2 replies; 3+ messages in thread
From: Joe Damato @ 2024-08-06 12:33 UTC (permalink / raw)
  To: linux-kernel, linux-fsdevel
  Cc: netdev, Martin Karsten, stable, Joe Damato, Alexander Viro,
	Christian Brauner, Jan Kara, Stanislav Fomichev, David S. Miller,
	Eric Dumazet

From: Martin Karsten <mkarsten@uwaterloo.ca>

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")
Cc: stable@vger.kernel.org
Signed-off-by: Martin Karsten <mkarsten@uwaterloo.ca>
Reviewed-by: Joe Damato <jdamato@fastly.com>
---
 fs/eventpoll.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/eventpoll.c b/fs/eventpoll.c
index f53ca4f7fced..6d0e2f547ae7 100644
--- a/fs/eventpoll.c
+++ b/fs/eventpoll.c
@@ -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)
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net] eventpoll: Annotate data-race of busy_poll_usecs
  2024-08-06 12:33 [PATCH net] eventpoll: Annotate data-race of busy_poll_usecs Joe Damato
@ 2024-08-08  3:22 ` Jakub Kicinski
  2024-08-08  7:13 ` Christian Brauner
  1 sibling, 0 replies; 3+ messages in thread
From: Jakub Kicinski @ 2024-08-08  3:22 UTC (permalink / raw)
  To: Joe Damato
  Cc: linux-kernel, linux-fsdevel, netdev, Martin Karsten, stable,
	Alexander Viro, Christian Brauner, Jan Kara, Stanislav Fomichev,
	David S. Miller, Eric Dumazet

On Tue,  6 Aug 2024 12:33:01 +0000 Joe Damato wrote:
> From: Martin Karsten <mkarsten@uwaterloo.ca>
> 
> 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")
> Cc: stable@vger.kernel.org
> Signed-off-by: Martin Karsten <mkarsten@uwaterloo.ca>
> Reviewed-by: Joe Damato <jdamato@fastly.com>

Christian took the net-next cleanup, I presume he'll take this too.
-- 
pw-bot: not-applicable

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net] eventpoll: Annotate data-race of busy_poll_usecs
  2024-08-06 12:33 [PATCH net] eventpoll: Annotate data-race of busy_poll_usecs Joe Damato
  2024-08-08  3:22 ` Jakub Kicinski
@ 2024-08-08  7:13 ` Christian Brauner
  1 sibling, 0 replies; 3+ messages in thread
From: Christian Brauner @ 2024-08-08  7:13 UTC (permalink / raw)
  To: linux-kernel, linux-fsdevel, Joe Damato
  Cc: Christian Brauner, netdev, Martin Karsten, stable, Alexander Viro,
	Jan Kara, Stanislav Fomichev, David S. Miller, Eric Dumazet

On Tue, 06 Aug 2024 12:33:01 +0000, Joe Damato wrote:
> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-08-08  7:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-06 12:33 [PATCH net] eventpoll: Annotate data-race of busy_poll_usecs Joe Damato
2024-08-08  3:22 ` Jakub Kicinski
2024-08-08  7:13 ` Christian Brauner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).