Skip to content

Commit 32452a3

Browse files
jprxaxboe
authored andcommitted
io_uring: fix uninitialized field in rw io_kiocb
io_rw_init_file does not initialize kiocb->private, so when iocb_bio_iopoll reads kiocb->private it can contain uninitialized data. Fixes: 3e08773 ("block: switch polling to be bio based") Signed-off-by: Joseph Ravichandran <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 5a1e99b commit 32452a3

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/io_uring.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3783,6 +3783,7 @@ static int io_rw_init_file(struct io_kiocb *req, fmode_t mode)
37833783
if (!(kiocb->ki_flags & IOCB_DIRECT) || !file->f_op->iopoll)
37843784
return -EOPNOTSUPP;
37853785

3786+
kiocb->private = NULL;
37863787
kiocb->ki_flags |= IOCB_HIPRI | IOCB_ALLOC_CACHE;
37873788
kiocb->ki_complete = io_complete_rw_iopoll;
37883789
req->iopoll_completed = 0;

0 commit comments

Comments
 (0)