From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8435F3403F3; Sat, 30 May 2026 16:52:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780159958; cv=none; b=NIHO16GovEEiAmTANh7peiyeCow2vJ2oVYJHtdjq/QdPtfJh6Q/5y1KEjLVGNCygbwB05TIam4QXy+X5C2qvb/8crYKc1E5W0MCf+fz2UBYPSpphdqmthpjaANsb0wjf5TcacS27Wr+JDXK49Xg4b2MoxFrPXBjf3BlHjT+oMqY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780159958; c=relaxed/simple; bh=8juU/cB5yk8Qida881arQgW8mtJB8ONT9G7I/aX27Mk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=hqTBkiZ4m5EL61+phcckO5pkFc99FPtqtxTKi1Vs3XiNHuHQjJobmX9oOJwscanL0CfDzWzpF9B39jNDK1T5E4bqAEY4tWeuyWXytE069amFCU1ISerNvTawpsMAxzR5gHAHkTbyMeYX1plkCmTj9lT4zIQdfkapISiRq1LlGjg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=MjeVOjXt; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="MjeVOjXt" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 913D21F00898; Sat, 30 May 2026 16:52:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1780159957; bh=ZAVCv/vSW98Ar6q6srW0UMhzISyobUiYNb+Q6YZRgOA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=MjeVOjXtb8joDlcrlACo97zS7atNBzM5zMQ8/SS4oUWtvVbJTzKYM1ZE+o0cLOgoe DbpKlgDxS0X7WG2UpCNFtUFRm7BLv6PVkLOf66DWkUAmv2By9e5TtSy/MtI5+xE6zk iZq3wGiEY0S6rN+VwLusdF8cg+r1SRu82vyCRMRY= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, =?UTF-8?q?Azizcan=20Da=C5=9Ftan?= , Jens Axboe Subject: [PATCH 6.1 207/969] io_uring/poll: ensure EPOLL_ONESHOT is propagated for EPOLL_URING_WAKE Date: Sat, 30 May 2026 17:55:31 +0200 Message-ID: <20260530160306.187251852@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260530160300.485627683@linuxfoundation.org> References: <20260530160300.485627683@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jens Axboe commit 1967f0b1cafdde37aa9e08e6021c14bcc484b7a5 upstream. Commit: aacf2f9f382c ("io_uring: fix req->apoll_events") fixed an issue where poll->events and req->apoll_events weren't synchronized, but then when the commit referenced in Fixes got added, it didn't ensure the same thing. If we mask in EPOLLONESHOT in the regular EPOLL_URING_WAKE path, then ensure it's done for both. Including a link to the original report below, even though it's mostly nonsense. But it includes a reproducer that does show that IORING_CQE_F_MORE is set in the previous CQE, while no more CQEs will be generated for this request. Just ignore anything that pretends this is security related in any way, it's just the typical AI nonsense. Cc: stable@vger.kernel.org Link: https://lore.kernel.org/io-uring/CAM0zi7yQzF3eKncgHo4iVM5yFLAjsiob_ucqyWKs=hyd_GqiMg@mail.gmail.com/ Reported-by: Azizcan Daştan Fixes: 4464853277d0 ("io_uring: pass in EPOLL_URING_WAKE for eventfd signaling and wakeups") Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman --- io_uring/poll.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/io_uring/poll.c +++ b/io_uring/poll.c @@ -451,8 +451,10 @@ static int io_poll_wake(struct wait_queu * disable multishot as there is a circular dependency between * CQ posting and triggering the event. */ - if (mask & EPOLL_URING_WAKE) + if (mask & EPOLL_URING_WAKE) { poll->events |= EPOLLONESHOT; + req->apoll_events |= EPOLLONESHOT; + } /* optional, saves extra locking for removal in tw handler */ if (mask && poll->events & EPOLLONESHOT) {