mbox series

[0/5] poll_wait: add mb() to fix theoretical race between waitqueue_active() and .poll()

Message ID 20250107162649.GA18886@redhat.com (mailing list archive)
Headers show
Series poll_wait: add mb() to fix theoretical race between waitqueue_active() and .poll() | expand

Message

Oleg Nesterov Jan. 7, 2025, 4:26 p.m. UTC
Linus,

I misread fs/eventpoll.c, it has the same problem. And more __pollwait()-like
functions, for example p9_pollwait(). So 1/5 adds mb() into poll_wait(), not
into __pollwait().

WangYuli, after 1/5 we can reconsider your patch.

Oleg.
---

 include/linux/poll.h | 26 ++++++++++++--------------
 include/net/sock.h   | 17 +++++++----------
 io_uring/io_uring.c  |  9 ++++-----
 3 files changed, 23 insertions(+), 29 deletions(-)

Comments

Linus Torvalds Jan. 7, 2025, 5:38 p.m. UTC | #1
On Tue, 7 Jan 2025 at 08:27, Oleg Nesterov <oleg@redhat.com> wrote:
>
> I misread fs/eventpoll.c, it has the same problem. And more __pollwait()-like
> functions, for example p9_pollwait(). So 1/5 adds mb() into poll_wait(), not
> into __pollwait().

Ack on all five patches, looks sane to me.

Christian, I'm assuming this goes through your tree? If not, holler,
and I can take it directly.

            Linus
Jens Axboe Jan. 7, 2025, 10:55 p.m. UTC | #2
On 1/7/25 10:38 AM, Linus Torvalds wrote:
> On Tue, 7 Jan 2025 at 08:27, Oleg Nesterov <oleg@redhat.com> wrote:
>>
>> I misread fs/eventpoll.c, it has the same problem. And more __pollwait()-like
>> functions, for example p9_pollwait(). So 1/5 adds mb() into poll_wait(), not
>> into __pollwait().
> 
> Ack on all five patches, looks sane to me.
> 
> Christian, I'm assuming this goes through your tree? If not, holler,
> and I can take it directly.

Same, series looks good.