“600cd702f0369b98dde2004e85f8e84f4a4964fb”上不存在“...git@gitcode.net:openanolis/dragonwell8_jdk.git”
提交 aa7ba822 编写于 作者: L Li Lingfeng 提交者: Jialin Zhang

Revert "[Backport] io_uring: don't keep looping for more events if we can't flush overflow"

Offering: HULK
hulk inclusion
category: feature
bugzilla: https://gitee.com/src-openeuler/kernel/issues/I6BTWC

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

This reverts commit f7dc15c2.

We need to apply patch 788d0824269bef (io_uring: import 5.15-stable
io_uring) to move io_uring to separate directory and solve
the problem of CVE-2023-0240.
This patch can be reverted since patch 788d0824269bef contains it.
Signed-off-by: NLi Lingfeng <lilingfeng3@huawei.com>
Reviewed-by: NZhang Yi <yi.zhang@huawei.com>
Reviewed-by: NWang Weiyang <wangweiyang2@huawei.com>
Signed-off-by: NJialin Zhang <zhangjialin11@huawei.com>
上级 b2e6c4b5
...@@ -1718,22 +1718,18 @@ static bool __io_cqring_overflow_flush(struct io_ring_ctx *ctx, bool force, ...@@ -1718,22 +1718,18 @@ static bool __io_cqring_overflow_flush(struct io_ring_ctx *ctx, bool force,
return cqe != NULL; return cqe != NULL;
} }
static bool io_cqring_overflow_flush(struct io_ring_ctx *ctx, bool force, static void io_cqring_overflow_flush(struct io_ring_ctx *ctx, bool force,
struct task_struct *tsk, struct task_struct *tsk,
struct files_struct *files) struct files_struct *files)
{ {
bool ret = true;
if (test_bit(0, &ctx->cq_check_overflow)) { if (test_bit(0, &ctx->cq_check_overflow)) {
/* iopoll syncs against uring_lock, not completion_lock */ /* iopoll syncs against uring_lock, not completion_lock */
if (ctx->flags & IORING_SETUP_IOPOLL) if (ctx->flags & IORING_SETUP_IOPOLL)
mutex_lock(&ctx->uring_lock); mutex_lock(&ctx->uring_lock);
ret = __io_cqring_overflow_flush(ctx, force, tsk, files); __io_cqring_overflow_flush(ctx, force, tsk, files);
if (ctx->flags & IORING_SETUP_IOPOLL) if (ctx->flags & IORING_SETUP_IOPOLL)
mutex_unlock(&ctx->uring_lock); mutex_unlock(&ctx->uring_lock);
} }
return ret;
} }
static void __io_cqring_fill_event(struct io_kiocb *req, long res, static void __io_cqring_fill_event(struct io_kiocb *req, long res,
...@@ -7035,11 +7031,7 @@ static int io_cqring_wait(struct io_ring_ctx *ctx, int min_events, ...@@ -7035,11 +7031,7 @@ static int io_cqring_wait(struct io_ring_ctx *ctx, int min_events,
iowq.nr_timeouts = atomic_read(&ctx->cq_timeouts); iowq.nr_timeouts = atomic_read(&ctx->cq_timeouts);
trace_io_uring_cqring_wait(ctx, min_events); trace_io_uring_cqring_wait(ctx, min_events);
do { do {
/* if we can't even flush overflow, don't wait for more */ io_cqring_overflow_flush(ctx, false, NULL, NULL);
if (!io_cqring_overflow_flush(ctx, false, NULL, NULL)) {
ret = -EBUSY;
break;
}
prepare_to_wait_exclusive(&ctx->wait, &iowq.wq, prepare_to_wait_exclusive(&ctx->wait, &iowq.wq,
TASK_INTERRUPTIBLE); TASK_INTERRUPTIBLE);
/* make sure we run task_work before checking for signals */ /* make sure we run task_work before checking for signals */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册