From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 372BE36E476 for ; Fri, 1 May 2026 11:08:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777633730; cv=none; b=VOzCc5+OV5tqSajx2tOy+tcWNnpt3i+m6JdLVlHpPZd7vckHc70LUunBodUP2jDZ3pQURBsY8iJYeYbjpXVZ0Z2S/RJdut6ifigKEY6vsrsBxJRbleAaQsuhtAHC8OJXfGzo/y4dCMigiioau962+PT6ZMiad0GMc9eL248oaS4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777633730; c=relaxed/simple; bh=AdOtwmrSR5KrIUzfa3Rpv7BT1r++A4OpX8amB6KdexQ=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=cF7I0Cd9yj4U2jTelqeYkv3A+A18hVeRaBI1peV4neC1Wi8hhvlmrPR2m5N6pkjfFtTxcJcJgrFdx8eRbyADXO0AK1EmZfHm8//CwC6/lE+83f2zkA1YdPPigrGlOy07ZydMUYxRydYQc+uroV+m6quDZG82zNFXY4u+ld4p8dI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=DdqEuK+O; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="DdqEuK+O" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A6CDCC2BCB4; Fri, 1 May 2026 11:08:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1777633730; bh=AdOtwmrSR5KrIUzfa3Rpv7BT1r++A4OpX8amB6KdexQ=; h=Subject:To:Cc:From:Date:From; b=DdqEuK+OLqJ41ct3+rhUcoycP1XzMCAPdPfg5o7+oO54e0PiM9kkuCkUdXKQQ3XB5 L8Gn0oEQy3a7AxkEv1+ielaxMw6PVT/r5tcGVQbP8OQeA8btWrKkwD4uFgRZQ44BrC XLwDVR7EE/4n0Qsr1Z/4MH8ilsi9hAnZYxxLj5yA= Subject: FAILED: patch "[PATCH] io_uring/poll: fix signed comparison in" failed to apply to 5.15-stable tree To: ylong030@ucr.edu,asml.silence@gmail.com,axboe@kernel.dk,bird@lzu.edu.cn,n05ec@lzu.edu.cn,tomapufckgml@gmail.com,yifanwucs@gmail.com,yuantan098@gmail.com,zcliangcn@gmail.com Cc: From: Date: Fri, 01 May 2026 13:08:47 +0200 Message-ID: <2026050147-vitality-crayfish-d8e1@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 5.15-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.15.y git checkout FETCH_HEAD git cherry-pick -x 326941b22806cbf2df1fbfe902b7908b368cce42 # git commit -s git send-email --to '' --in-reply-to '2026050147-vitality-crayfish-d8e1@gregkh' --subject-prefix 'PATCH 5.15.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 326941b22806cbf2df1fbfe902b7908b368cce42 Mon Sep 17 00:00:00 2001 From: Longxuan Yu Date: Sun, 12 Apr 2026 16:38:20 +0800 Subject: [PATCH] io_uring/poll: fix signed comparison in io_poll_get_ownership() io_poll_get_ownership() uses a signed comparison to check whether poll_refs has reached the threshold for the slowpath: if (unlikely(atomic_read(&req->poll_refs) >= IO_POLL_REF_BIAS)) atomic_read() returns int (signed). When IO_POLL_CANCEL_FLAG (BIT(31)) is set in poll_refs, the value becomes negative in signed arithmetic, so the >= 128 comparison always evaluates to false and the slowpath is never taken. Fix this by casting the atomic_read() result to unsigned int before the comparison, so that the cancel flag is treated as a large positive value and correctly triggers the slowpath. Fixes: a26a35e9019f ("io_uring: make poll refs more robust") Cc: stable@vger.kernel.org Reported-by: Yifan Wu Reported-by: Juefei Pu Co-developed-by: Yuan Tan Signed-off-by: Yuan Tan Suggested-by: Xin Liu Tested-by: Zhengchuan Liang Signed-off-by: Longxuan Yu Signed-off-by: Ren Wei Reviewed-by: Pavel Begunkov Link: https://patch.msgid.link/3a3508b08bcd7f1bc3beff848ae6e1d73d355043.1775965597.git.ylong030@ucr.edu Signed-off-by: Jens Axboe diff --git a/io_uring/poll.c b/io_uring/poll.c index 74eef7884159..6834e2db937e 100644 --- a/io_uring/poll.c +++ b/io_uring/poll.c @@ -93,7 +93,7 @@ static bool io_poll_get_ownership_slowpath(struct io_kiocb *req) */ static inline bool io_poll_get_ownership(struct io_kiocb *req) { - if (unlikely(atomic_read(&req->poll_refs) >= IO_POLL_REF_BIAS)) + if (unlikely((unsigned int)atomic_read(&req->poll_refs) >= IO_POLL_REF_BIAS)) return io_poll_get_ownership_slowpath(req); return !(atomic_fetch_inc(&req->poll_refs) & IO_POLL_REF_MASK); }