Re: [syzbot] [io-uring?] general protection fault in io_get_cqe_overflow

From: Jens Axboe
Date: Mon Oct 02 2023 - 11:20:23 EST


diff --git a/io_uring/io_uring.h b/io_uring/io_uring.h
index 547c30582fb8..6206ae73412a 100644
--- a/io_uring/io_uring.h
+++ b/io_uring/io_uring.h
@@ -86,21 +86,6 @@ bool __io_alloc_req_refill(struct io_ring_ctx *ctx);
bool io_match_task_safe(struct io_kiocb *head, struct task_struct *task,
bool cancel_all);

-#define io_lockdep_assert_cq_locked(ctx) \
- do { \
- lockdep_assert(in_task()); \
- \
- if (ctx->flags & IORING_SETUP_IOPOLL) { \
- lockdep_assert_held(&ctx->uring_lock); \
- } else if (!ctx->task_complete) { \
- lockdep_assert_held(&ctx->completion_lock); \
- } else if (ctx->submitter_task->flags & PF_EXITING) { \
- lockdep_assert(current_work()); \
- } else { \
- lockdep_assert(current == ctx->submitter_task); \
- } \
- } while (0)
-
static inline void io_req_task_work_add(struct io_kiocb *req)
{
__io_req_task_work_add(req, 0);
@@ -113,8 +98,6 @@ static inline bool io_get_cqe_overflow(struct io_ring_ctx *ctx,
struct io_uring_cqe **ret,
bool overflow)
{
- io_lockdep_assert_cq_locked(ctx);
-
if (unlikely(ctx->cqe_cached >= ctx->cqe_sentinel)) {
if (unlikely(!io_cqe_cache_refill(ctx, overflow)))
return false;

--
Jens Axboe