From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f73.google.com (mail-ej1-f73.google.com [209.85.218.73]) (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 7B72C3E9591 for ; Tue, 28 Apr 2026 07:25:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.73 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777361103; cv=none; b=htCR01J+aDSGauAjQd6zYuLEa6qO9YVBSJjASvfnXQevQR4POCN2PVlJ2zB0UMLPW5Q/Ekoi6rpaWa733vMCrQHp+bscfBhyzu7a/mIq3YsMwM4192M4vHFvZE+rSVw+8Ehh3DaNJ+NZT2D15Cp8jLPDkTYWKREXCwL7O9U6fM0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777361103; c=relaxed/simple; bh=LX5pLfBgJOfNpsO9FijmGFyFM1foRZCPvIIhllinNRI=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=VvherKFKFhkiwC6iOVAw6sZ7QcrWpywifhtDT3vA6IQaoKPoHRpcwZYBMu49fcbPNFuGl6YCB2M7kvMCvfyg4TUjtHZyHREo8gVX7sCsJB6N8TLrVS9OXdC2RRKY9Ryjgwvf47vlxiDZl2Mip8g+E9a6NAWC7Pq1wq15W/Xhx3o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--aliceryhl.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=qITnXv2W; arc=none smtp.client-ip=209.85.218.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--aliceryhl.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="qITnXv2W" Received: by mail-ej1-f73.google.com with SMTP id a640c23a62f3a-ba661b6c550so1060608366b.0 for ; Tue, 28 Apr 2026 00:25:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1777361101; x=1777965901; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=DJ5yFfShBWBYpMcznSUsRaXS61QWv/Z8/quc22j7qLg=; b=qITnXv2WcqClnyG95lM05OlY72qwC8hJit2NvcPpo4Q6ZMiWSIvPTbUTKEdpSxiMDg CJN525DFIh8dTTzFsy8mqXZ6R9MHKwRvKtnKcpL+PAmPzpAR6k6/KQirETGa74eE613S LaqF3wKLLyqcG5YJjkucesmfuKg2HCD7jiT2sS7nc3WqOWTmQ2+zgIS9NQGDo0QEa/Dw uUNjDshEphdj+Pwx2GOnln30/sqhtVHR45LhmooGvJhkJlTQX8NXqVMJtRRISrMLn48e SOpAQ3xYJ/yY9IxsrSHyNe/S0QG/pnHc66/p5xSWvnPZXfCbA2/W3066mceJ7I2TBx7v s9wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777361101; x=1777965901; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=DJ5yFfShBWBYpMcznSUsRaXS61QWv/Z8/quc22j7qLg=; b=JjLV+3W81/QDvVj6HEV1taiZ6l82P+5Y5wDmyUAd7MwA17Dre97UevbTmtBDNstOzd 3dhJX5VkbIMb8575TSvAQbFiumhtFukvHtGH7F7ZQsM9lnd3poNtqRV0pNmsT5Bbcvrv YUxR8sK9GcoQC9f2FlnvUz6GeqTjVJjIvSKKynxyzDX2gyI4Npnk6+9Ryv8Dy300dL7Z VGJfZmSjKIioAQWoEoPtNJ55KuDXMsoX2DaqI3xmajZFlew2tYtubSuGoTbFk0J5ZAb+ P95TuRCZcGREIEDgLOFeCJ/ofcHNgmRcyGbu4PW8UHX3kqARrkHOdSKoyfEU7Naf6HSe zmpQ== X-Forwarded-Encrypted: i=1; AFNElJ9beuwkhN2sJDNkkshXlXzByKsoZTPuMYtdMCoJtfBG4+fISZLJMbZYMjANsZXuvwLpKSIKNPM=@vger.kernel.org X-Gm-Message-State: AOJu0YzAHu1ItJNOUItNmVR9n6cGMFLasnESH50Z6nIjhGnFztHvuEK2 eAy3XW6xgayyENgZQcuwR1avVnXCR7FPrqseculzzhgyMWgO2rYVgf1VeCbHRvTwkLmf/X8LjXM z3eXQfMKf8EVUHkVXOg== X-Received: from ejcgl16.prod.google.com ([2002:a17:907:3c90:b0:b97:914c:2968]) (user=aliceryhl job=prod-delivery.src-stubby-dispatcher) by 2002:a17:907:3e9c:b0:bae:642a:8712 with SMTP id a640c23a62f3a-bb804728367mr108142566b.26.1777361100566; Tue, 28 Apr 2026 00:25:00 -0700 (PDT) Date: Tue, 28 Apr 2026 07:24:59 +0000 In-Reply-To: <20260403-lockhold-v1-1-c332b56cd8ae@google.com> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260403-lockhold-v1-1-c332b56cd8ae@google.com> Message-ID: Subject: Re: [PATCH] rust_binder: Avoid holding lock when dropping delivered_death From: Alice Ryhl To: Matthew Maurer , Greg Kroah-Hartman Cc: "Arve =?utf-8?B?SGrDuG5uZXbDpWc=?=" , Todd Kjos , Christian Brauner , Carlos Llamas , Miguel Ojeda , Boqun Feng , Gary Guo , "=?utf-8?B?QmrDtnJu?= Roy Baron" , Benno Lossin , Andreas Hindborg , Trevor Gross , Danilo Krummrich , Wedson Almeida Filho , Matt Gilbride , Paul Moore , stable@vger.kernel.org, linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, David Stevens Content-Type: text/plain; charset="utf-8" On Fri, Apr 03, 2026 at 06:18:58PM +0000, Matthew Maurer wrote: > In 6c37bebd8c926, we switched to looping over the list and dropping each > individual node, ostensibly without the lock held in the loop body. > > If the kernel were using Rust Edition 2024, the comment would be > accurate, and the lock would not be held across the drop. However, the > kernel is currently using 2021, so tail expression lifetime extension > results in the lock being held across the drop. Explicitly binding the > expression result to a variable makes the lockguard no longer part of a > tail expression, causing the lock to be dropped before entering the loop > body. > > This was detected via `CONFIG_PROVE_LOCKING` identifying an invalid wait > context at the drop site. > > Reported-by: David Stevens > Signed-off-by: Matthew Maurer > Cc: stable@vger.kernel.org > Fixes: eafedbc7c050 ("rust_binder: add Rust Binder driver") I realized this tag should be: Fixes: 6c37bebd8c92 ("rust_binder: avoid mem::take on delivered_deaths") Greg, can you fix this on apply, or do you want a new version? Alice