Linux Power Management development
 help / color / mirror / Atom feed
From: Shuah Khan <skhan@linuxfoundation.org>
To: Lukas Beckmann <lbckmnn@mailbox.org>,
	Thomas Renninger <trenn@suse.com>, Shuah Khan <shuah@kernel.org>,
	"John B. Wyatt IV" <jwyatt@redhat.com>,
	John Kacur <jkacur@redhat.com>,
	Dominik Brodowski <linux@dominikbrodowski.net>
Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org, Shuah Khan <skhan@linuxfoundation.org>
Subject: Re: [PATCH v4] cpupower: fix use-after-free and stale limits in frequency-set
Date: Mon, 23 Nov 2026 14:39:48 -0700	[thread overview]
Message-ID: <b4e4fa4a-2763-42da-ae9f-3ae65132f678@linuxfoundation.org> (raw)
In-Reply-To: <20261120-cpupower-freq-set-use-after-free-v4-1-928675d53a23@mailbox.org>

On 11/20/26 15:17, Lukas Beckmann wrote:
> do_new_policy() directly fills the unset fields of new_pol from the
> current CPU's policy. This is problematic because do_new_policy() is
> called with the same new_pol for multiple CPUs by do_one_cpu() in the
> slow path. This results in stale values in new_pol being applied
> (starting from the second CPU that should be changed), and even a
> use-after-free (for the governor string).
> 
> Fix this by building the target policy from new_pol and the current
> policy in do_new_policy() instead of filling the missing values into
> new_pol.
> 
> Fixes: 7fe2f6399a84 ("cpupowerutils - cpufrequtils extended with quite some features")
> Cc: stable@vger.kernel.org
> Signed-off-by: Lukas Beckmann <lbckmnn@mailbox.org>
> ---
Applied to my cpupower branch for next PR to PM maintainer.

https://web.git.kernel.org/pub/scm/linux/kernel/git/shuah/linux.git/log/?h=cpupower

thanks,
-- Shuah

      reply	other threads:[~2026-11-23 21:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-20 22:17 [PATCH v4] cpupower: fix use-after-free and stale limits in frequency-set Lukas Beckmann
2026-11-23 21:39 ` Shuah Khan [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b4e4fa4a-2763-42da-ae9f-3ae65132f678@linuxfoundation.org \
    --to=skhan@linuxfoundation.org \
    --cc=jkacur@redhat.com \
    --cc=jwyatt@redhat.com \
    --cc=lbckmnn@mailbox.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux@dominikbrodowski.net \
    --cc=shuah@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=trenn@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox