Patch "x86/boot/64: Strip percpu address space when setting up GDT descriptors" has been added to the 6.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    x86/boot/64: Strip percpu address space when setting up GDT descriptors

to the 6.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     x86-boot-64-strip-percpu-address-space-when-setting-.patch
and it can be found in the queue-6.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 74110a4b3c7ecb48d357f143262a38ab16bdf3c7
Author: Uros Bizjak <ubizjak@xxxxxxxxx>
Date:   Mon Aug 19 10:33:13 2024 +0200

    x86/boot/64: Strip percpu address space when setting up GDT descriptors
    
    [ Upstream commit b51207dc02ec3aeaa849e419f79055d7334845b6 ]
    
    init_per_cpu_var() returns a pointer in the percpu address space while
    rip_rel_ptr() expects a pointer in the generic address space.
    
    When strict address space checks are enabled, GCC's named address space
    checks fail:
    
      asm.h:124:63: error: passing argument 1 of 'rip_rel_ptr' from
                           pointer to non-enclosed address space
    
    Add a explicit cast to remove address space of the returned pointer.
    
    Fixes: 11e36b0f7c21 ("x86/boot/64: Load the final kernel GDT during early boot directly, remove startup_gdt[]")
    Signed-off-by: Uros Bizjak <ubizjak@xxxxxxxxx>
    Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
    Link: https://lore.kernel.org/all/20240819083334.148536-1-ubizjak@xxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c
index a817ed0724d1e..4b9d4557fc94a 100644
--- a/arch/x86/kernel/head64.c
+++ b/arch/x86/kernel/head64.c
@@ -559,10 +559,11 @@ void early_setup_idt(void)
  */
 void __head startup_64_setup_gdt_idt(void)
 {
+	struct desc_struct *gdt = (void *)(__force unsigned long)init_per_cpu_var(gdt_page.gdt);
 	void *handler = NULL;
 
 	struct desc_ptr startup_gdt_descr = {
-		.address = (unsigned long)&RIP_REL_REF(init_per_cpu_var(gdt_page.gdt)),
+		.address = (unsigned long)&RIP_REL_REF(*gdt),
 		.size    = GDT_SIZE - 1,
 	};
 




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux