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 0D6B7478E26; Tue, 16 Jun 2026 17:15:42 +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=1781630143; cv=none; b=lc6zKVR+f1NQNcvh97XubrgwjzwP7JJux4/BU2RFZj2D6Hw28G86EgJmPMymhnudM8dIYwjGykUUv/07aIStxKFmL8OqsoSBF3xdYE1a2dvSkldaU/pMdFSic/b0Tmvhphx5ZHqYYAOWWU6W2JIRFr6eKoZ689QdcjQqlMHhWB8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781630143; c=relaxed/simple; bh=xulDoHhpD6gbQeQ4oB+1zL7jAP32REA6GRFsID7OYlU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iUVt5UXjmNEbDeRRZ5C/TMUYRkmzyebneYwHS6jWSAhhL66m4bBP27J9rQpwCUsjH0+zSc374pEqL+blHXSE2I/3MDeuzlZOzCsS+AojgYqPkm18ENC8BBQqVl4uPbmTahIuC7Hj2lLRNqYzj6C3r5PtQx9q2xIax+voqymfwn4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=twVIafn+; 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="twVIafn+" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 171AC1F000E9; Tue, 16 Jun 2026 17:15:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1781630141; bh=2p2FfoLUxeADZ9l6S3HULSxBl2H7Gaf7KrhvnQKKVAc=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=twVIafn+2b0AkvlrDdOzf63bfCg+0OWWv1EiowtoMGTqK9aMnilbJT4ZE3fKw+/qN aOyFp0l90+BHGcP3nDDkmOqdzICBSUorAiYxW9c7iDF9p4lPSWLi0rT7tJ1L44Hn2/ wyfZ4d6LTsbiGvwJTJ+OF1I0koR/I0FoKDxgEE5Q= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, stable , Wentao Liang , Sasha Levin Subject: [PATCH 6.6 419/452] usb: musb: omap2430: Fix use-after-free in omap2430_probe() Date: Tue, 16 Jun 2026 20:30:46 +0530 Message-ID: <20260616145138.774543046@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260616145117.796205997@linuxfoundation.org> References: <20260616145117.796205997@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 [ Upstream commit e194ce048f5a6c549b3a23a8c568c6470f40f772 ] 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 Signed-off-by: Sasha Levin 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 @@ -340,7 +340,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; @@ -458,6 +457,7 @@ static int omap2430_probe(struct platfor dev_err(&pdev->dev, "failed to register musb device\n"); goto err3; } + of_node_put(np); return 0; @@ -467,6 +467,7 @@ err_put_control_otghs: if (!IS_ERR(glue->control_otghs)) put_device(glue->control_otghs); err2: + of_node_put(np); platform_device_put(musb); err0: