Patch "RISC-V: Align the shadow stack" 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

    RISC-V: Align the shadow stack

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:
     risc-v-align-the-shadow-stack.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 7b3019b70ca80a48c4e1aaff58f70ab286cce4ea
Author: Palmer Dabbelt <palmer@xxxxxxxxxxxx>
Date:   Tue Nov 29 18:35:14 2022 -0800

    RISC-V: Align the shadow stack
    
    [ Upstream commit b003b3b77d65133a0011ae3b7b255347438c12f6 ]
    
    The standard RISC-V ABIs all require 16-byte stack alignment.  We're
    only calling that one function on the shadow stack so I doubt it'd
    result in a real issue, but might as well keep this lined up.
    
    Fixes: 31da94c25aea ("riscv: add VMAP_STACK overflow detection")
    Reviewed-by: Jisheng Zhang <jszhang@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20221130023515.20217-1-palmer@xxxxxxxxxxxx
    Signed-off-by: Palmer Dabbelt <palmer@xxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/riscv/kernel/traps.c b/arch/riscv/kernel/traps.c
index 7abd8e4c4df6..f77cb8e42bd2 100644
--- a/arch/riscv/kernel/traps.c
+++ b/arch/riscv/kernel/traps.c
@@ -214,7 +214,7 @@ static DEFINE_PER_CPU(unsigned long [OVERFLOW_STACK_SIZE/sizeof(long)],
  * shadow stack, handled_ kernel_ stack_ overflow(in kernel/entry.S) is used
  * to get per-cpu overflow stack(get_overflow_stack).
  */
-long shadow_stack[SHADOW_OVERFLOW_STACK_SIZE/sizeof(long)];
+long shadow_stack[SHADOW_OVERFLOW_STACK_SIZE/sizeof(long)] __aligned(16);
 asmlinkage unsigned long get_overflow_stack(void)
 {
 	return (unsigned long)this_cpu_ptr(overflow_stack) +



[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