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 90B8319049B; Thu, 2 Jul 2026 16:51:47 +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=1783011108; cv=none; b=MmAFcv4OpdGtX12vn80POPBH8f455eG4JnYoy/yJTXwzu8896eWMj+aGpvHEpnSObpuREN8cYDd/MMsWGN1NOc1xawLzLCIyVgQnPQZ7fdqskHKDU0m6ycwsYtprvQy7YrN83S7FRXzYdiAtull9sQSb1y6SSVmtnrk1N/J23m0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783011108; c=relaxed/simple; bh=bjJ0QcRUsz+AXIbf4qIbNf6YvS2bLTWCZYR64thKzLY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XMfwzz9iO1pZyyghZOmP3Ef4nJuY2R8TuI+AwRbnh1Gst6DvqhL9pu7ROqoZ63a3uN72oMRZk98gG8uuS2oE790eSJRd8lmJEYb1RWCbMmP8QtTI6AKuWQVf4izQJ0fa/L8ALVmPlFg9xkRpLxvdJYdByGKN2vZ4sTtaOo3ze50= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=AJbLZbG7; 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="AJbLZbG7" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 02C921F00A3A; Thu, 2 Jul 2026 16:51:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1783011107; bh=41xR6js+O8sEQa6DNbxCqcalwNnx4SPIAigs7U2btNY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=AJbLZbG7ADyXlWtwasTX4lM3eEP+6NKg7lF1CNtNxnj3NaxKjDrMSPo7zMAdMUVL8 EEfeq5vtDgcvk9e8eA3BIEKcMB8yHYC0tkJUEc/pJQDbLM3+nFdn9EOzkHIzK0ttyI YNQHCmkSZ9gqGIUyM2RMxe1ZY6NicReye6qV35jM= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Wentao Liang , Sebastian Reichel Subject: [PATCH 6.6 159/175] power: reset: linkstation-poweroff: fix use-after-free in the linkstation_poweroff_init() Date: Thu, 2 Jul 2026 18:21:00 +0200 Message-ID: <20260702155119.143000117@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260702155115.766838875@linuxfoundation.org> References: <20260702155115.766838875@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.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Wentao Liang commit 8eec545cde69e46e9a1d2b7d915ce4f5df85b3bd upstream. Move of_node_put(dn) after the of_match_node() call, which still needs the node pointer. The node reference is correctly released after use. Fixes: e2f471efe1d6 ("power: reset: linkstation-poweroff: prepare for new devices") Cc: stable@vger.kernel.org Signed-off-by: Wentao Liang Link: https://patch.msgid.link/20260407073025.271865-1-vulab@iscas.ac.cn Signed-off-by: Sebastian Reichel Signed-off-by: Greg Kroah-Hartman --- drivers/power/reset/linkstation-poweroff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/power/reset/linkstation-poweroff.c +++ b/drivers/power/reset/linkstation-poweroff.c @@ -163,10 +163,10 @@ static int __init linkstation_poweroff_i dn = of_find_matching_node(NULL, ls_poweroff_of_match); if (!dn) return -ENODEV; - of_node_put(dn); match = of_match_node(ls_poweroff_of_match, dn); cfg = match->data; + of_node_put(dn); dn = of_find_node_by_name(NULL, cfg->mdio_node_name); if (!dn)