From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oa1-f45.google.com (mail-oa1-f45.google.com [209.85.160.45]) (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 8A1643EAC75 for ; Thu, 23 Apr 2026 12:30:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776947408; cv=none; b=OUexprz0lk56gWKRvdFiULKtDbAJPsd/3vqgnt4hNEiZl4XBG7gv9STgqIJoQUiswdhUP4KHAz10Whrss34MjLwbucJYAbC2qikeUyByu2HYOO459pL7Qd/FIKQhBoPbfJxrv9Qnm9ztDdGcpwDL4RDsYwAhpSfq8D0EqUn/Wmk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776947408; c=relaxed/simple; bh=zV7btV5r7l9s7hFfEdSOZMG4OSyzdzPILuSoeB73x1I=; h=Message-ID:Date:MIME-Version:Subject:From:To:Cc:References: In-Reply-To:Content-Type; b=DuTUqAJ9C5i5UbTpMufaBXeJ/7TdAu0KXaqsG+cmDPIAXgVaitWlAK9ZoBNY8Wdr/iuEXJB+0NKWFFKXYf/Eg3Akzhz/Nb/210ZE+BiGXgFTUB0qF/fX1oCgHz3uPh9y9wATV44H3dAzKDcdA/ymrA7elcq4o6Lk6rpNRhioDWY= 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=Hpz9y2JW; arc=none smtp.client-ip=209.85.160.45 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="Hpz9y2JW" Received: by mail-oa1-f45.google.com with SMTP id 586e51a60fabf-42fbf95cca8so1560485fac.0 for ; Thu, 23 Apr 2026 05:30:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20251104.gappssmtp.com; s=20251104; t=1776947404; x=1777552204; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:from:subject:user-agent:mime-version:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=ZFm8MWUWzpEnhSEAqMMM8fUMsiyBT5avBx5Nu2gHmcA=; b=Hpz9y2JWiE1Qp/LmcwjM9nZICmfZ/w+qtWCkQQYTG4Ur85KbBdsXnWToE3nApMtpY4 JFKNKkz3M7rJz+DcCUEsCasiQ14QnML3/Af6FHbGGy3z5heBnwGaFsm3KhHq6cf31YUM pJYJduar/52XlDE8UA/mAPKcAw8Uu2KpRYto+0SMLoQRQUZvfqrbd1/Ivop6D91ufMa3 JpPPK4eatcnXqDlQdrRSf9ZT3UB/Vq8XTyLQdg+ZDL0elG3UvP2glmhbYN2a4McHiiKO tbcmgVTE/P1KYR4M7B5fyLMJrtEGFAz4dSmxpOr4LQ4cqWhxVnFWRCnE5eCOtfP25lKk CPSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776947404; x=1777552204; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:from: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=ZFm8MWUWzpEnhSEAqMMM8fUMsiyBT5avBx5Nu2gHmcA=; b=CR5Y+XgAGzPTKikqsddHBi5BweScpc3NCz24nmgMtOplcqveNcsYU06ArTo688lfU8 WuZ1qlTvD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X-Received: by 2002:a05:6870:9d88:b0:409:76e0:bd84 with SMTP id 586e51a60fabf-42aded0b29emr17008673fac.24.1776947404452; Thu, 23 Apr 2026 05:30:04 -0700 (PDT) Received: from [192.168.1.150] ([198.8.77.157]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-42c05ca16e2sm9943048fac.15.2026.04.23.05.30.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 23 Apr 2026 05:30:03 -0700 (PDT) Message-ID: <97121442-388e-454c-9a85-85e4dd66cc19@kernel.dk> Date: Thu, 23 Apr 2026 06:30:02 -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 From: Jens Axboe To: Ben Hutchings , Greg Kroah-Hartman , stable@vger.kernel.org Cc: 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> Content-Language: en-US In-Reply-To: <3512c6ae-0b99-4c50-89ed-f1087a558a25@kernel.dk> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 4/21/26 4:58 PM, 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. > > Will be nice when 5.x is finally taken out behind the barn :-) Greg, you adding these 2 for 5.10/5.15? -- Jens Axboe