Patch "x86/boot: Fix incorrect startup_gdt_descr.size" has been added to the 6.1-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: Fix incorrect startup_gdt_descr.size

to the 6.1-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-fix-incorrect-startup_gdt_descr.size.patch
and it can be found in the queue-6.1 subdirectory.

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



commit 75f1960eaba4655df7fa0966e4440038860efda3
Author: Yuntao Wang <ytcoode@xxxxxxxxx>
Date:   Mon Aug 7 16:45:47 2023 +0800

    x86/boot: Fix incorrect startup_gdt_descr.size
    
    [ Upstream commit 001470fed5959d01faecbd57fcf2f60294da0de1 ]
    
    Since the size value is added to the base address to yield the last valid
    byte address of the GDT, the current size value of startup_gdt_descr is
    incorrect (too large by one), fix it.
    
    [ mingo: This probably never mattered, because startup_gdt[] is only used
             in a very controlled fashion - but make it consistent nevertheless. ]
    
    Fixes: 866b556efa12 ("x86/head/64: Install startup GDT")
    Signed-off-by: Yuntao Wang <ytcoode@xxxxxxxxx>
    Signed-off-by: Ingo Molnar <mingo@xxxxxxxxxx>
    Cc: "H. Peter Anvin" <hpa@xxxxxxxxx>
    Link: https://lore.kernel.org/r/20230807084547.217390-1-ytcoode@xxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c
index 6a3cfaf6b72ad..84adf12a76d3c 100644
--- a/arch/x86/kernel/head64.c
+++ b/arch/x86/kernel/head64.c
@@ -80,7 +80,7 @@ static struct desc_struct startup_gdt[GDT_ENTRIES] = {
  * while the kernel still uses a direct mapping.
  */
 static struct desc_ptr startup_gdt_descr = {
-	.size = sizeof(startup_gdt),
+	.size = sizeof(startup_gdt)-1,
 	.address = 0,
 };
 



[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