lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <3f51d21db8d91957ffb618856635595ef959049d.camel@mediatek.com>
Date: Wed, 19 Nov 2025 06:02:35 +0000
From: CK Hu (胡俊光) <ck.hu@...iatek.com>
To: "dmitry.osipenko@...labora.com" <dmitry.osipenko@...labora.com>,
	"linmq006@...il.com" <linmq006@...il.com>, "chunkuang.hu@...nel.org"
	<chunkuang.hu@...nel.org>, "simona@...ll.ch" <simona@...ll.ch>,
	AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
	"dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
	"airlied@...il.com" <airlied@...il.com>, "msp@...libre.com"
	<msp@...libre.com>, "linux-arm-kernel@...ts.infradead.org"
	<linux-arm-kernel@...ts.infradead.org>, "p.zabel@...gutronix.de"
	<p.zabel@...gutronix.de>, "matthias.bgg@...il.com" <matthias.bgg@...il.com>,
	"granquet@...libre.com" <granquet@...libre.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-mediatek@...ts.infradead.org" <linux-mediatek@...ts.infradead.org>
CC: "stable@...r.kernel.org" <stable@...r.kernel.org>
Subject: Re: [PATCH] drm/mediatek: Fix device node reference leak in
 mtk_dp_dt_parse()

On Wed, 2025-10-29 at 15:23 +0800, Miaoqian Lin wrote:
> External email : Please do not click links or open attachments until you have verified the sender or the content.
> 
> 
> The function mtk_dp_dt_parse() calls of_graph_get_endpoint_by_regs()
> to get the endpoint device node, but fails to call of_node_put() to release
> the reference when the function returns. This results in a device node
> reference leak.
> 
> Fix this by adding the missing of_node_put() call before returning from
> the function.
> 
> Found via static analysis and code review.

Reviewed-by: CK Hu <ck.hu@...iatek.com>

> 
> Fixes: f70ac097a2cf ("drm/mediatek: Add MT8195 Embedded DisplayPort driver")
> Cc: stable@...r.kernel.org
> Signed-off-by: Miaoqian Lin <linmq006@...il.com>
> ---
>  drivers/gpu/drm/mediatek/mtk_dp.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpu/drm/mediatek/mtk_dp.c b/drivers/gpu/drm/mediatek/mtk_dp.c
> index bef6eeb30d3e..b0b1e158600f 100644
> --- a/drivers/gpu/drm/mediatek/mtk_dp.c
> +++ b/drivers/gpu/drm/mediatek/mtk_dp.c
> @@ -2087,6 +2087,7 @@ static int mtk_dp_dt_parse(struct mtk_dp *mtk_dp,
>         endpoint = of_graph_get_endpoint_by_regs(pdev->dev.of_node, 1, -1);
>         len = of_property_count_elems_of_size(endpoint,
>                                               "data-lanes", sizeof(u32));
> +       of_node_put(endpoint);
>         if (len < 0 || len > 4 || len == 3) {
>                 dev_err(dev, "invalid data lane size: %d\n", len);
>                 return -EINVAL;
> --
> 2.39.5 (Apple Git-154)
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ