[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c02a5a3c-c617-b0d2-28a0-462f26b0c1c8@huawei.com>
Date: Fri, 8 Mar 2019 19:16:28 +0800
From: "zhengbin (A)" <zhengbin13@...wei.com>
To: Al Viro <viro@...iv.linux.org.uk>,
Linus Torvalds <torvalds@...ux-foundation.org>
CC: Eric Dumazet <eric.dumazet@...il.com>,
David Miller <davem@...emloft.net>,
Jason Baron <jbaron@...mai.com>, <kgraul@...ux.ibm.com>,
<ktkhai@...tuozzo.com>, <kyeongdon.kim@....com>,
Linux List Kernel Mailing <linux-kernel@...r.kernel.org>,
Netdev <netdev@...r.kernel.org>, <pabeni@...hat.com>,
<syzkaller-bugs@...glegroups.com>, <xiyou.wangcong@...il.com>,
Christoph Hellwig <hch@....de>, <bcrl@...ck.org>,
<linux-fsdevel@...r.kernel.org>, <linux-aio@...ck.org>,
<houtao1@...wei.com>, <yi.zhang@...wei.com>
Subject: Re: [PATCH 2/8] aio_poll_wake(): don't set ->woken if we ignore the
wakeup
So, what should we do?
On 2019/3/7 10:18, Al Viro wrote:
> On Thu, Mar 07, 2019 at 12:03:10AM +0000, Al Viro wrote:
>> From: Al Viro <viro@...iv.linux.org.uk>
>>
>> In case of early wakeups, aio_poll() assumes that aio_poll_complete()
>> has either already happened or is imminent. In that case we do not
>> want to put iocb on the list of cancellables. However, ignored
>> wakeups need to be treated as if wakeup has not happened at all.
>> Trivially fixed by having aio_poll_wake() set ->woken only after
>> it's committed to taking iocb out of the waitqueue.
>>
>> Spotted-by: zhengbin <zhengbin13@...wei.com>
>> Signed-off-by: Al Viro <viro@...iv.linux.org.uk>
>
> ... and unfortunately it's worse than just that - what both of us
> have missed is that one could have non-specific wakep + schedule_work +
> aio_poll_complete_work() rechecking ->poll(), seeing nothing of
> interest and reinserting into queue. All before vfs_poll() manages
> to return into aio_poll(). The window is harder to hit, but it's
> still there, with exact same "failed to add to cancel list" kind of bug
> if we do hit it ;-/
>
> .
>
Powered by blists - more mailing lists