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]
Date:   Fri, 23 Apr 2021 18:17:42 -0700
From:   Stephen Boyd <sboyd@...nel.org>
To:     Tudor Ambarus <tudor.ambarus@...rochip.com>,
        frowand.list@...il.com, geert@...ux-m68k.org,
        gregkh@...uxfoundation.org, guillaume.tucker@...labora.com,
        khilman@...nel.org, len.brown@...el.com, linux@...ck-us.net,
        maxime@...no.tech, maz@...nel.org, mturquette@...libre.com,
        nsaenz@...nel.org, nsaenzjulienne@...e.de, pavel@....cz,
        rafael@...nel.org, robh+dt@...nel.org, saravanak@...gle.com,
        tglx@...utronix.de, ulf.hansson@...aro.org
Cc:     linux-clk@...r.kernel.org, linux-kernel@...r.kernel.org,
        corbet@....net, nicolas.ferre@...rochip.com,
        claudiu.beznea@...rochip.com, linux-doc@...r.kernel.org,
        linux-pm@...r.kernel.org, devicetree@...r.kernel.org,
        linux-acpi@...r.kernel.org, kernel-team@...roid.com,
        linux-rpi-kernel@...ts.infradead.org,
        Tudor Ambarus <tudor.ambarus@...rochip.com>,
        Marek Szyprowski <m.szyprowski@...sung.com>
Subject: Re: [PATCH] clk: Skip clk provider registration when np is NULL

Quoting Tudor Ambarus (2021-04-23 12:12:36)
> commit 6579c8d97ad7 ("clk: Mark fwnodes when their clock provider is added")
> revealed that clk/bcm/clk-raspberrypi.c driver calls
> devm_of_clk_add_hw_provider(), with a NULL dev->of_node, which resulted in a
> NULL pointer dereference in of_clk_add_provider() when calling
> fwnode_dev_initialized().
> 
> Returning 0 is reducing the if conditions in driver code and is being
> consistent with the CONFIG_OF=n inline stub that returns 0 when CONFIG_OF
> is disabled. The downside is that drivers will maybe register clkdev lookups
> when they don't need to and waste some memory.
> 
> Reported-by: Marek Szyprowski <m.szyprowski@...sung.com>
> Fixes: 6579c8d97ad7 ("clk: Mark fwnodes when their clock provider is added")
> Signed-off-by: Tudor Ambarus <tudor.ambarus@...rochip.com>
> ---

Please don't send patches as replies to previous threads. It makes it
harder to find the patch at a glance of all threads.

It also seems to be a

Fixes: 3c9ea42802a1 ("clk: Mark fwnodes when their clock provider is added/removed")

so can you please have both Fixes tags?

> This would be the second approach, where we don't return an error when
> one calls devm_of_clk_add_hw_provider with a NULL of_node, but instead
> we just return 0 and skip the logic in the core and the drivers.

With the Fixes tag updated please send To: gregkh@ to pick up as the
problematic patch (6579c8d97ad7) is in the driver tree and not the clk
tree, and add my tag

Reviewed-by: Stephen Boyd <sboyd@...nel.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ