acrn-kernel/drivers/cpufreq
Thomas Weißschuh 5e720f8c8c cpufreq: amd-pstate: fix global sysfs attribute type
In commit 3666062b87 ("cpufreq: amd-pstate: move to use bus_get_dev_root()")
the "amd_pstate" attributes where moved from a dedicated kobject to the
cpu root kobject.

While the dedicated kobject expects to contain kobj_attributes the root
kobject needs device_attributes.

As the changed arguments are not used by the callbacks it works most of
the time.
However CFI will detect this issue:

[ 4947.849350] CFI failure at dev_attr_show+0x24/0x60 (target: show_status+0x0/0x70; expected type: 0x8651b1de)
...
[ 4947.849409] Call Trace:
[ 4947.849410]  <TASK>
[ 4947.849411]  ? __warn+0xcf/0x1c0
[ 4947.849414]  ? dev_attr_show+0x24/0x60
[ 4947.849415]  ? report_cfi_failure+0x4e/0x60
[ 4947.849417]  ? handle_cfi_failure+0x14c/0x1d0
[ 4947.849419]  ? __cfi_show_status+0x10/0x10
[ 4947.849420]  ? handle_bug+0x4f/0x90
[ 4947.849421]  ? exc_invalid_op+0x1a/0x60
[ 4947.849422]  ? asm_exc_invalid_op+0x1a/0x20
[ 4947.849424]  ? __cfi_show_status+0x10/0x10
[ 4947.849425]  ? dev_attr_show+0x24/0x60
[ 4947.849426]  sysfs_kf_seq_show+0xa6/0x110
[ 4947.849433]  seq_read_iter+0x16c/0x4b0
[ 4947.849436]  vfs_read+0x272/0x2d0
[ 4947.849438]  ksys_read+0x72/0xe0
[ 4947.849439]  do_syscall_64+0x76/0xb0
[ 4947.849440]  ? do_user_addr_fault+0x252/0x650
[ 4947.849442]  ? exc_page_fault+0x7a/0x1b0
[ 4947.849443]  entry_SYSCALL_64_after_hwframe+0x72/0xdc

Fixes: 3666062b87 ("cpufreq: amd-pstate: move to use bus_get_dev_root()")
Reported-by: Jannik Glückert <jannik.glueckert@gmail.com>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217765
Link: https://lore.kernel.org/lkml/c7f1bf9b-b183-bf6e-1cbb-d43f72494083@gmail.com/
Cc: All applicable <stable@vger.kernel.org>
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2023-08-07 19:41:48 +02:00
..
Kconfig cpufreq: Make CONFIG_CPUFREQ_DT_PLATDEV depend on OF 2023-06-30 09:43:43 +02:00
Kconfig.arm cpufreq: Fix typo in the ARM_BRCMSTB_AVS_CPUFREQ Kconfig entry 2023-03-22 20:14:37 +01:00
Kconfig.powerpc
Kconfig.x86 cpufreq: amd-pstate: Add a kernel config option to set default mode 2023-06-21 18:44:56 +02:00
Makefile Power management updates for 6.3-rc1 2023-02-21 12:13:58 -08:00
acpi-cpufreq.c cpufreq: ACPI: Prevent a warning when another frequency driver is loaded 2023-05-15 19:59:29 +02:00
amd-pstate-trace.c
amd-pstate-trace.h
amd-pstate-ut.c
amd-pstate.c cpufreq: amd-pstate: fix global sysfs attribute type 2023-08-07 19:41:48 +02:00
amd_freq_sensitivity.c cpufreq: amd_freq_sensitivity: Add missing pci_dev_put() 2022-11-30 19:50:04 +01:00
apple-soc-cpufreq.c cpufreq: apple-soc: Fix an IS_ERR() vs NULL check 2023-03-01 19:34:54 +01:00
armada-8k-cpufreq.c cpufreq: armada-8k: add ap807 support 2023-06-19 09:50:31 +05:30
armada-37xx-cpufreq.c cpufreq: armada-37xx: stop using 0 as NULL pointer 2023-01-10 09:32:03 +05:30
bmips-cpufreq.c
brcmstb-avs-cpufreq.c cpufreq: Make cpufreq_unregister_driver() return void 2023-02-09 20:19:18 +01:00
cppc_cpufreq.c cpufreq: CPPC: Add u64 casts to avoid overflowing 2022-12-27 08:27:14 +05:30
cpufreq-dt-platdev.c cpufreq: dt-platdev: Support building as module 2023-06-05 16:33:05 +05:30
cpufreq-dt.c
cpufreq-dt.h
cpufreq-nforce2.c
cpufreq.c cpufreq: Fail driver register if it has adjust_perf without fast_switch 2023-06-15 18:15:25 +02:00
cpufreq_conservative.c
cpufreq_governor.c
cpufreq_governor.h
cpufreq_governor_attr_set.c
cpufreq_ondemand.c
cpufreq_ondemand.h
cpufreq_performance.c
cpufreq_powersave.c
cpufreq_stats.c cpufreq: stats: Convert to use sysfs_emit_at() API 2022-12-06 12:20:07 +01:00
cpufreq_userspace.c
davinci-cpufreq.c cpufreq: davinci: Fix clk use after free 2023-02-09 20:26:42 +01:00
e_powersaver.c
elanfreq.c
freq_table.c Updates for 6.4 2023-04-20 19:30:01 +02:00
gx-suspmod.c
highbank-cpufreq.c
ia64-acpi-cpufreq.c
imx-cpufreq-dt.c cpufreq: Use of_property_present() for testing DT property presence 2023-03-13 09:58:11 +05:30
imx6q-cpufreq.c cpufreq: imx6q: don't warn for disabling a non-existing frequency 2023-05-15 14:42:33 +05:30
intel_pstate.c cpufreq: intel_pstate: Fix scaling for hybrid-capable systems with disabled E-cores 2023-06-30 10:55:43 +02:00
kirkwood-cpufreq.c cpufreq: Adjust includes to remove of_device.h 2023-04-13 17:46:35 -05:00
longhaul.c
longhaul.h
longrun.c
loongson2_cpufreq.c
maple-cpufreq.c cpufreq: Adjust includes to remove of_device.h 2023-04-13 17:46:35 -05:00
mediatek-cpufreq-hw.c Cpufreq arm updates for 6.3 2023-02-14 15:25:07 +01:00
mediatek-cpufreq.c cpufreq: mediatek: correct voltages for MT7622 and MT7623 2023-06-19 09:53:28 +05:30
mvebu-cpufreq.c
omap-cpufreq.c cpufreq: Make cpufreq_unregister_driver() return void 2023-02-09 20:19:18 +01:00
p4-clockmod.c
pasemi-cpufreq.c
pcc-cpufreq.c cpufreq: ACPI: Prevent a warning when another frequency driver is loaded 2023-05-15 19:59:29 +02:00
pmac32-cpufreq.c Devicetree updates for v6.4, part 2: 2023-04-27 10:09:05 -07:00
pmac64-cpufreq.c cpufreq: Adjust includes to remove of_device.h 2023-04-13 17:46:35 -05:00
powernow-k6.c
powernow-k7.c
powernow-k7.h
powernow-k8.c
powernow-k8.h
powernv-cpufreq.c
ppc_cbe_cpufreq.c
ppc_cbe_cpufreq.h
ppc_cbe_cpufreq_pervasive.c
ppc_cbe_cpufreq_pmi.c
pxa2xx-cpufreq.c
pxa3xx-cpufreq.c
qcom-cpufreq-hw.c cpufreq: qcom-cpufreq-hw: Use dev_err_probe() when failing to get icc paths 2023-06-26 12:09:47 +05:30
qcom-cpufreq-nvmem.c cpufreq: qcom-nvmem: use helper to get SMEM SoC ID 2023-05-26 18:18:57 -07:00
qoriq-cpufreq.c
raspberrypi-cpufreq.c
s3c64xx-cpufreq.c
s5pv210-cpufreq.c
sa1110-cpufreq.c ARM: sa1100: remove unused board files 2023-01-12 10:53:12 +01:00
sc520_freq.c
scmi-cpufreq.c cpufreq: Use of_property_present() for testing DT property presence 2023-03-13 09:58:11 +05:30
scpi-cpufreq.c
sh-cpufreq.c
sparc-us2e-cpufreq.c cpufreq: sparc: Don't mark cpufreq callbacks with __init 2023-07-12 12:45:18 +02:00
sparc-us3-cpufreq.c cpufreq: sparc: Don't mark cpufreq callbacks with __init 2023-07-12 12:45:18 +02:00
spear-cpufreq.c cpufreq: Adjust includes to remove of_device.h 2023-04-13 17:46:35 -05:00
speedstep-centrino.c
speedstep-ich.c
speedstep-lib.c
speedstep-lib.h
speedstep-smi.c
sti-cpufreq.c
sun50i-cpufreq-nvmem.c cpufreq: sun50i: Add explicit include for cpu.h 2023-04-13 17:46:35 -05:00
tegra20-cpufreq.c Devicetree updates for v6.4, part 2: 2023-04-27 10:09:05 -07:00
tegra124-cpufreq.c Devicetree updates for v6.4, part 2: 2023-04-27 10:09:05 -07:00
tegra186-cpufreq.c cpufreq: tegra186: Use flexible array to simplify memory allocation 2022-12-01 14:49:50 +05:30
tegra194-cpufreq.c cpufreq: tegra194: Fix an error handling path in tegra194_cpufreq_probe() 2023-05-11 14:32:50 +05:30
ti-cpufreq.c cpufreq: ti-cpufreq: Add support for AM62A7 2023-05-29 10:33:59 +05:30
vexpress-spc-cpufreq.c