From: Greg Kroah-Hartman Date: Tue, 10 Dec 2024 10:33:09 +0000 (+0100) Subject: drop x86-kexec-restore-gdt-on-return-from-preserve_context-kexec.patch X-Git-Tag: v6.6.65~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ad33191fe7144521906cf95aac69653f837778e8;p=thirdparty%2Fkernel%2Fstable-queue.git drop x86-kexec-restore-gdt-on-return-from-preserve_context-kexec.patch broke the build --- diff --git a/queue-5.10/series b/queue-5.10/series index 4700afd88cf..1fb7080c557 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -371,7 +371,6 @@ scsi-qla2xxx-fix-use-after-free-on-unload.patch scsi-qla2xxx-remove-check-req_sg_cnt-should-be-equal-to-rsp_sg_cnt.patch nilfs2-fix-potential-out-of-bounds-memory-access-in-nilfs_find_entry.patch bcache-revert-replacing-is_err_or_null-with-is_err-again.patch -x86-kexec-restore-gdt-on-return-from-preserve_context-kexec.patch bpf-fix-oob-devmap-writes-when-deleting-elements.patch dma-buf-fix-dma_fence_array_signaled-v4.patch regmap-detach-regmap-from-dev-on-regmap_exit.patch diff --git a/queue-5.10/x86-kexec-restore-gdt-on-return-from-preserve_context-kexec.patch b/queue-5.10/x86-kexec-restore-gdt-on-return-from-preserve_context-kexec.patch deleted file mode 100644 index 34f1e5ef08e..00000000000 --- a/queue-5.10/x86-kexec-restore-gdt-on-return-from-preserve_context-kexec.patch +++ /dev/null @@ -1,82 +0,0 @@ -From 07fa619f2a40c221ea27747a3323cabc59ab25eb Mon Sep 17 00:00:00 2001 -From: David Woodhouse -Date: Thu, 5 Dec 2024 15:05:07 +0000 -Subject: x86/kexec: Restore GDT on return from ::preserve_context kexec - -From: David Woodhouse - -commit 07fa619f2a40c221ea27747a3323cabc59ab25eb upstream. - -The restore_processor_state() function explicitly states that "the asm code -that gets us here will have restored a usable GDT". That wasn't true in the -case of returning from a ::preserve_context kexec. Make it so. - -Without this, the kernel was depending on the called function to reload a -GDT which is appropriate for the kernel before returning. - -Test program: - - #include - #include - #include - #include - #include - #include - #include - #include - - int main (void) - { - struct kexec_segment segment = {}; - unsigned char purgatory[] = { - 0x66, 0xba, 0xf8, 0x03, // mov $0x3f8, %dx - 0xb0, 0x42, // mov $0x42, %al - 0xee, // outb %al, (%dx) - 0xc3, // ret - }; - int ret; - - segment.buf = &purgatory; - segment.bufsz = sizeof(purgatory); - segment.mem = (void *)0x400000; - segment.memsz = 0x1000; - ret = syscall(__NR_kexec_load, 0x400000, 1, &segment, KEXEC_PRESERVE_CONTEXT); - if (ret) { - perror("kexec_load"); - exit(1); - } - - ret = syscall(__NR_reboot, LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, LINUX_REBOOT_CMD_KEXEC); - if (ret) { - perror("kexec reboot"); - exit(1); - } - printf("Success\n"); - return 0; - } - -Signed-off-by: David Woodhouse -Signed-off-by: Ingo Molnar -Cc: stable@vger.kernel.org -Link: https://lore.kernel.org/r/20241205153343.3275139-2-dwmw2@infradead.org -Signed-off-by: Greg Kroah-Hartman ---- - arch/x86/kernel/relocate_kernel_64.S | 7 +++++++ - 1 file changed, 7 insertions(+) - ---- a/arch/x86/kernel/relocate_kernel_64.S -+++ b/arch/x86/kernel/relocate_kernel_64.S -@@ -229,6 +229,13 @@ SYM_CODE_START_LOCAL_NOALIGN(virtual_map - movq CR0(%r8), %r8 - movq %rax, %cr3 - movq %r8, %cr0 -+ -+#ifdef CONFIG_KEXEC_JUMP -+ /* Saved in save_processor_state. */ -+ movq $saved_context, %rax -+ lgdt saved_context_gdt_desc(%rax) -+#endif -+ - movq %rbp, %rax - - popf diff --git a/queue-5.15/series b/queue-5.15/series index 956c6f4753a..6fcc4e1eca3 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -460,7 +460,6 @@ scsi-qla2xxx-remove-check-req_sg_cnt-should-be-equal-to-rsp_sg_cnt.patch scsi-ufs-core-sysfs-prevent-div-by-zero.patch nilfs2-fix-potential-out-of-bounds-memory-access-in-nilfs_find_entry.patch bcache-revert-replacing-is_err_or_null-with-is_err-again.patch -x86-kexec-restore-gdt-on-return-from-preserve_context-kexec.patch bpf-fix-oob-devmap-writes-when-deleting-elements.patch dma-buf-fix-dma_fence_array_signaled-v4.patch xsk-fix-oob-map-writes-when-deleting-elements.patch diff --git a/queue-5.15/x86-kexec-restore-gdt-on-return-from-preserve_context-kexec.patch b/queue-5.15/x86-kexec-restore-gdt-on-return-from-preserve_context-kexec.patch deleted file mode 100644 index 34f1e5ef08e..00000000000 --- a/queue-5.15/x86-kexec-restore-gdt-on-return-from-preserve_context-kexec.patch +++ /dev/null @@ -1,82 +0,0 @@ -From 07fa619f2a40c221ea27747a3323cabc59ab25eb Mon Sep 17 00:00:00 2001 -From: David Woodhouse -Date: Thu, 5 Dec 2024 15:05:07 +0000 -Subject: x86/kexec: Restore GDT on return from ::preserve_context kexec - -From: David Woodhouse - -commit 07fa619f2a40c221ea27747a3323cabc59ab25eb upstream. - -The restore_processor_state() function explicitly states that "the asm code -that gets us here will have restored a usable GDT". That wasn't true in the -case of returning from a ::preserve_context kexec. Make it so. - -Without this, the kernel was depending on the called function to reload a -GDT which is appropriate for the kernel before returning. - -Test program: - - #include - #include - #include - #include - #include - #include - #include - #include - - int main (void) - { - struct kexec_segment segment = {}; - unsigned char purgatory[] = { - 0x66, 0xba, 0xf8, 0x03, // mov $0x3f8, %dx - 0xb0, 0x42, // mov $0x42, %al - 0xee, // outb %al, (%dx) - 0xc3, // ret - }; - int ret; - - segment.buf = &purgatory; - segment.bufsz = sizeof(purgatory); - segment.mem = (void *)0x400000; - segment.memsz = 0x1000; - ret = syscall(__NR_kexec_load, 0x400000, 1, &segment, KEXEC_PRESERVE_CONTEXT); - if (ret) { - perror("kexec_load"); - exit(1); - } - - ret = syscall(__NR_reboot, LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, LINUX_REBOOT_CMD_KEXEC); - if (ret) { - perror("kexec reboot"); - exit(1); - } - printf("Success\n"); - return 0; - } - -Signed-off-by: David Woodhouse -Signed-off-by: Ingo Molnar -Cc: stable@vger.kernel.org -Link: https://lore.kernel.org/r/20241205153343.3275139-2-dwmw2@infradead.org -Signed-off-by: Greg Kroah-Hartman ---- - arch/x86/kernel/relocate_kernel_64.S | 7 +++++++ - 1 file changed, 7 insertions(+) - ---- a/arch/x86/kernel/relocate_kernel_64.S -+++ b/arch/x86/kernel/relocate_kernel_64.S -@@ -229,6 +229,13 @@ SYM_CODE_START_LOCAL_NOALIGN(virtual_map - movq CR0(%r8), %r8 - movq %rax, %cr3 - movq %r8, %cr0 -+ -+#ifdef CONFIG_KEXEC_JUMP -+ /* Saved in save_processor_state. */ -+ movq $saved_context, %rax -+ lgdt saved_context_gdt_desc(%rax) -+#endif -+ - movq %rbp, %rax - - popf diff --git a/queue-5.4/series b/queue-5.4/series index 5ddf72011ba..d6bb66fb0a1 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -260,7 +260,6 @@ scsi-qla2xxx-supported-speed-displayed-incorrectly-for-vports.patch scsi-qla2xxx-remove-check-req_sg_cnt-should-be-equal-to-rsp_sg_cnt.patch nilfs2-fix-potential-out-of-bounds-memory-access-in-nilfs_find_entry.patch bcache-revert-replacing-is_err_or_null-with-is_err-again.patch -x86-kexec-restore-gdt-on-return-from-preserve_context-kexec.patch dma-buf-fix-dma_fence_array_signaled-v4.patch regmap-detach-regmap-from-dev-on-regmap_exit.patch mmc-core-further-prevent-card-detect-during-shutdown.patch diff --git a/queue-5.4/x86-kexec-restore-gdt-on-return-from-preserve_context-kexec.patch b/queue-5.4/x86-kexec-restore-gdt-on-return-from-preserve_context-kexec.patch deleted file mode 100644 index ea55ef62d4a..00000000000 --- a/queue-5.4/x86-kexec-restore-gdt-on-return-from-preserve_context-kexec.patch +++ /dev/null @@ -1,82 +0,0 @@ -From 07fa619f2a40c221ea27747a3323cabc59ab25eb Mon Sep 17 00:00:00 2001 -From: David Woodhouse -Date: Thu, 5 Dec 2024 15:05:07 +0000 -Subject: x86/kexec: Restore GDT on return from ::preserve_context kexec - -From: David Woodhouse - -commit 07fa619f2a40c221ea27747a3323cabc59ab25eb upstream. - -The restore_processor_state() function explicitly states that "the asm code -that gets us here will have restored a usable GDT". That wasn't true in the -case of returning from a ::preserve_context kexec. Make it so. - -Without this, the kernel was depending on the called function to reload a -GDT which is appropriate for the kernel before returning. - -Test program: - - #include - #include - #include - #include - #include - #include - #include - #include - - int main (void) - { - struct kexec_segment segment = {}; - unsigned char purgatory[] = { - 0x66, 0xba, 0xf8, 0x03, // mov $0x3f8, %dx - 0xb0, 0x42, // mov $0x42, %al - 0xee, // outb %al, (%dx) - 0xc3, // ret - }; - int ret; - - segment.buf = &purgatory; - segment.bufsz = sizeof(purgatory); - segment.mem = (void *)0x400000; - segment.memsz = 0x1000; - ret = syscall(__NR_kexec_load, 0x400000, 1, &segment, KEXEC_PRESERVE_CONTEXT); - if (ret) { - perror("kexec_load"); - exit(1); - } - - ret = syscall(__NR_reboot, LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, LINUX_REBOOT_CMD_KEXEC); - if (ret) { - perror("kexec reboot"); - exit(1); - } - printf("Success\n"); - return 0; - } - -Signed-off-by: David Woodhouse -Signed-off-by: Ingo Molnar -Cc: stable@vger.kernel.org -Link: https://lore.kernel.org/r/20241205153343.3275139-2-dwmw2@infradead.org -Signed-off-by: Greg Kroah-Hartman ---- - arch/x86/kernel/relocate_kernel_64.S | 7 +++++++ - 1 file changed, 7 insertions(+) - ---- a/arch/x86/kernel/relocate_kernel_64.S -+++ b/arch/x86/kernel/relocate_kernel_64.S -@@ -218,6 +218,13 @@ virtual_mapped: - movq CR0(%r8), %r8 - movq %rax, %cr3 - movq %r8, %cr0 -+ -+#ifdef CONFIG_KEXEC_JUMP -+ /* Saved in save_processor_state. */ -+ movq $saved_context, %rax -+ lgdt saved_context_gdt_desc(%rax) -+#endif -+ - movq %rbp, %rax - - popf diff --git a/queue-6.1/series b/queue-6.1/series index a8a2092e2ee..250e05c265b 100644 --- a/queue-6.1/series +++ b/queue-6.1/series @@ -641,7 +641,6 @@ drm-dp_mst-verify-request-type-in-the-corresponding-down-message-reply.patch drm-dp_mst-fix-resetting-msg-rx-state-after-topology-removal.patch drm-amdgpu-hdp5.2-do-a-posting-read-when-flushing-hdp.patch modpost-add-.irqentry.text-to-other_sections.patch -x86-kexec-restore-gdt-on-return-from-preserve_context-kexec.patch bpf-fix-oob-devmap-writes-when-deleting-elements.patch dma-buf-fix-dma_fence_array_signaled-v4.patch dma-fence-fix-reference-leak-on-fence-merge-failure-path.patch diff --git a/queue-6.1/x86-kexec-restore-gdt-on-return-from-preserve_context-kexec.patch b/queue-6.1/x86-kexec-restore-gdt-on-return-from-preserve_context-kexec.patch deleted file mode 100644 index 238066c20c4..00000000000 --- a/queue-6.1/x86-kexec-restore-gdt-on-return-from-preserve_context-kexec.patch +++ /dev/null @@ -1,82 +0,0 @@ -From 07fa619f2a40c221ea27747a3323cabc59ab25eb Mon Sep 17 00:00:00 2001 -From: David Woodhouse -Date: Thu, 5 Dec 2024 15:05:07 +0000 -Subject: x86/kexec: Restore GDT on return from ::preserve_context kexec - -From: David Woodhouse - -commit 07fa619f2a40c221ea27747a3323cabc59ab25eb upstream. - -The restore_processor_state() function explicitly states that "the asm code -that gets us here will have restored a usable GDT". That wasn't true in the -case of returning from a ::preserve_context kexec. Make it so. - -Without this, the kernel was depending on the called function to reload a -GDT which is appropriate for the kernel before returning. - -Test program: - - #include - #include - #include - #include - #include - #include - #include - #include - - int main (void) - { - struct kexec_segment segment = {}; - unsigned char purgatory[] = { - 0x66, 0xba, 0xf8, 0x03, // mov $0x3f8, %dx - 0xb0, 0x42, // mov $0x42, %al - 0xee, // outb %al, (%dx) - 0xc3, // ret - }; - int ret; - - segment.buf = &purgatory; - segment.bufsz = sizeof(purgatory); - segment.mem = (void *)0x400000; - segment.memsz = 0x1000; - ret = syscall(__NR_kexec_load, 0x400000, 1, &segment, KEXEC_PRESERVE_CONTEXT); - if (ret) { - perror("kexec_load"); - exit(1); - } - - ret = syscall(__NR_reboot, LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, LINUX_REBOOT_CMD_KEXEC); - if (ret) { - perror("kexec reboot"); - exit(1); - } - printf("Success\n"); - return 0; - } - -Signed-off-by: David Woodhouse -Signed-off-by: Ingo Molnar -Cc: stable@vger.kernel.org -Link: https://lore.kernel.org/r/20241205153343.3275139-2-dwmw2@infradead.org -Signed-off-by: Greg Kroah-Hartman ---- - arch/x86/kernel/relocate_kernel_64.S | 7 +++++++ - 1 file changed, 7 insertions(+) - ---- a/arch/x86/kernel/relocate_kernel_64.S -+++ b/arch/x86/kernel/relocate_kernel_64.S -@@ -239,6 +239,13 @@ SYM_CODE_START_LOCAL_NOALIGN(virtual_map - movq CR0(%r8), %r8 - movq %rax, %cr3 - movq %r8, %cr0 -+ -+#ifdef CONFIG_KEXEC_JUMP -+ /* Saved in save_processor_state. */ -+ movq $saved_context, %rax -+ lgdt saved_context_gdt_desc(%rax) -+#endif -+ - movq %rbp, %rax - - popf