Skip to content

Commit

Permalink
Merge tag 'io_uring-5.8-2020-07-12' of git://git.kernel.dk/linux-block
Browse files Browse the repository at this point in the history
Pull io_uring fixes from Jens Axboe:
 "Two late fixes again:

   - Fix missing msg_name assignment in certain cases (Pavel)

   - Correct a previous fix for full coverage (Pavel)"

* tag 'io_uring-5.8-2020-07-12' of git://git.kernel.dk/linux-block:
  io_uring: fix not initialised work->flags
  io_uring: fix missing msg_name assignment
  • Loading branch information
torvalds committed Jul 12, 2020
2 parents 72c34e8 + 16d5980 commit 4437dd6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fs/io_uring.c
Original file line number Diff line number Diff line change
Expand Up @@ -1096,6 +1096,8 @@ static inline void io_prep_async_work(struct io_kiocb *req,
{
const struct io_op_def *def = &io_op_defs[req->opcode];

io_req_init_async(req);

if (req->flags & REQ_F_ISREG) {
if (def->hash_reg_file)
io_wq_hash_work(&req->work, file_inode(req->file));
Expand All @@ -1104,7 +1106,6 @@ static inline void io_prep_async_work(struct io_kiocb *req,
req->work.flags |= IO_WQ_WORK_UNBOUND;
}

io_req_init_async(req);
io_req_work_grab_env(req, def);

*link = io_prep_linked_timeout(req);
Expand Down Expand Up @@ -3553,6 +3554,7 @@ static int io_sendmsg_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
if (req->flags & REQ_F_NEED_CLEANUP)
return 0;

io->msg.msg.msg_name = &io->msg.addr;
io->msg.iov = io->msg.fast_iov;
ret = sendmsg_copy_msghdr(&io->msg.msg, sr->msg, sr->msg_flags,
&io->msg.iov);
Expand Down Expand Up @@ -3734,6 +3736,7 @@ static int __io_compat_recvmsg_copy_hdr(struct io_kiocb *req,

static int io_recvmsg_copy_hdr(struct io_kiocb *req, struct io_async_ctx *io)
{
io->msg.msg.msg_name = &io->msg.addr;
io->msg.iov = io->msg.fast_iov;

#ifdef CONFIG_COMPAT
Expand Down

0 comments on commit 4437dd6

Please sign in to comment.