From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A8A903783D4; Tue, 21 Jul 2026 19:31:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784662281; cv=none; b=F2azFAJQCZGMu9CrL3jCy5mQB3MAqhAwWdaUzCk4uP1mwVjZSdwvtBpl2+2lsjPsw26/8zSZn1wRQdUyWhS5FwqSrDgWz+faLqWKluFniLa/GRoAJ/4e9TPZVMonWqHF1Q4yv7FBWUz8Rw+JpzNoFSIC/3iKYfdSjT0gOsGP2uI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784662281; c=relaxed/simple; bh=D+Oq4HYsoiRQ63gpcTQ+E0zGpNyjgJZ6qkFBKBCz7H0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bPdQhoMRad9IGtl36ekFHoYCYdyN2KTg+IMrPPmc7DN2URtyfRuA43QUyuq295DGcTqDppee9tE0vRyO9Zj555Cz1sl+8g/ZoK167N7COCbhEFfSMU7grwU7eHaU4+53svHVOl7bAtiYYMpOxrrKa6a2Hgam4gNDNNxF25rdoMk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=r7A8h/B+; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="r7A8h/B+" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DB8AE1F000E9; Tue, 21 Jul 2026 19:31:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1784662280; bh=BsMt+LODbSP0WLlBHlfQUNm9Qjoh6+mt69eOBhe/L5s=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=r7A8h/B+yVuxAgo6fCkg+MUGrGAORQepLh19ZxOKVeOI7b+oAEA5bdnniplkNqx9V 9we7RCMzhm3o/+Odvo4kgvvGgaVf+kxKRk6TJ7u7tbcvj/3UjVjkSF0McLv98prbG8 vUKT060oiQi+WT6/ExWAdDfQT8zuyEZgTKmeJzd4= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Grzegorz Nitka , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.12 0368/1276] dpll: fix stale iteration in dpll_pin_on_pin_unregister() Date: Tue, 21 Jul 2026 17:13:31 +0200 Message-ID: <20260721152454.343460655@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260721152446.065700225@linuxfoundation.org> References: <20260721152446.065700225@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Grzegorz Nitka [ Upstream commit 32239d600236a986c8e6d16aa814d3d91066b244 ] Neither parent->dpll_refs nor pin->dpll_refs on its own is a correct iteration target at unregister time: - pin->dpll_refs includes DPLLs the child was registered against via a different parent or directly; blind unregister WARNs on the cookie miss in dpll_xa_ref_pin_del(). - parent->dpll_refs reflects the parent's current attachments, not those at child-register time. Another driver may have (un)reg'd the parent against additional DPLLs in the meantime, so we miss registrations that exist and visit DPLLs that have none. Walk pin->dpll_refs and use dpll_pin_registration_find() to filter to entries whose cookie is this parent. Symmetric with dpll_pin_on_pin_register(), correct under any subsequent change to parent->dpll_refs. Fixes: 9431063ad323 ("dpll: core: Add DPLL framework base functions") Signed-off-by: Grzegorz Nitka Link: https://patch.msgid.link/20260607183045.1213735-4-grzegorz.nitka@intel.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/dpll/dpll_core.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/dpll/dpll_core.c b/drivers/dpll/dpll_core.c index f6ab4f0cad84d2..241d0e906a6e81 100644 --- a/drivers/dpll/dpll_core.c +++ b/drivers/dpll/dpll_core.c @@ -961,14 +961,19 @@ EXPORT_SYMBOL_GPL(dpll_pin_on_pin_register); void dpll_pin_on_pin_unregister(struct dpll_pin *parent, struct dpll_pin *pin, const struct dpll_pin_ops *ops, void *priv) { + struct dpll_pin_registration *reg; struct dpll_pin_ref *ref; unsigned long i; mutex_lock(&dpll_lock); dpll_pin_delete_ntf(pin); dpll_xa_ref_pin_del(&pin->parent_refs, parent, ops, priv, pin); - xa_for_each(&pin->dpll_refs, i, ref) + xa_for_each(&pin->dpll_refs, i, ref) { + reg = dpll_pin_registration_find(ref, ops, priv, parent); + if (!reg) + continue; __dpll_pin_unregister(ref->dpll, pin, ops, priv, parent); + } mutex_unlock(&dpll_lock); } EXPORT_SYMBOL_GPL(dpll_pin_on_pin_unregister); -- 2.53.0