[PATCH openEuler-1.0-LTS 0/3] revert CVE-2023-54160 patchset
Xinyu Zheng (3): Revert "firmware: arm_sdei: Fix "firmware: arm_sdei: Fix sleep from invalid context BUG" KABI issue" Revert "firmware: arm_sdei: Fix the input parameter of cpuhp_remove_state()" Revert "firmware: arm_sdei: Fix sleep from invalid context BUG" drivers/firmware/arm_sdei.c | 37 +++++++++++++++++-------------------- include/linux/cpuhotplug.h | 1 - 2 files changed, 17 insertions(+), 21 deletions(-) -- 2.34.1
hulk inclusion category: bugfix bugzilla: https://atomgit.com/src-openeuler/kernel/issues/13285 -------------------------------- This reverts commit 982bc64e4c6e00e4a707f1a5d2d9394f8865eb5e. This patch is fix KABI issue for 982bc64e4c6e ("firmware: arm_sdei: Fix "firmware: arm_sdei: Fix sleep from invalid context BUG" KABI issue"). Since the parent patch should be reverted, this related patch also reverts. Fixes: 982bc64e4c6e ("firmware: arm_sdei: Fix "firmware: arm_sdei: Fix sleep from invalid context BUG" KABI issue") Signed-off-by: Xinyu Zheng <zhengxinyu6@huawei.com> --- include/linux/cpuhotplug.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/linux/cpuhotplug.h b/include/linux/cpuhotplug.h index 6017ef0dcfa6..3889d302ce8d 100644 --- a/include/linux/cpuhotplug.h +++ b/include/linux/cpuhotplug.h @@ -109,8 +109,6 @@ enum cpuhp_state { CPUHP_AP_PERF_X86_CSTATE_STARTING, CPUHP_AP_PERF_XTENSA_STARTING, CPUHP_AP_MIPS_OP_LOONGSON3_STARTING, - /* we should keep this state to promise KABI consistence */ - CPUHP_AP_ARM_SDEI_STARTING, CPUHP_AP_ARM_VFP_STARTING, CPUHP_AP_ARM64_DEBUG_MONITORS_STARTING, CPUHP_AP_PERF_ARM_HW_BREAKPOINT_STARTING, -- 2.34.1
hulk inclusion category: bugfix bugzilla: https://atomgit.com/src-openeuler/kernel/issues/13285 -------------------------------- This reverts commit 0a11a524036a39abecb986757e5008df61ab9533. This patch is a bugfix for 982bc64e4c6e ("firmware: arm_sdei: Fix "firmware: arm_sdei: Fix sleep from invalid context BUG" KABI issue"). Since the parent patch should be reverted, this related patch also reverts. Fixes: 0a11a524036a ("firmware: arm_sdei: Fix the input parameter of cpuhp_remove_state()") Signed-off-by: Xinyu Zheng <zhengxinyu6@huawei.com> --- drivers/firmware/arm_sdei.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/firmware/arm_sdei.c b/drivers/firmware/arm_sdei.c index 244756e93c99..8ce4f9e4c641 100644 --- a/drivers/firmware/arm_sdei.c +++ b/drivers/firmware/arm_sdei.c @@ -821,7 +821,7 @@ static int sdei_device_freeze(struct device *dev) int err; /* unregister private events */ - cpuhp_remove_state(sdei_hp_state); + cpuhp_remove_state(sdei_entry_point); err = sdei_unregister_shared(); if (err) -- 2.34.1
hulk inclusion category: bugfix bugzilla: https://atomgit.com/src-openeuler/kernel/issues/13285 -------------------------------- This reverts commit 5729aecaf50e0a617ed032bcf74b2e7a6ed17338. The above commit move sdei_cpuhp_up() before lockup_detector_online_cpu(), which may cause sdei_watchdog enable failed. The origin issue only occurs in preempt-rt, which is not enabled. Fixes: 5729aecaf50e ("firmware: arm_sdei: Fix sleep from invalid context BUG") Signed-off-by: Xinyu Zheng <zhengxinyu6@huawei.com> --- drivers/firmware/arm_sdei.c | 37 +++++++++++++++++-------------------- include/linux/cpuhotplug.h | 1 + 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/drivers/firmware/arm_sdei.c b/drivers/firmware/arm_sdei.c index 8ce4f9e4c641..2b5f277819fd 100644 --- a/drivers/firmware/arm_sdei.c +++ b/drivers/firmware/arm_sdei.c @@ -43,8 +43,6 @@ static asmlinkage void (*sdei_firmware_call)(unsigned long function_id, /* entry point from firmware to arch asm code */ static unsigned long sdei_entry_point; -static int sdei_hp_state; - struct sdei_event { /* These three are protected by the sdei_list_lock */ struct list_head list; @@ -328,6 +326,8 @@ int sdei_mask_local_cpu(void) { int err; + WARN_ON_ONCE(preemptible()); + err = invoke_sdei_fn(SDEI_1_0_FN_SDEI_PE_MASK, 0, 0, 0, 0, 0, NULL); if (err && err != -EIO) { pr_warn_once("failed to mask CPU[%u]: %d\n", @@ -340,7 +340,6 @@ int sdei_mask_local_cpu(void) static void _ipi_mask_cpu(void *ignored) { - WARN_ON_ONCE(preemptible()); sdei_mask_local_cpu(); } @@ -348,6 +347,8 @@ int sdei_unmask_local_cpu(void) { int err; + WARN_ON_ONCE(preemptible()); + err = invoke_sdei_fn(SDEI_1_0_FN_SDEI_PE_UNMASK, 0, 0, 0, 0, 0, NULL); if (err && err != -EIO) { pr_warn_once("failed to unmask CPU[%u]: %d\n", @@ -360,7 +361,6 @@ int sdei_unmask_local_cpu(void) static void _ipi_unmask_cpu(void *ignored) { - WARN_ON_ONCE(preemptible()); sdei_unmask_local_cpu(); } @@ -368,8 +368,6 @@ static void _ipi_private_reset(void *ignored) { int err; - WARN_ON_ONCE(preemptible()); - err = invoke_sdei_fn(SDEI_1_0_FN_SDEI_PRIVATE_RESET, 0, 0, 0, 0, 0, NULL); if (err && err != -EIO) @@ -416,6 +414,8 @@ static void _local_event_enable(void *data) int err; struct sdei_crosscall_args *arg = data; + WARN_ON_ONCE(preemptible()); + err = sdei_api_event_enable(arg->event->event_num); sdei_cross_call_return(arg, err); @@ -501,6 +501,8 @@ static void _local_event_unregister(void *data) int err; struct sdei_crosscall_args *arg = data; + WARN_ON_ONCE(preemptible()); + err = sdei_api_event_unregister(arg->event->event_num); sdei_cross_call_return(arg, err); @@ -589,6 +591,8 @@ static void _local_event_register(void *data) struct sdei_registered_event *reg; struct sdei_crosscall_args *arg = data; + WARN_ON(preemptible()); + reg = per_cpu_ptr(arg->event->private_registered, smp_processor_id()); err = sdei_api_event_register(arg->event->event_num, sdei_entry_point, reg, 0, 0); @@ -771,8 +775,6 @@ static int sdei_pm_notifier(struct notifier_block *nb, unsigned long action, { int rv; - WARN_ON_ONCE(preemptible()); - switch (action) { case CPU_PM_ENTER: rv = sdei_mask_local_cpu(); @@ -821,7 +823,7 @@ static int sdei_device_freeze(struct device *dev) int err; /* unregister private events */ - cpuhp_remove_state(sdei_entry_point); + cpuhp_remove_state(CPUHP_AP_ARM_SDEI_STARTING); err = sdei_unregister_shared(); if (err) @@ -842,15 +844,12 @@ static int sdei_device_thaw(struct device *dev) return err; } - err = cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "SDEI", + err = cpuhp_setup_state(CPUHP_AP_ARM_SDEI_STARTING, "SDEI", &sdei_cpuhp_up, &sdei_cpuhp_down); - if (err < 0) { + if (err) pr_warn("Failed to re-register CPU hotplug notifier...\n"); - return err; - } - sdei_hp_state = err; - return 0; + return err; } static int sdei_device_restore(struct device *dev) @@ -882,7 +881,7 @@ static int sdei_reboot_notifier(struct notifier_block *nb, unsigned long action, * We are going to reset the interface, after this there is no point * doing work when we take CPUs offline. */ - cpuhp_remove_state(sdei_hp_state); + cpuhp_remove_state(CPUHP_AP_ARM_SDEI_STARTING); sdei_platform_reset(); @@ -997,15 +996,13 @@ static int sdei_probe(struct platform_device *pdev) goto remove_cpupm; } - err = cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "SDEI", + err = cpuhp_setup_state(CPUHP_AP_ARM_SDEI_STARTING, "SDEI", &sdei_cpuhp_up, &sdei_cpuhp_down); - if (err < 0) { + if (err) { pr_warn("Failed to register CPU hotplug notifier...\n"); goto remove_reboot; } - sdei_hp_state = err; - return 0; remove_reboot: diff --git a/include/linux/cpuhotplug.h b/include/linux/cpuhotplug.h index 3889d302ce8d..d67c0035165c 100644 --- a/include/linux/cpuhotplug.h +++ b/include/linux/cpuhotplug.h @@ -109,6 +109,7 @@ enum cpuhp_state { CPUHP_AP_PERF_X86_CSTATE_STARTING, CPUHP_AP_PERF_XTENSA_STARTING, CPUHP_AP_MIPS_OP_LOONGSON3_STARTING, + CPUHP_AP_ARM_SDEI_STARTING, CPUHP_AP_ARM_VFP_STARTING, CPUHP_AP_ARM64_DEBUG_MONITORS_STARTING, CPUHP_AP_PERF_ARM_HW_BREAKPOINT_STARTING, -- 2.34.1
反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://atomgit.com/openeuler/kernel/merge_requests/19947 邮件列表地址:https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/IPS... FeedBack: The patch(es) which you have sent to kernel@openeuler.org mailing list has been converted to a pull request successfully! Pull request link: https://atomgit.com/openeuler/kernel/merge_requests/19947 Mailing list address: https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/IPS...
participants (2)
-
patchwork bot -
Xinyu Zheng