summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Ravichandran <jravi@mit.edu>2022-04-28 12:57:52 -0400
committerJens Axboe <axboe@kernel.dk>2022-04-28 13:13:43 -0600
commit32452a3eb8b64e01e2be717f518c0be046975b9d (patch)
tree384c67a0f48f2375ffe916c9c2278dbd44b98ede
parent5a1e99b61b0c81388cde0c808b3e4173907df19f (diff)
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: 3e08773c3841 ("block: switch polling to be bio based") Signed-off-by: Joseph Ravichandran <jravi@mit.edu> Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--fs/io_uring.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c
index 92ac50f139cd..e3ae26ff5d1a 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -3783,6 +3783,7 @@ static int io_rw_init_file(struct io_kiocb *req, fmode_t mode)
if (!(kiocb->ki_flags & IOCB_DIRECT) || !file->f_op->iopoll)
return -EOPNOTSUPP;
+ kiocb->private = NULL;
kiocb->ki_flags |= IOCB_HIPRI | IOCB_ALLOC_CACHE;
kiocb->ki_complete = io_complete_rw_iopoll;
req->iopoll_completed = 0;