From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796379518; b=YjFvgEnJXGDLueJd81EWk8DGwUhsyP5Vd9oEgJR9OADAxsvLxNqqcGFjp2qiJ3t6QXsl gVxTpFjBqVXcA2sO6/UvyPK8nz1pomSsok/Skx+0hhcAfwrL9HtIjPT2RG1z7sZx/JY3L NfUg71NhsI6JfsCjYh+akCilnFQ6FN/UbHEiz3TUY90YdyZHCxuAoHxjTNOSONMG2ZCN3 NDHTyNJfLio+N6tTQj0CoZZOFLiOf94lo90a6+rVVAz/nyzbEycfyZ4WxgOvwAkcapife QUeQ4HX6+UL1SI1hNotKd/GqaQqXZEw0KVcLFhouUmD4MZiHsaS9T+ASgqN6C97Dczg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796379518; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=Czvcq02l7V8IXxPRKy2tuOrSZ8/PIqCKRoPCVhqHqHQ=; b=uV9cFqgc3Q4j4q/74axyTGStKJg77fOcp8iXzuG3LuW57LaNXySihup2CIzZby/Z68fR DLOoT2FZvHRrroWspqwhvNlBtycbt+fR3RQvot37wcgDlMbgD8YypIaw9U8ynYDE5oaON VTzut6rXoG/AUAFlon9KgU+hQO5+NlKlF2YlFlwK4z7hdKcxzFN87Z2yuwQzYzQ0VOxrQ gvBXR6sEFIL77v4lsLnsE09fJpxucLQb5kMdl4dTx/SLCQ2QTO7nO6jbtBiL5yj7o762q iCf5WWy0kJr+wtifCh4NdflqLar7EQQyx7CsF5iDI5oXDOSLiglkAmlL7GRgpvZzdLA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=Iu0GSbv1; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E9095606A322; Fri, 4 Dec 2026 10:18:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=Iu0GSbv1 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5E3CB1F00897; Fri, 4 Dec 2026 10:18:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796379517; bh=Czvcq02l7V8IXxPRKy2tuOrSZ8/PIqCKRoPCVhqHqHQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Iu0GSbv1Ac12hP6lAQ1oaT/Bh2sJKtq/DLN8Ns5ScTISmJeOvjXkki08VlZ9qoalr /Hqglu3ANm1Do9XmrYe4xotbxqUbvJzcyi92zOOzx4cJEuhyBxavqG+1r4dhyWk+AW /MJGPpcsrODCCIGgeXV9tvoH/KX/Zxf015j1sWwU= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Ubisectech Sirius , Jens Axboe , Sasha Levin Subject: [PATCH 6.6 0026/1167] io_uring/sqpoll: early exit thread if task_context wasnt allocated Date: Fri, 4 Dec 2026 18:50:53 +0900 Message-ID: <20261204100702.726438190@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100702.047403948@linuxfoundation.org> References: <20261204100702.047403948@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jens Axboe Commit 1251d2025c3e1bcf1f17ec0f3c0dfae5e5bbb146 upstream. Ideally we'd want to simply kill the task rather than wake it, but for now let's just add a startup check that causes the thread to exit. This can only happen if io_uring_alloc_task_context() fails, which generally requires fault injection. Reported-by: Ubisectech Sirius Fixes: af5d68f8892f ("io_uring/sqpoll: manage task_work privately") Signed-off-by: Jens Axboe [axboe: 6.6 has no sqd->exited, the thread drops its sqd reference with io_sq_data_release() on exit, so put err_out before that] Signed-off-by: Sasha Levin --- io_uring/sqpoll.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/io_uring/sqpoll.c b/io_uring/sqpoll.c index ecd336c373b15..3849252f61351 100644 --- a/io_uring/sqpoll.c +++ b/io_uring/sqpoll.c @@ -277,6 +277,10 @@ static int io_sq_thread(void *data) char buf[TASK_COMM_LEN]; DEFINE_WAIT(wait); + /* offload context creation failed, just exit */ + if (!current->io_uring) + goto err_out; + snprintf(buf, sizeof(buf), "iou-sqp-%d", sqd->task_pid); set_task_comm(current, buf); @@ -393,7 +397,7 @@ static int io_sq_thread(void *data) atomic_or(IORING_SQ_NEED_WAKEUP, &ctx->rings->sq_flags); io_run_task_work(); mutex_unlock(&sqd->lock); - +err_out: io_sq_data_release(sqd); do_exit(0); } -- 2.53.0