Re: [PATCH vfs.fixes] eventpoll: Prevent hang in epoll_wait

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Apr 29, 2025 at 9:22 PM Joe Damato <jdamato@xxxxxxxxxx> wrote:
> In commit 0a65bc27bd64 ("eventpoll: Set epoll timeout if it's in the
> future"), a bug was introduced causing the loop in ep_poll to hang under
> certain circumstances.
>
> When the timeout is non-NULL and ep_schedule_timeout returns false, the
> flag timed_out was not set to true. This causes a hang.
>
> Adjust the logic and set timed_out, if needed, fixing the original code.

Hi Joe,

we have been working on the fix at the same time, this is my fix:

 https://lore.kernel.org/linux-fsdevel/20250429185827.3564438-1-max.kellermann@xxxxxxxxx/T/#u

I think mine is better because it checks "eavail" before setting
"timed_out", preserving the old behavior (before commit 0a65bc27bd64).
Your version may set "timed_out" and thus does an unnecessary
list_empty() call in the following block. (And maybe it can reset
"evail" to false?)

Max





[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux