WSL2-Linux-Kernel/drivers/cpuidle
Neal Liu efe9711214 cpuidle: change enter_s2idle() prototype
Control Flow Integrity(CFI) is a security mechanism that disallows
changes to the original control flow graph of a compiled binary,
making it significantly harder to perform such attacks.

init_state_node() assign same function callback to different
function pointer declarations.

static int init_state_node(struct cpuidle_state *idle_state,
                           const struct of_device_id *matches,
                           struct device_node *state_node) { ...
        idle_state->enter = match_id->data; ...
        idle_state->enter_s2idle = match_id->data; }

Function declarations:

struct cpuidle_state { ...
        int (*enter) (struct cpuidle_device *dev,
                      struct cpuidle_driver *drv,
                      int index);

        void (*enter_s2idle) (struct cpuidle_device *dev,
                              struct cpuidle_driver *drv,
                              int index); };

In this case, either enter() or enter_s2idle() would cause CFI check
failed since they use same callee.

Align function prototype of enter() since it needs return value for
some use cases. The return value of enter_s2idle() is no
need currently.

Signed-off-by: Neal Liu <neal.liu@mediatek.com>
Reviewed-by: Sami Tolvanen <samitolvanen@google.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2020-07-29 18:38:30 +02:00
..
governors
Kconfig
Kconfig.arm cpuidle: psci: Split into two separate build objects 2020-07-29 18:38:30 +02:00
Kconfig.mips
Kconfig.powerpc
Makefile cpuidle: psci: Split into two separate build objects 2020-07-29 18:38:30 +02:00
coupled.c
cpuidle-arm.c thermal: cpuidle: Register cpuidle cooling device 2020-05-19 12:58:07 +02:00
cpuidle-at91.c
cpuidle-big_little.c
cpuidle-calxeda.c
cpuidle-clps711x.c
cpuidle-cps.c
cpuidle-exynos.c
cpuidle-haltpoll.c
cpuidle-kirkwood.c
cpuidle-mvebu-v7.c
cpuidle-powernv.c
cpuidle-psci-domain.c cpuidle: psci: Prevent domain idlestates until consumers are ready 2020-07-29 18:38:30 +02:00
cpuidle-psci.c cpuidle: psci: Fix error path via converting to a platform driver 2020-07-29 18:38:30 +02:00
cpuidle-psci.h cpuidle: psci: Fix error path via converting to a platform driver 2020-07-29 18:38:30 +02:00
cpuidle-pseries.c powerpc/idle: Store PURR snapshot in a per-cpu global variable 2020-04-30 12:35:26 +10:00
cpuidle-qcom-spm.c cpuidle: Convert Qualcomm SPM driver to a generic CPUidle driver 2020-05-26 10:46:01 +02:00
cpuidle-tegra.c cpuidle: change enter_s2idle() prototype 2020-07-29 18:38:30 +02:00
cpuidle-ux500.c
cpuidle-zynq.c
cpuidle.c cpuidle: Rearrange s2idle-specific idle state entry code 2020-06-25 13:52:53 +02:00
cpuidle.h
driver.c
dt_idle_states.c
dt_idle_states.h
governor.c
poll_state.c
sysfs.c cpuidle: Fix three reference count leaks 2020-05-29 18:07:18 +02:00