public inbox for [email protected]
 help / color / mirror / Atom feed
* [PATCH 1/1] io_uring: don't modify req->poll for rw
@ 2021-05-17 11:43 Pavel Begunkov
  2021-05-17 13:29 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Pavel Begunkov @ 2021-05-17 11:43 UTC (permalink / raw)
  To: Jens Axboe, io-uring; +Cc: syzbot+a84b8783366ecb1c65d0

__io_queue_proc() is used by both poll and apoll, so we should not
access req->poll directly but selecting right struct io_poll_iocb
depending on use case.

Reported-and-tested-by: [email protected]
Fixes: ea6a693d862d ("io_uring: disable multishot poll for double poll add cases")
Signed-off-by: Pavel Begunkov <[email protected]>
---
 fs/io_uring.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/io_uring.c b/fs/io_uring.c
index e387ce687f4d..63f6b11d271b 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -5016,10 +5016,10 @@ static void __io_queue_proc(struct io_poll_iocb *poll, struct io_poll_table *pt,
 		 * Can't handle multishot for double wait for now, turn it
 		 * into one-shot mode.
 		 */
-		if (!(req->poll.events & EPOLLONESHOT))
-			req->poll.events |= EPOLLONESHOT;
+		if (!(poll_one->events & EPOLLONESHOT))
+			poll_one->events |= EPOLLONESHOT;
 		/* double add on the same waitqueue head, ignore */
-		if (poll->head == head)
+		if (poll_one->head == head)
 			return;
 		poll = kmalloc(sizeof(*poll), GFP_ATOMIC);
 		if (!poll) {
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] io_uring: don't modify req->poll for rw
  2021-05-17 11:43 [PATCH 1/1] io_uring: don't modify req->poll for rw Pavel Begunkov
@ 2021-05-17 13:29 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2021-05-17 13:29 UTC (permalink / raw)
  To: Pavel Begunkov, io-uring; +Cc: syzbot+a84b8783366ecb1c65d0

On 5/17/21 5:43 AM, Pavel Begunkov wrote:
> __io_queue_proc() is used by both poll and apoll, so we should not
> access req->poll directly but selecting right struct io_poll_iocb
> depending on use case.

Applied, thanks.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-05-17 13:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-17 11:43 [PATCH 1/1] io_uring: don't modify req->poll for rw Pavel Begunkov
2021-05-17 13:29 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox