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] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 30 Apr 2020 14:15:23 -0700
From:   Doug Anderson <dianders@...omium.org>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        "Rafael J. Wysocki" <rafael.j.wysocki@...el.com>,
        Andy Gross <agross@...nel.org>,
        Bjorn Andersson <bjorn.andersson@...aro.org>
Cc:     Evan Green <evgreen@...omium.org>,
        Matthias Kaehlcke <mka@...omium.org>,
        Maulik Shah <mkshah@...eaurora.org>,
        Stephen Boyd <swboyd@...omium.org>,
        Alexios Zavras <alexios.zavras@...el.com>,
        Allison Randal <allison@...utok.net>,
        Colin Cross <ccross@...roid.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v5 3/5] kernel/cpu_pm: Fix uninitted local in cpu_pm

Hi,

On Fri, Apr 24, 2020 at 9:47 AM Douglas Anderson <dianders@...omium.org> wrote:
>
> cpu_pm_notify() is basically a wrapper of notifier_call_chain().
> notifier_call_chain() doesn't initialize *nr_calls to 0 before it
> starts incrementing it--presumably it's up to the callers to do this.
>
> Unfortunately the callers of cpu_pm_notify() don't init *nr_calls.
> This potentially means you could get too many or two few calls to
> CPU_PM_ENTER_FAILED or CPU_CLUSTER_PM_ENTER_FAILED depending on the
> luck of the stack.
>
> Let's fix this.
>
> Fixes: ab10023e0088 ("cpu_pm: Add cpu power management notifiers")
> Signed-off-by: Douglas Anderson <dianders@...omium.org>
> Reviewed-by: Stephen Boyd <swboyd@...omium.org>
> ---
>
> Changes in v5: None
> Changes in v4: None
> Changes in v3: None
> Changes in v2:
> - ("Fix uninitted local in cpu_pm") new for v2.
>
>  kernel/cpu_pm.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

I'm hoping at least the first 3 patches in this series can land soon
so they can make it into v5.7.  The first 2 patches "Fix" a patch that
was introduced in v5.7 and the 3rd patch fixes a longstanding bug that
could also affect the same code.

Ideally all 3 patches could go through the Qualcomm tree to keep
things happy working there.  get_maintainer doesn't really identify an
owner for "kernel/cpu_pm.c" so maybe nobody would mind if patch 3
lands in the Qualcomm tree?  It looks like the most recent bugfixes to
it (back in 2017) were landed by Rafael, though.  Rafael: would you be
willing to Ack patch #3 for it to go in the Qualcomm tree?

---

If patches #4 and #5 look OK you could certainly also land them in
5.7, but the safer option for those two would be to target 5.8.

Thanks!

-Doug

>
> diff --git a/kernel/cpu_pm.c b/kernel/cpu_pm.c
> index cbca6879ab7d..44a259338e33 100644
> --- a/kernel/cpu_pm.c
> +++ b/kernel/cpu_pm.c
> @@ -80,7 +80,7 @@ EXPORT_SYMBOL_GPL(cpu_pm_unregister_notifier);
>   */
>  int cpu_pm_enter(void)
>  {
> -       int nr_calls;
> +       int nr_calls = 0;
>         int ret = 0;
>
>         ret = cpu_pm_notify(CPU_PM_ENTER, -1, &nr_calls);
> @@ -131,7 +131,7 @@ EXPORT_SYMBOL_GPL(cpu_pm_exit);
>   */
>  int cpu_cluster_pm_enter(void)
>  {
> -       int nr_calls;
> +       int nr_calls = 0;
>         int ret = 0;
>
>         ret = cpu_pm_notify(CPU_CLUSTER_PM_ENTER, -1, &nr_calls);
> --
> 2.26.2.303.gf8c07b1a785-goog
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ