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 BA0F11A6822; Sun, 7 Jun 2026 10:46:34 +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=1780829196; cv=none; b=D/EJFetag1v9ElLYLlv1n+Vn79LH0yvQXQ9RbehH/f/tX9rlX32p2Y3S+aUzNrjAKRTb/kE4emoaxJ4Q28uztph+kk+3PaaJ00v1+ulLmauwx2O3qTBEUdFvyhqO1SjepedO+cA9jzerGW4AfKP2Ojp5nEL0l5QU1wiW2RKAwwY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780829196; c=relaxed/simple; bh=p7QtBQw+jcfEuHv42TfDPWGkUN2nfv5yquLbWcU/vO0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=oHxsJN+nsnjN1xXzj1ZWpSU076l4ljf+j3all387mR5KJvQ/d6Kv1CfZyRyGwz19iGG25ZDk4Xb92m6/AZ0rg3kIKZenDcjeM2wqiHmfBl4ykCKkSVlhUzE8cfLU7nFtrfPf9kobEq2sumxYeBpZ+HyD4aqnlbG4vvv1sN3agfQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=khUJOfcP; 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="khUJOfcP" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D0E4E1F00893; Sun, 7 Jun 2026 10:46:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1780829194; bh=vg2g7L/luRvTUB1ScPEvUICmtsGkYxMkAlS3OJM63ZE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=khUJOfcPdU82hrM1X+WuAjqQR/xkVJC1FpWMCiTbxYRxPOvQO8V+Y+SRI1t1EsPc6 eNpfjlxoFrcjcXHQL7Jq4C+H1OMcweyd8X9wb0WWs0RzqxNfTJ5q1T2Lvgk8yQ8w8N dveah/vu9RMJqU9kmNwicIXJl+nElqfj50skE2Bk= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, stable , Wentao Liang Subject: [PATCH 6.18 224/315] usb: musb: omap2430: Fix use-after-free in omap2430_probe() Date: Sun, 7 Jun 2026 12:00:11 +0200 Message-ID: <20260607095735.802348730@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260607095727.528828913@linuxfoundation.org> References: <20260607095727.528828913@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.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Wentao Liang commit e194ce048f5a6c549b3a23a8c568c6470f40f772 upstream. In omap2430_probe(), of_node_put(np) is called prematurely before the last access to np, leading to a use-after-free if the node's reference count drops to zero. Move the of_node_put() calls after the last use of np in both the success and error paths. Fixes: ffbe2feac59b ("usb: musb: omap2430: Fix probe regression for missing resources") Cc: stable Signed-off-by: Wentao Liang Link: https://patch.msgid.link/20260409101104.480623-1-vulab@iscas.ac.cn Signed-off-by: Greg Kroah-Hartman --- drivers/usb/musb/omap2430.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/usb/musb/omap2430.c +++ b/drivers/usb/musb/omap2430.c @@ -338,7 +338,6 @@ static int omap2430_probe(struct platfor } else { device_set_of_node_from_dev(&musb->dev, &pdev->dev); } - of_node_put(np); glue->dev = &pdev->dev; glue->musb = musb; @@ -456,6 +455,7 @@ static int omap2430_probe(struct platfor dev_err(&pdev->dev, "failed to register musb device\n"); goto err_disable_rpm; } + of_node_put(np); return 0; @@ -465,6 +465,7 @@ err_put_control_otghs: if (!IS_ERR(glue->control_otghs)) put_device(glue->control_otghs); err_put_musb: + of_node_put(np); platform_device_put(musb); return ret;