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: <b431d19f-c144-44c9-887c-a2f3bef7fc1a@gmail.com>
Date: Thu, 8 May 2025 12:04:41 +0100
From: "Colin King (gmail)" <colin.i.king@...il.com>
To: Michael Tretter <m.tretter@...gutronix.de>
Cc: "linux-arm-kernel@...ts.infradead.org"
 <linux-arm-kernel@...ts.infradead.org>, Stephen Boyd <sboyd@...nel.org>,
 Michal Simek <michal.simek@....com>,
 "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
 kernel@...gutronix.de
Subject: Re: soc: xilinx: vcu: issue with 2nd null check on pointer divider

Hi Michael,

thanks for the update, I forgot I already reported this back in 2021(!). 
Perhaps the upstream folk can apply your patch oneday :-/

Colin

On 08/05/2025 11:57, Michael Tretter wrote:
> Hi Colin,
> 
> On Thu, 08 May 2025 11:21:05 +0100, Colin King (gmail) wrote:
>> There seems to be an issue with the following function with the second check
>> on if (!divider). Firstly this is redundant code since divider has
>> already been null checked, so I suspect it should be instead if (!mux) but
>> I'm unsure if this is correct since the call to clk_hw_unregister_divider is
>> not made.  Also if mux is null, isn't the call to clk_hw_unregister_mux()
>> problematic as a null pointer is being passed to it.
>>
>> static void xvcu_clk_hw_unregister_leaf(struct clk_hw *hw)
>> {
>>          struct clk_hw *gate = hw;
>>          struct clk_hw *divider;
>>          struct clk_hw *mux;
>>
>>          if (!gate)
>>                  return;
>>
>>          divider = clk_hw_get_parent(gate);
>>          clk_hw_unregister_gate(gate);
>>          if (!divider)
>>                  return;
>>
>>          mux = clk_hw_get_parent(divider);
>>          clk_hw_unregister_mux(mux);
>>          if (!divider)
>>                  return;
>>
>>          clk_hw_unregister_divider(divider);
>> }
> 
> I sent a patch [0] to rewrite the function and make it more readable a
> while ago. Unfortunately, there wasn't any reaction to the patch, and
> then I forgot about it.
> 
> Michael
> 
> [0] https://lore.kernel.org/linux-arm-kernel/20210318144230.3438009-1-m.tretter@pengutronix.de/


Download attachment "OpenPGP_0x68C287DFC6A80226.asc" of type "application/pgp-keys" (4825 bytes)

Download attachment "OpenPGP_signature.asc" of type "application/pgp-signature" (841 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ