From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oa1-f65.google.com (mail-oa1-f65.google.com [209.85.160.65]) (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 356E41FF1AE for ; Thu, 12 Feb 2026 12:02:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.65 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770897782; cv=none; b=LBojmxMUVjUqHIrVcTERVT8FLIIwwxx6dR/hkzYdDHj69BRtSoBYU98JcwajBq3Z0RXpDcBrTHPSk7z4FNKrsMgdQRdKugfWvMltMVrIz3+yMqdxqFRDzReKErns7PERdY7zFLSDsF72GkN1Cs/oASKmG+Zs1e9o3NBw9tVQwaA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770897782; c=relaxed/simple; bh=etPO5rAF/iZNTMhRsXxVZC5DQsNDTwpHKQZKVhoz2Wc=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=koyduMYGRCSpEDtIN9s7wlRYxK0TvNd178NiEzPtkjMpuUEr40e+S1zP6JsipxR52MMyi1cUVcCBpQlsiqpvj6Zwf2mReGj9aXKaOWnPUXmhwmvBVGNcCLW3KFoUbjyYDFLo+G5DpGJPgOopMm3MlKNjUKfXDVogBy0Atyn0W7o= 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.20230601.gappssmtp.com header.i=@kernel-dk.20230601.gappssmtp.com header.b=mCIj9T1M; arc=none smtp.client-ip=209.85.160.65 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.20230601.gappssmtp.com header.i=@kernel-dk.20230601.gappssmtp.com header.b="mCIj9T1M" Received: by mail-oa1-f65.google.com with SMTP id 586e51a60fabf-40970f97638so1790010fac.3 for ; Thu, 12 Feb 2026 04:02:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20230601.gappssmtp.com; s=20230601; t=1770897779; x=1771502579; 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=j9yZyoI1MedJ91neH42mRt3C3fl0JTlkoE+1s2Qiphs=; b=mCIj9T1MOQwCITwMODWOhTMeIAmufBplHFyzCwKBFuGzjC3qINMzRPEoXzPabvNpsI YCqcWZqQtazzIPJfGp6oWTDjbRMTxDfKCy9g9xtyB70zzYdqIqROsRRLr+4dMoH1Scpw bciNH24F9mE6tdvYK5vPJpz2rIMVyzEIdOFcwhaCjJGmoVtNdMAaIiCi/nREpSGbxUGI RBET0mtWZleDKbfo09hVwL8u3u42KHNFpFEcX4NBkQY2nx1ncaEIiwezIobLn14EDy70 30ACF9LiYik9Ggm7hOoRmmilYhkjbBxEVdTI8RAP/95jJn/5x9jE13WXNCryDWgbhRjz silg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770897779; x=1771502579; 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=j9yZyoI1MedJ91neH42mRt3C3fl0JTlkoE+1s2Qiphs=; b=eACorsouYRMz7A1v0JxXBucA62G7L0+B2zWZSyDeyRzM3avgw6vnBlmjSEbha7xwoE OgToh5G+2VNlNcm64ushQ1jOKD2kmzxgnVpoPkRkYvGZtJ+6FMvZnAvf/9EV94FJbq5A /KpzyCLF8fKVR75MVcmCvGHT7mNcU4ctCZguXgOn8vrs/s4BLfOGRp5DkEm0vLJzISY8 iDUk1tvXpiYR6TZKFR3/4i58U+mTnhy9356SwRCcA9n9h1Gf/kxYoExN/4rQ7f6Q0T/I q5fjI/NZ7gkZxGhcOAe+Yd/cm1Vv/zGJuh3Zkr43yQMEJkrMAoG1UCW6a337dDKi6eeC eF9A== X-Forwarded-Encrypted: i=1; AJvYcCVuxjYqy/JNI0UdFpvXgkPdEKVF+3Bgk49KgcNyIvf/q6Ft06s9K8/jDXSfoiMoHlIBaVylumIANeDsk2I=@vger.kernel.org X-Gm-Message-State: AOJu0YzLvNLz83360SxnKpgbR038Jn65m3u/5ZUmevkvfTkLJgYNtiK3 KuhdQC/kbfnaY05GQoVsTj2zaKwkhFxPF7ACokhuEd+9jDs3uLhPfFnqTfIVP024pe4= X-Gm-Gg: AZuq6aIHZzNvCnDPnldA0cAyTF/H/ZqoGIDtqiStpjfxuvHA69i81x2Zm2pLjZ+crBb AvOCh52sgaE4eXVFJo71oqF6usInM21wCPHRSj25YKx9JEUj0yCh0EzYNPQsOP/6yjPIauT8Ub6 oQVjbUI//DkeRpOrguXT0OqXaSmvtigh75YYnoy6ovx0wKJAmjkIuPmnZpd2VdZPqQTTKQZPsD+ YGniOk3Qwc+tt+tmSjphUfePUf5EwdTcySrJEb6LszkRuTh4wKDmJX5qirzUPj4cZ3Z/kffhBVQ /l2F0JIouLNu4W0lXe6/nbJpmrUtTSPUToLS/mNG1pQURgf075vxaswEpF5uWKki5l9Kpd3f7Zi /p6U3SarHcnnPgQpCl9gV9FJnCa8Hhg6eVT++eBhyG2+j0LmLaDwOAo3bp6JjCyJ9Wc+apxOCuj Mxp1xSusC3T2IGBHH0j9Ild4U0JsSFAwHpvlMLcFCW9W16UtCyLttmP7rEJqq9MENJpx5ko2hYk pTVVe7tNA== X-Received: by 2002:a05:687c:409b:b0:3e8:44ec:3416 with SMTP id 586e51a60fabf-40eca29f54dmr1061066fac.46.1770897778961; Thu, 12 Feb 2026 04:02:58 -0800 (PST) Received: from [192.168.1.150] ([198.8.77.157]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-40eaf103ac3sm3493170fac.11.2026.02.12.04.02.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 12 Feb 2026 04:02:58 -0800 (PST) Message-ID: Date: Thu, 12 Feb 2026 05:02:56 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] io_uring: fix list corruption race in io_pollfree_wake() To: Soham Kute Cc: io-uring@vger.kernel.org, linux-kernel@vger.kernel.org, syzbot+ab12f0c08dd7ab8d057c@syzkaller.appspotmail.com References: <20260212115458.9149-1-officialsohamkute@gmail.com> Content-Language: en-US From: Jens Axboe In-Reply-To: <20260212115458.9149-1-officialsohamkute@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 2/12/26 4:54 AM, Soham Kute wrote: > io_pollfree_wake() removes the poll wait entry without holding > the waitqueue head lock. Other removal paths take the head lock, > so this can race and lead to list corruption detected by list_debug. > > Acquire the waitqueue lock before calling io_poll_remove_waitq(), > matching the locking used in io_poll_remove_entry(). > > Reported-by: syzbot+ab12f0c08dd7ab8d057c@syzkaller.appspotmail.com > Closes: https://syzkaller.appspot.com/bug?extid=ab12f0c08dd7ab8d057c > Signed-off-by: Soham Kute > --- > io_uring/poll.c | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) > > diff --git a/io_uring/poll.c b/io_uring/poll.c > index aac4b3b88..006154355 100644 > --- a/io_uring/poll.c > +++ b/io_uring/poll.c > @@ -383,10 +383,17 @@ static void io_poll_cancel_req(struct io_kiocb *req) > > static __cold int io_pollfree_wake(struct io_kiocb *req, struct io_poll *poll) > { > + struct wait_queue_head *head; > io_poll_mark_cancelled(req); > /* we have to kick tw in case it's not already */ > io_poll_execute(req, 0); > - io_poll_remove_waitq(poll); > + /* Pairs with smp_store_release() in io_poll_remove_waitq() */ > + head = smp_load_acquire(&poll->head); > + if (head) { > + spin_lock_irq(&head->lock); > + io_poll_remove_waitq(poll); > + spin_unlock_irq(&head->lock); > + } > return 1; > } The callpath is io_poll_wake() -> io_pollfree_wake(), where the former where much holds &head->lock already. How did you come to this conclusion? Your patch would instantly deadlock. Additionally, if you follow the replies off your syzbot link: Closes: https://syzkaller.appspot.com/bug?extid=ab12f0c08dd7ab8d057c you'll see I already debugged this issue, it's a media bug, and there's no POLLFREE involved at all. And it looks like I'm not even the first one to debug it, I subsequently found that someone else sent in a different patch for this last year, but solving the same root cause in media. -- Jens Axboe