[PATCH] fs/io_uring.c: Fix uninitialized variable is referenced in io_submit_sqe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



the commit <a4d61e66ee4a> ("<io_uring: prevent re-read of sqe->opcode>") 
caused another vulnerability. After io_get_req(), the sqe_submit struct 
in req is not initialized, but the following code defaults that 
req->submit.opcode is available.

Signed-off-by: Liu Yong <pkfxxxing@xxxxxxxxx>
---
 fs/io_uring.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/io_uring.c b/fs/io_uring.c
index be3d595a607f..c1aaee061dae 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -2559,6 +2559,7 @@ static void io_submit_sqe(struct io_ring_ctx *ctx, struct sqe_submit *s,
 		goto err;
 	}
 
+	memcpy(&req->submit, s, sizeof(*s));
 	ret = io_req_set_file(ctx, s, state, req);
 	if (unlikely(ret)) {
 err_req:
-- 
2.17.1




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux