From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-il1-f178.google.com (mail-il1-f178.google.com [209.85.166.178]) (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 7F6D223A0F0 for ; Mon, 13 Jan 2025 14:41:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736779269; cv=none; b=F5R3w0/0pKkAFcaE9qw1sWRtafqT1lRYeq/8qLvVtxMIdiVWQRABdHfjfc81rIZ8xFl1/RLDDyOgIIWRdvCiIhAmpEz7ILm9MPs2ENS1XoAfOjQsipH4JDtwiV6kCS2YyPbzOJ286nFB2CVtC1ievWqoe77GGXjOHSMBlOCP840= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736779269; c=relaxed/simple; bh=MkRhU+hEUVNXhSMZtusrZ34UrCVHqaM9agyt3mGSGtk=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=aAfDPgNjfL6+wHGpD7f4WZFZN8HQEjr/7uhOWvAivZhoIz2LW/+aPX17WuAyLlzXFhdxgp8yGluWQYYahPLO6IHHCubgaUBdHt/vzPIFDUfc02ryIMoCltpUIjc51jbj7RsLtKV6iob5SEjyAvhDHjtPz30w/fZXlRVUXGayp/w= 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=Bb14Rb/+; arc=none smtp.client-ip=209.85.166.178 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="Bb14Rb/+" Received: by mail-il1-f178.google.com with SMTP id e9e14a558f8ab-3a8c7b02d68so29608465ab.3 for ; Mon, 13 Jan 2025 06:41:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20230601.gappssmtp.com; s=20230601; t=1736779265; x=1737384065; 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=gSEPsTSDg5NSELpR5L3UvRRfuKV7NotquBWPBaWmNWE=; b=Bb14Rb/+0ou6TAC16rVkjljCEm5Z5c5FoLV/X1kyc6hnkSd5ZSHxZGTVkMEMLU3LaQ I5pRc+/a5u6gPdyS14wq0N+yPGCLjmP/PKbHURICDVRL7srk/CVEBdXfmXiNENf3ChOL fREIxfFPb8bcrxmNMuSVSgomGEU9A05TiROx2wbYw8BJFTwbvv1CM7jcBnooARz+HxBH CTvxnoJLoU2JQU/P+fZeMpYNH2AQr5kD6TO3BxPwsTF95kJzuh4VgJXKYyCpi1CPLsBh 2SqKUKJAKakTHSXYB6pEqwFRRzfyQOfTgdLUNPcjUl7tgLFTjsJCBhHSsC+Gh3fUDo1A opFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736779265; x=1737384065; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=gSEPsTSDg5NSELpR5L3UvRRfuKV7NotquBWPBaWmNWE=; b=rnrIAMTMK7JZP7j0yZ6AnVT2ZDKX5dtARdrM7y/DjVjX6jr5cRCxtczn5BuW81+CJu OEUH6+J7yPH69elfPGVlNMKSCedU9yYDygzXS1lf0XrBNwVzNT59AfhJ6+BXSi/8HWJ3 yYSgjkzjBnJIaadlzwkWONeYaLD7Mjcp+FJozjy12ULnGd7PQUnlk9nwkF1Kt6UaGAuf xycCNrCt1tkbSp0Fr6CXcSkcw1WOiliWBsXhHPYJ7nM8wBAxIol/EdLtAu1qbEinPRx7 GDSo8/qbp6Nbcqs7QYX1/Im2zqmndxxEY9R9qpu8UrNFiJSprx5AGvR9CWSQIsfY6alh kdYg== X-Forwarded-Encrypted: i=1; AJvYcCWMR/6B7poxCnoG+/7C7tKevONqkhHegS7XHu41xcyIR/9/0xU6V3qjlsQFuHdPuHnakj0xX3aLbdyT5zs=@vger.kernel.org X-Gm-Message-State: AOJu0Yy9+hp3yMjFePQNQcmfwoBf1QP/MDXitmdc1YZWdrGs0XCmgEwY IqokWDZSzZW3LLxebyi0E2r+nayh9cLaojFPSMvf01YtUq2dOos1Z7HoyZdO9go= X-Gm-Gg: ASbGncuifNwRVQBWDiFH9czM3r5/QlVjYzxL2DHNP5096b16pBctzj3v+8COAs7YbpS 5wdVQ5qn8kpIHKc+moQo3sE5k4h3DqOowQLFhSaT0Wp5+ibVDrQ6KT8YAJt4kQiBUmLfWz5hYS6 gAu/5E61Du2/+61K2Ni+OkdqmCi4BdC3HFpjUK8wiKbpRgEhMVOAPL/gQLZAFBWRq7xFPJ0ttha jZnjiU6N5He3GeAqcOewH75xEpGoKSE2OfIiGB8blBXT12oY2UJ X-Google-Smtp-Source: AGHT+IEXUe9MaclZbcj9uS5sSg0Caj3AYDWXDGsIxrkXuoYg7sZ9/qAdHOge7AimKL3yPRGgno8kQQ== X-Received: by 2002:a05:6e02:3d01:b0:3a7:d84c:f2b0 with SMTP id e9e14a558f8ab-3ce3a87d5d7mr189091555ab.8.1736779265728; Mon, 13 Jan 2025 06:41:05 -0800 (PST) Received: from [192.168.1.116] ([96.43.243.2]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4ea1b5f93desm2800687173.14.2025.01.13.06.41.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 13 Jan 2025 06:41:05 -0800 (PST) Message-ID: <657d1713-b4dc-4ecd-be9e-599a1c8e7a09@kernel.dk> Date: Mon, 13 Jan 2025 07:41:04 -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: futex+io_uring: futex_q::task can maybe be dangling (but is not actually accessed, so it's fine) To: Peter Zijlstra Cc: Jann Horn , Thomas Gleixner , Ingo Molnar , Darren Hart , Davidlohr Bueso , =?UTF-8?Q?Andr=C3=A9_Almeida?= , kernel list , Pavel Begunkov , io-uring References: <3b78348b-a804-4072-b088-9519353edb10@kernel.dk> <20250113143832.GH5388@noisy.programming.kicks-ass.net> Content-Language: en-US From: Jens Axboe In-Reply-To: <20250113143832.GH5388@noisy.programming.kicks-ass.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 1/13/25 7:38 AM, Peter Zijlstra wrote: > On Fri, Jan 10, 2025 at 08:33:34PM -0700, Jens Axboe wrote: > >> @@ -548,7 +549,7 @@ void __futex_queue(struct futex_q *q, struct futex_hash_bucket *hb) >> >> plist_node_init(&q->list, prio); >> plist_add(&q->list, &hb->chain); >> - q->task = current; >> + q->task = task; >> } >> >> /** > > The alternative is, I suppose, to move the q->task assignment out to > these two callsites instead. Thomas, any opinions? That suggestion was posed in my reply as well, but I didn't spend the time checking if it was safe/feasible. If you/Thomas think it's safe, we can certainly do that instead. But I'd much rather you make that call than me :-) -- Jens Axboe