ublk: fix struct ublksrv_ctrl_cmd accesses
Status from this message: Applied, thanks!
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest3 patches 4 repliesApplied
- v14 patches 4 repliesSuperseded
Changes in v2 from the cover letter
- Make a local copy of the struct ublksrv_ctrl_cmd (Ming)
- Add Reviewed-by tag (Ming)
Patches in v2 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | ublk: Validate SQE128 flag before accessing the cmddrivers/ | +3 | 0 replies | |
| 2/3 | ublk: use READ_ONCE() to read struct ublksrv_ctrl_cmddrivers/ | +31 | 2 replies | |
| 3/3 | ublk: drop ublk_ctrl_start_recovery() header argumentdrivers/ | +3 | 1 reply |
Reviews trailers per patch
All 3 patches have a Reviewed-by or Acked-by.
| Patch | Caleb Sander Mateos | Ming Lei |
|---|---|---|
| 1/3 | R-b | R-b |
| 2/3 | R-b | |
| 3/3 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v2 0/3] ublk: fix struct ublksrv_ctrl_cmd accesses
struct ublksrv_ctrl_cmd is part of the io_uring_sqe. Since commit 87213b0d847c ("ublk: allow non-blocking ctrl cmds in IO_URING_F_NONBLOCK issue") allowed some commands to be handled in the non-blocking issue, the SQE may lie in userspace-mapped memory. Validate that the SQE size is the expected 128 bytes before dereferencing it. Use READ_ONCE() to copy the ublksrv_ctrl_cmd from the SQE to a local variable. This avoids data races if userspace writes to the SQE concurrently.
v2:
- Make a local copy of the struct ublksrv_ctrl_cmd (Ming)
- Add Reviewed-by tag (Ming)
Caleb Sander Mateos (2):
ublk: use READ_ONCE() to read struct ublksrv_ctrl_cmd
ublk: drop ublk_ctrl_start_recovery() header argument
Govindarajulu Varadarajan (1):
ublk: Validate SQE128 flag before accessing the cmd
drivers/block/ublk_drv.c | 65 +++++++++++++++++++++------------------- 1 file changed, 35 insertions(+), 30 deletions(-)
Signature · 1 line
2.45.2