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 <v...@zeniv.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 <zhengbi...@huawei.com> >> Signed-off-by: Al Viro <v...@zeniv.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 ;-/ > > . >
- Re: [PATCH] aio: prevent the final fput() in the middle ... Linus Torvalds
- [PATCH 1/8] aio: make sure file is pinned Al Viro
- [PATCH 7/8] deal with get_reqs_available() in aio_get_re... Al Viro
- [PATCH 6/8] move dropping ->ki_eventfd into iocb_put(... Al Viro
- [PATCH 8/8] aio: move sanity checks and request allocati... Al Viro
- [PATCH 3/8] aio_poll(): sanitize the logics after vfs_po... Al Viro
- Re: [PATCH 3/8] aio_poll(): sanitize the logics after vf... zhengbin (A)
- [PATCH 4/8] aio_poll(): get rid of weird refcounting Al Viro
- [PATCH 2/8] aio_poll_wake(): don't set ->woken if we ... Al Viro
- Re: [PATCH 2/8] aio_poll_wake(): don't set ->woken if... Al Viro
- Re: [PATCH 2/8] aio_poll_wake(): don't set ->woken if... zhengbin (A)
- [PATCH 5/8] make aio_read()/aio_write() return int Al Viro
- Re: [PATCH 1/8] aio: make sure file is pinned Linus Torvalds
- Re: [PATCH 1/8] aio: make sure file is pinned Al Viro
- Re: [PATCH 1/8] aio: make sure file is pinned Al Viro
- Re: [PATCH 1/8] aio: make sure file is pinned Al Viro
- Re: [PATCH 1/8] aio: make sure file is pinned Linus Torvalds
- Re: [PATCH 1/8] aio: make sure file is pinned Al Viro
- Re: [PATCH 1/8] aio: make sure file is pinned Christoph Hellwig
- Re: [PATCH 1/8] aio: make sure file is pinned Al Viro
- [PATCH 1/8] pin iocb through aio. Al Viro