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-next>] [day] [month] [year] [list]
Date:   Mon, 15 May 2023 11:34:02 +0000
From:   Wyes Karny <wyes.karny@....com>
To:     <ray.huang@....com>, <rafael@...nel.org>, <viresh.kumar@...aro.org>
CC:     <linux-pm@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <gautham.shenoy@....com>, Wyes Karny <wyes.karny@....com>
Subject: [PATCH v3 0/2] cpufreq/amd-pstate: Fix null pointer dereference when frequency invariance is disabled

Currently, amd_pstate only uses `adjust_perf` and `target` callback
functions to get the frequency/effective utilization data from scaling
governors. But the governor can switch back to fast_switch callback when
frequency invariance is disabled. In that case, if the driver didn't set
fast_switch function pointer, null pointer dereference can happen and
kernel will crash.

Currently, frequency invariance is turned off when any anomaly is
detected with aperf/mperf readings. Which triggers this problem.

Fix this by adding `fast_switch` function in the amd_pstate driver. The
same problem could arise with intel_pstate driver when the driver is in
passive mode and the governor is schedutil.

Additionally, display a warning message if the scaling driver sets
fast_swich_possible flag but not fast_switch function pointer.

Changelog:
v2 -> v3
- Add fast_switch callback in amd_pstate and warn if any driver
  sets fast_swich_possible flag but not fast_switch function pointer.

v1 -> v2
- Remove fast_switch_enabled flag dependency for adjust_perf callback

v1: https://lore.kernel.org/linux-pm/20230410095045.14872-1-wyes.karny@amd.com/
v2: https://lore.kernel.org/linux-pm/20230509180503.739208-1-wyes.karny@amd.com/

Gautham R. Shenoy (1):
  amd_pstate: Add ->fast_switch() callback

Wyes Karny (1):
  cpufreq: Warn if fast_switch is not set

 drivers/cpufreq/amd-pstate.c | 35 +++++++++++++++++++++++++++++------
 drivers/cpufreq/cpufreq.c    | 18 ++++++++++++++++++
 include/linux/cpufreq.h      |  5 ++++-
 3 files changed, 51 insertions(+), 7 deletions(-)

-- 
2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ