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 <[email protected]>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217765
Link: https://lore.kernel.org/lkml/[email protected]/
Cc: All applicable <[email protected]>
Signed-off-by: Thomas Weißschuh <[email protected]>
Reviewed-by: Greg Kroah-Hartman <[email protected]>
Reviewed-by: Nathan Chancellor <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
2023-08-07 19:41:48 +02:00
..
2023-05-15 19:59:29 +02:00
2022-11-30 19:50:04 +01:00
2021-12-30 18:51:39 +01:00
2022-03-09 19:53:01 +01:00
2022-11-16 08:38:19 -07:00
2023-08-07 19:41:48 +02:00
2023-03-01 19:34:54 +01:00
2023-06-19 09:50:31 +05:30
2023-01-10 09:32:03 +05:30
2022-08-30 13:49:23 +05:30
2023-02-09 20:19:18 +01:00
2022-12-27 08:27:14 +05:30
2022-03-10 19:55:05 +01:00
2022-02-04 19:22:34 +01:00
2022-04-13 15:22:41 +02:00
2022-04-13 15:22:41 +02:00
2022-07-25 20:38:01 +02:00
2020-11-10 18:31:17 +01:00
2020-11-10 18:31:17 +01:00
2022-12-06 12:20:07 +01:00
2023-06-05 16:33:05 +05:30
2022-10-18 16:22:25 +05:30
2023-06-15 18:15:25 +02:00
2023-02-09 20:26:42 +01:00
2020-10-27 18:42:54 +01:00
2023-04-20 19:30:01 +02:00
2022-09-26 11:15:04 +05:30
2021-03-19 17:26:20 +01:00
2023-05-15 14:42:33 +05:30
2023-03-13 09:58:11 +05:30
2023-06-30 10:55:43 +02:00
2023-06-30 09:43:43 +02:00
2023-03-22 20:14:37 +01:00
2023-06-21 18:44:56 +02:00
2023-04-13 17:46:35 -05:00
2022-11-03 19:13:34 +01:00
2021-06-07 17:43:52 +02:00
2023-02-21 12:13:58 -08:00
2023-04-13 17:46:35 -05:00
2023-02-14 15:25:07 +01:00
2023-06-19 09:53:28 +05:30
2022-06-10 14:51:35 +02:00
2023-02-09 20:19:18 +01:00
2022-04-13 17:18:45 +02:00
2023-05-15 19:59:29 +02:00
2023-04-27 10:09:05 -07:00
2023-04-13 17:46:35 -05:00
2022-03-17 14:54:11 +01:00
2021-10-05 16:33:05 +02:00
2022-04-13 17:18:45 +02:00
2022-04-13 17:18:45 +02:00
2022-05-07 22:55:49 +02:00
2022-05-07 22:55:49 +02:00
2023-06-26 12:09:47 +05:30
2023-05-26 18:18:57 -07:00
2022-06-28 13:34:45 +05:30
2021-10-05 16:33:05 +02:00
2023-01-12 10:53:12 +01:00
2021-05-21 18:52:13 +02:00
2023-03-13 09:58:11 +05:30
2022-06-10 14:51:36 +02:00
2021-09-02 18:04:17 +02:00
2023-07-12 12:45:18 +02:00
2023-07-12 12:45:18 +02:00
2023-04-13 17:46:35 -05:00
2020-10-28 18:04:07 +01:00
2022-09-26 11:15:04 +05:30
2023-04-13 17:46:35 -05:00
2023-04-27 10:09:05 -07:00
2023-04-27 10:09:05 -07:00
2022-12-01 14:49:50 +05:30
2023-05-11 14:32:50 +05:30
2023-05-29 10:33:59 +05:30
2021-10-04 11:25:21 +05:30