lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aBAB_4gQ6O_haAjp@google.com>
Date: Mon, 28 Apr 2025 22:32:31 +0000
From: Carlos Llamas <cmllamas@...gle.com>
To: Joe Damato <jdamato@...tly.com>
Cc: Jan Kara <jack@...e.cz>, Christian Brauner <brauner@...nel.org>,
	linux-fsdevel@...r.kernel.org,
	Alexander Viro <viro@...iv.linux.org.uk>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Sridhar Samudrala <sridhar.samudrala@...el.com>,
	Alexander Duyck <alexander.h.duyck@...el.com>,
	open list <linux-kernel@...r.kernel.org>,
	Tudor Ambarus <tudor.ambarus@...aro.org>,
	William McVicker <willmcvicker@...gle.com>
Subject: Re: [PATCH vfs/vfs.fixes v2] eventpoll: Set epoll timeout if it's in
 the future

On Mon, Apr 28, 2025 at 09:50:02AM -0700, Joe Damato wrote:
> Thank you for spotting that and sorry for the trouble.

This was also flagged by our Android's epoll_pwait2 tests here:
https://android.googlesource.com/platform/bionic/+/refs/heads/main/tests/sys_epoll_test.cpp
They would all timeout, so the hang reported by Christian fits.


> Christian / Jan what would be the correct way for me to deal with
> this? Would it be to post a v3 (re-submitting the patch in its
> entirety) or to post a new patch that fixes the original and lists
> the commit sha from vfs.fixes with a Fixes tag ?

The original commit has landed in mainline already, so it needs to be
new patch at this point. If if helps, here is the tag:
Fixes: 0a65bc27bd64 ("eventpoll: Set epoll timeout if it's in the future")

> diff --git a/fs/eventpoll.c b/fs/eventpoll.c
> index 4bc264b854c4..1a5d1147f082 100644
> --- a/fs/eventpoll.c
> +++ b/fs/eventpoll.c
> @@ -2111,7 +2111,9 @@ static int ep_poll(struct eventpoll *ep, struct epoll_event __user *events,
> 
>                 write_unlock_irq(&ep->lock);
> 
> -               if (!eavail && ep_schedule_timeout(to))
> +               if (!ep_schedule_timeout(to))
> +                       timed_out = 1;
> +               else if (!eavail)
>                         timed_out = !schedule_hrtimeout_range(to, slack,
>                                                               HRTIMER_MODE_ABS);
>                 __set_current_state(TASK_RUNNING);

I've ran your change through our internal CI and I confirm it fixes the
hangs seen on our end. If you send the fix feel free to add:

Tested-by: Carlos Llamas <cmllamas@...gle.com>

Cheers,
Carlos Llamas

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ