You need to sign in or sign up before continuing.
提交 a2197e64 编写于 作者: J Jens Axboe 提交者: Zheng Zengkai

io_uring: add missing item types for various requests

stable inclusion
from stable-v5.10.125
commit df3f3bb5059d20ef094d6b2f0256c4bf4127a859
category: bugfix
bugzilla: 187376, https://gitee.com/src-openeuler/kernel/issues/I5IM3T
CVE: CVE-2022-2327

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=df3f3bb5059d20ef094d6b2f0256c4bf4127a859

--------------------------------

Any read/write should grab current->nsproxy, denoted by IO_WQ_WORK_FILES
as it refers to current->files as well, and connect and recv/recvmsg,
send/sendmsg should grab current->fs which is denoted by IO_WQ_WORK_FS.

No upstream commit exists for this issue.
Reported-by: NBing-Jhong Billy Jheng <billy@starlabs.sg>
Signed-off-by: NJens Axboe <axboe@kernel.dk>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NYu Kuai <yukuai3@huawei.com>
Reviewed-by: NZhang Yi <yi.zhang@huawei.com>
Reviewed-by: NXiu Jianfeng <xiujianfeng@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 b1556e15
......@@ -773,7 +773,8 @@ static const struct io_op_def io_op_defs[] = {
.buffer_select = 1,
.needs_async_data = 1,
.async_size = sizeof(struct io_async_rw),
.work_flags = IO_WQ_WORK_MM | IO_WQ_WORK_BLKCG,
.work_flags = IO_WQ_WORK_MM | IO_WQ_WORK_BLKCG |
IO_WQ_WORK_FILES,
},
[IORING_OP_WRITEV] = {
.needs_file = 1,
......@@ -783,7 +784,7 @@ static const struct io_op_def io_op_defs[] = {
.needs_async_data = 1,
.async_size = sizeof(struct io_async_rw),
.work_flags = IO_WQ_WORK_MM | IO_WQ_WORK_BLKCG |
IO_WQ_WORK_FSIZE,
IO_WQ_WORK_FSIZE | IO_WQ_WORK_FILES,
},
[IORING_OP_FSYNC] = {
.needs_file = 1,
......@@ -794,7 +795,8 @@ static const struct io_op_def io_op_defs[] = {
.unbound_nonreg_file = 1,
.pollin = 1,
.async_size = sizeof(struct io_async_rw),
.work_flags = IO_WQ_WORK_BLKCG | IO_WQ_WORK_MM,
.work_flags = IO_WQ_WORK_BLKCG | IO_WQ_WORK_MM |
IO_WQ_WORK_FILES,
},
[IORING_OP_WRITE_FIXED] = {
.needs_file = 1,
......@@ -803,7 +805,7 @@ static const struct io_op_def io_op_defs[] = {
.pollout = 1,
.async_size = sizeof(struct io_async_rw),
.work_flags = IO_WQ_WORK_BLKCG | IO_WQ_WORK_FSIZE |
IO_WQ_WORK_MM,
IO_WQ_WORK_MM | IO_WQ_WORK_FILES,
},
[IORING_OP_POLL_ADD] = {
.needs_file = 1,
......@@ -857,7 +859,7 @@ static const struct io_op_def io_op_defs[] = {
.pollout = 1,
.needs_async_data = 1,
.async_size = sizeof(struct io_async_connect),
.work_flags = IO_WQ_WORK_MM,
.work_flags = IO_WQ_WORK_MM | IO_WQ_WORK_FS,
},
[IORING_OP_FALLOCATE] = {
.needs_file = 1,
......@@ -885,7 +887,8 @@ static const struct io_op_def io_op_defs[] = {
.pollin = 1,
.buffer_select = 1,
.async_size = sizeof(struct io_async_rw),
.work_flags = IO_WQ_WORK_MM | IO_WQ_WORK_BLKCG,
.work_flags = IO_WQ_WORK_MM | IO_WQ_WORK_BLKCG |
IO_WQ_WORK_FILES,
},
[IORING_OP_WRITE] = {
.needs_file = 1,
......@@ -894,7 +897,7 @@ static const struct io_op_def io_op_defs[] = {
.pollout = 1,
.async_size = sizeof(struct io_async_rw),
.work_flags = IO_WQ_WORK_MM | IO_WQ_WORK_BLKCG |
IO_WQ_WORK_FSIZE,
IO_WQ_WORK_FSIZE | IO_WQ_WORK_FILES,
},
[IORING_OP_FADVISE] = {
.needs_file = 1,
......@@ -907,14 +910,16 @@ static const struct io_op_def io_op_defs[] = {
.needs_file = 1,
.unbound_nonreg_file = 1,
.pollout = 1,
.work_flags = IO_WQ_WORK_MM | IO_WQ_WORK_BLKCG,
.work_flags = IO_WQ_WORK_MM | IO_WQ_WORK_BLKCG |
IO_WQ_WORK_FS,
},
[IORING_OP_RECV] = {
.needs_file = 1,
.unbound_nonreg_file = 1,
.pollin = 1,
.buffer_select = 1,
.work_flags = IO_WQ_WORK_MM | IO_WQ_WORK_BLKCG,
.work_flags = IO_WQ_WORK_MM | IO_WQ_WORK_BLKCG |
IO_WQ_WORK_FS,
},
[IORING_OP_OPENAT2] = {
.work_flags = IO_WQ_WORK_FILES | IO_WQ_WORK_FS |
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册