From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oa1-f44.google.com (mail-oa1-f44.google.com [209.85.160.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 753062C21F0 for ; Thu, 23 Apr 2026 13:41:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776951664; cv=none; b=pWiIZlCMHFXkPK3PvgWEN7cLiwmdgE1v8k+wRkFYLtG/owlMQ2fCyIcFW7TSovPd5o5hTyxyHHaorgt03t86qdk5td2mkQkYVBg9wj3i90Q4w+8BE+w0xKNDAV5WLJnmoTi0ZIwUxqKaEvJooWLRmz8uMRb/ONH34JuaBbdzd88= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776951664; c=relaxed/simple; bh=KHbkGPjyeLB4Om2TsdTE+d/BBxJhMzMDgtS9P09hd8Y=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=jtT1IuIvrmEhYgLY1ViyheO7pflpukGFRC+U5i0LFhRZLmzuIdH6v70wPJx+HNcWfraMYueXy5pEOApniAt8wQ6xwbt8NXPYaIXZP5/KCzgc799TzJ5ocvs4o532VyGxAdcei/ChkvUMbJds3+YwL/dCYoON5p46kUSeWCbGiGI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.dk; spf=pass smtp.mailfrom=kernel.dk; dkim=pass (2048-bit key) header.d=kernel-dk.20251104.gappssmtp.com header.i=@kernel-dk.20251104.gappssmtp.com header.b=tLbrkzTe; arc=none smtp.client-ip=209.85.160.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.dk Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kernel.dk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel-dk.20251104.gappssmtp.com header.i=@kernel-dk.20251104.gappssmtp.com header.b="tLbrkzTe" Received: by mail-oa1-f44.google.com with SMTP id 586e51a60fabf-42321c8b8f5so5484580fac.1 for ; Thu, 23 Apr 2026 06:41:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20251104.gappssmtp.com; s=20251104; t=1776951661; x=1777556461; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=8ioJ5CdUnXoI+VkUi/GtIzycQxY2QvCDY2phJmyrZvY=; b=tLbrkzTe7hB9BAKuvqcvzpJzZV0uHq/lK3QnWRoJhrAwCGbItqN2gC60XE3U3MLK2T EBBTnlSrKZcevM1uzi3KHeBXCC3VXDuUl3T6prHyVesa4f3C2DVef+lyyqNZtOIF+RWS ha7b79y9Eu7NOQWAnQwiIOp7iHoXKmb83yFrPQHnEOJPzxm83SJQhN+w9nzmJwpv4ZF7 aNdHZTv3QMng9lW3Jte0uEUk1foyBtby3fcqmPHCMAgG774aNjdpeASo/2iHHvbRBlaA 6ogx13y+xAq4ocq7mUZRzStalk/4Ogw8765o33ItPBnvZ06eyqFPK9TEa67Si8icVIeh ifow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776951661; x=1777556461; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=8ioJ5CdUnXoI+VkUi/GtIzycQxY2QvCDY2phJmyrZvY=; b=H1xfqsPpbM3zD8drxn0xEOlinoVPgMRm3LbtJ/2kkhdc35vXVORB8H5Cf4RmRBb7yT P8ywG2iDBBYd9j7TgS3bhYddH1xs5pRY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d with SMTP id 586e51a60fabf-42d8229deb5mr6336961fac.11.1776951661410; Thu, 23 Apr 2026 06:41:01 -0700 (PDT) Received: from [192.168.1.102] ([96.43.243.2]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-42b934a2e8esm18586587fac.10.2026.04.23.06.40.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 23 Apr 2026 06:41:00 -0700 (PDT) Message-ID: Date: Thu, 23 Apr 2026 07:40:59 -0600 Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 5.10 491/491] io_uring/poll: correctly handle io_poll_add() return value on update To: Greg Kroah-Hartman Cc: Ben Hutchings , stable@vger.kernel.org, patches@lists.linux.dev, syzbot+641eec6b7af1f62f2b99@syzkaller.appspotmail.com References: <20260413155819.042779211@linuxfoundation.org> <20260413155837.438151458@linuxfoundation.org> <3512c6ae-0b99-4c50-89ed-f1087a558a25@kernel.dk> <2026042354-doorstep-stray-0fe0@gregkh> Content-Language: en-US From: Jens Axboe In-Reply-To: <2026042354-doorstep-stray-0fe0@gregkh> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 4/23/26 6:38 AM, Greg Kroah-Hartman wrote: > On Tue, Apr 21, 2026 at 04:58:52PM -0600, Jens Axboe wrote: >> On 4/21/26 4:18 PM, Jens Axboe wrote: >>>>> @@ -6024,16 +6035,17 @@ static int io_poll_update(struct io_kioc >>>>> if (req->poll_update.update_user_data) >>>>> preq->user_data = req->poll_update.new_user_data; >>>>> >>>>> - ret2 = io_poll_add(preq, issue_flags); >>>>> + ret2 = __io_poll_add(preq, issue_flags); >>>>> /* successfully updated, don't complete poll request */ >>>>> if (!ret2) >>>>> goto out; >>>>> + preq->result = ret2; >>>>> + >>>>> } >>>>> - req_set_fail(preq); >>>>> - io_req_complete(preq, -ECANCELED); >>>>> + if (preq->result < 0) >>>>> + req_set_fail(preq); >>>>> + io_req_complete(preq, preq->result); >>>> >>>> If __io_poll_add() returned an events mask then it completed preq, but >>>> then we also complete preq here. Is that really correct? >>> >>> Let me take a closer look, I do agree with you that the final result >>> does not look entirely correct. >> >> As far as I can tell, these two should be applied to 5.10 and 5.15 >> stable. The first one fixes an old backporting issue that I didn't >> notice until doing some targeted testing just now. The second one should >> take care of the issues that Ben spotted in the current backport. > > Now applied. Thanks! -- Jens Axboe