Patch "riscv: avoid Imbalance in RAS" has been added to the 6.6-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

    riscv: avoid Imbalance in RAS

to the 6.6-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:
     riscv-avoid-imbalance-in-ras.patch
and it can be found in the queue-6.6 subdirectory.

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



commit fd5f564b7e141c987bed00ddc3c7459fe8aa92f3
Author: Jisheng Zhang <jszhang@xxxxxxxxxx>
Date:   Sun Jul 21 01:06:59 2024 +0800

    riscv: avoid Imbalance in RAS
    
    [ Upstream commit 8f1534e7440382d118c3d655d3a6014128b2086d ]
    
    Inspired by[1], modify the code to remove the code of modifying ra to
    avoid imbalance RAS (return address stack) which may lead to incorret
    predictions on return.
    
    Link: https://lore.kernel.org/linux-riscv/20240607061335.2197383-1-cyrilbur@xxxxxxxxxxxxxxx/ [1]
    Signed-off-by: Jisheng Zhang <jszhang@xxxxxxxxxx>
    Reviewed-by: Cyril Bur <cyrilbur@xxxxxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20240720170659.1522-1-jszhang@xxxxxxxxxx
    Signed-off-by: Palmer Dabbelt <palmer@xxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/riscv/kernel/entry.S b/arch/riscv/kernel/entry.S
index ed7baf2cf7e87..1f90fee24a8ba 100644
--- a/arch/riscv/kernel/entry.S
+++ b/arch/riscv/kernel/entry.S
@@ -219,8 +219,8 @@ SYM_CODE_START(ret_from_fork)
 	jalr s0
 1:
 	move a0, sp /* pt_regs */
-	la ra, ret_from_exception
-	tail syscall_exit_to_user_mode
+	call syscall_exit_to_user_mode
+	j ret_from_exception
 SYM_CODE_END(ret_from_fork)
 
 /*




[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