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: <a9abc4c6-5b23-4165-9932-5e587a49e439@kernel.org>
Date: Mon, 3 Nov 2025 11:29:10 +0100
From: Hans Verkuil <hverkuil+cisco@...nel.org>
To: Geert Uytterhoeven <geert@...ux-m68k.org>,
 Miaoqian Lin <linmq006@...il.com>
Cc: Fabrizio Castro <fabrizio.castro.jz@...esas.com>,
 Mauro Carvalho Chehab <mchehab@...nel.org>,
 Magnus Damm <magnus.damm@...il.com>,
 Ramesh Shanmugasundaram <ramesh.shanmugasundaram@...renesas.com>,
 Hans Verkuil <hverkuil@...nel.org>, linux-media@...r.kernel.org,
 linux-renesas-soc@...r.kernel.org, linux-kernel@...r.kernel.org,
 stable@...r.kernel.org
Subject: Re: [PATCH] media: renesas: rcar_drif: fix device node reference leak
 in rcar_drif_bond_enabled

On 03/09/2025 17:09, Geert Uytterhoeven wrote:
> On Wed, 3 Sept 2025 at 15:37, Miaoqian Lin <linmq006@...il.com> wrote:
>> The function calls of_parse_phandle() which returns
>> a device node with an incremented reference count. When the bonded device
>> is not available, the function
>> returns NULL without releasing the reference, causing a reference leak.
>>
>> Add of_node_put(np) to release the device node reference.
>> The of_node_put function handles NULL pointers.
>>
>> Found through static analysis by reviewing the doc of of_parse_phandle()
>> and cross-checking its usage patterns across the codebase.
>>
>> Fixes: 7625ee981af1 ("[media] media: platform: rcar_drif: Add DRIF support")
>> Cc: stable@...r.kernel.org
>> Signed-off-by: Miaoqian Lin <linmq006@...il.com>
> 
> Reviewed-by: Geert Uytterhoeven <geert+renesas@...der.be>
> 
> Note that this is a duplicate of "[PATCH] media: rcar_drif: Fix an OF
> node leak in rcar_drif_bond_enabled()", which was never applied.
> 
> [1] https://lore.kernel.org/20250105111050.3859712-1-joe@pf.is.s.u-tokyo.ac.jp

Ah, that patch was never CC-ed to linux-media, so never ended up in our patchwork
instance. That's why that wasn't picked up.

I'll take this patch instead.

Regards,

	Hans

> 
> Gr{oetje,eeting}s,
> 
>                         Geert
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ