All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: stable@vger.kernel.org
Subject: Fwd: [PATCH] fs/io_uring.c: Fix uninitialized variable is referenced in io_submit_sqe
Date: Thu, 13 Aug 2020 09:11:37 -0600	[thread overview]
Message-ID: <d62db5aa-c821-367b-6188-e9dc9bd1a0f0@kernel.dk> (raw)
In-Reply-To: <20200813065644.GA91891@ubuntu>

Hi,

Can you queue this up for 5.4 as well? Thanks!


-------- Forwarded Message --------
Subject: [PATCH] fs/io_uring.c: Fix uninitialized variable is referenced in io_submit_sqe
Date: Wed, 12 Aug 2020 23:56:44 -0700
From: Liu Yong <pkfxxxing@gmail.com>
To: Jens Axboe <axboe@kernel.dk>
CC: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org

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@gmail.com>
---
 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


  parent reply	other threads:[~2020-08-13 15:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-13  6:56 [PATCH] fs/io_uring.c: Fix uninitialized variable is referenced in io_submit_sqe Liu Yong
2020-08-13 14:56 ` Jens Axboe
2020-08-13 15:11 ` Jens Axboe [this message]
2020-08-14 16:42   ` Fwd: " Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d62db5aa-c821-367b-6188-e9dc9bd1a0f0@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.