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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 18 Jul 2023 14:20:28 +0100
From:   Sudeep Holla <sudeep.holla@....com>
To:     Cristian Marussi <cristian.marussi@....com>
Cc:     linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-pm@...r.kernel.org, james.quinlan@...adcom.com,
        f.fainelli@...il.com, vincent.guittot@...aro.org,
        lukasz.luba@....com, "Rafael J . Wysocki" <rafael@...nel.org>
Subject: Re: [PATCH v2] powercap: arm_scmi: Remove recursion while parsing
 zones

On Tue, Jul 18, 2023 at 11:17:26AM +0100, Cristian Marussi wrote:
> Powercap zones can be defined as arranged in a hierarchy of trees and when
> registering a zone with powercap_register_zone(), the kernel powercap
> subsystem expects this to happen starting from the root zones down to the
> leaves; on the other side, de-registration by powercap_deregister_zone()
> must begin from the leaf zones.
> 
> Available SCMI powercap zones are retrieved dynamically from the platform
> at probe time and, while any defined hierarchy between the zones is
> described properly in the zones descriptor, the platform returns the
> availables zones with no particular well-defined order: as a consequence,
> the trees possibly composing the hierarchy of zones have to be somehow
> walked properly to register the retrieved zones from the root.
> 
> Currently the ARM SCMI Powercap driver walks the zones using a recursive
> algorithm; this approach, even though correct and tested can lead to kernel
> stack overflow when processing a returned hierarchy of zones composed by
> particularly high trees.
> 
> Avoid possible kernel stack overflow by substituting the recursive approach
> with an iterative one supported by a dynamically allocated stack-like data
> structure.
> 
> Cc: Rafael J. Wysocki <rafael@...nel.org>
> Fixes: b55eef5226b7 ("powercap: arm_scmi: Add SCMI Powercap based driver")

Makes sense,

Acked-by: Sudeep Holla <sudeep.holla@....com>

--
Regards,
Sudeep

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ