-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add second version after incorporating feedback
- Loading branch information
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
io_uring_uninit_memory/0001-io_uring-fix-uninitialized-field-in-rw-io_kiocb.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
From e3b2387b7aadfeb2e21eb159b8c44110f7a61768 Mon Sep 17 00:00:00 2001 | ||
From: Joseph Ravichandran <[email protected]> | ||
Date: Thu, 28 Apr 2022 11:05:04 -0400 | ||
Subject: [PATCH] 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 <[email protected]> | ||
--- | ||
fs/io_uring.c | 1 + | ||
1 file changed, 1 insertion(+) | ||
|
||
diff --git a/fs/io_uring.c b/fs/io_uring.c | ||
index 7625b29153b9..a16f2d758379 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; | ||
-- | ||
2.25.1 | ||
|