Skip to content

Commit 4437dd6

Browse files
committed
Merge tag 'io_uring-5.8-2020-07-12' of git://git.kernel.dk/linux-block
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
2 parents 72c34e8 + 16d5980 commit 4437dd6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

fs/io_uring.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1096,6 +1096,8 @@ static inline void io_prep_async_work(struct io_kiocb *req,
10961096
{
10971097
const struct io_op_def *def = &io_op_defs[req->opcode];
10981098

1099+
io_req_init_async(req);
1100+
10991101
if (req->flags & REQ_F_ISREG) {
11001102
if (def->hash_reg_file)
11011103
io_wq_hash_work(&req->work, file_inode(req->file));
@@ -1104,7 +1106,6 @@ static inline void io_prep_async_work(struct io_kiocb *req,
11041106
req->work.flags |= IO_WQ_WORK_UNBOUND;
11051107
}
11061108

1107-
io_req_init_async(req);
11081109
io_req_work_grab_env(req, def);
11091110

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

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

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

37393742
#ifdef CONFIG_COMPAT

0 commit comments

Comments
 (0)