diff options
author | Joseph Ravichandran <jravi@mit.edu> | 2022-04-28 18:57:52 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2022-04-28 21:13:43 +0200 |
commit | 32452a3eb8b64e01e2be717f518c0be046975b9d (patch) | |
tree | 384c67a0f48f2375ffe916c9c2278dbd44b98ede /fs/io_uring.c | |
parent | io_uring: check reserved fields for recv/recvmsg (diff) | |
download | linux-32452a3eb8b64e01e2be717f518c0be046975b9d.tar.xz linux-32452a3eb8b64e01e2be717f518c0be046975b9d.zip |
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>
Diffstat (limited to '')
-rw-r--r-- | fs/io_uring.c | 1 |
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; |