Patch "arm64: make is_ttbrX_addr() noinstr-safe" has been added to the 5.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

    arm64: make is_ttbrX_addr() noinstr-safe

to the 5.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:
     arm64-make-is_ttbrx_addr-noinstr-safe.patch
and it can be found in the queue-5.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 54045e423b9a389b6b5b277cb346761fcc34cd20
Author: Mark Rutland <mark.rutland@xxxxxxx>
Date:   Mon Nov 14 14:40:42 2022 +0000

    arm64: make is_ttbrX_addr() noinstr-safe
    
    [ Upstream commit d8c1d798a2e5091128c391c6dadcc9be334af3f5 ]
    
    We use is_ttbr0_addr() in noinstr code, but as it's only marked as
    inline, it's theoretically possible for the compiler to place it
    out-of-line and instrument it, which would be problematic.
    
    Mark is_ttbr0_addr() as __always_inline such that that can safely be
    used from noinstr code. For consistency, do the same to is_ttbr1_addr().
    Note that while is_ttbr1_addr() calls arch_kasan_reset_tag(), this is a
    macro (and its callees are either macros or __always_inline), so there
    is not a risk of transient instrumentation.
    
    Signed-off-by: Mark Rutland <mark.rutland@xxxxxxx>
    Cc: Catalin Marinas <catalin.marinas@xxxxxxx>
    Cc: Will Deacon <will@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20221114144042.3001140-1-mark.rutland@xxxxxxx
    Signed-off-by: Will Deacon <will@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/arm64/include/asm/processor.h b/arch/arm64/include/asm/processor.h
index 7c546c3487c9..c628d8e3a403 100644
--- a/arch/arm64/include/asm/processor.h
+++ b/arch/arm64/include/asm/processor.h
@@ -230,13 +230,13 @@ static inline void compat_start_thread(struct pt_regs *regs, unsigned long pc,
 }
 #endif
 
-static inline bool is_ttbr0_addr(unsigned long addr)
+static __always_inline bool is_ttbr0_addr(unsigned long addr)
 {
 	/* entry assembly clears tags for TTBR0 addrs */
 	return addr < TASK_SIZE;
 }
 
-static inline bool is_ttbr1_addr(unsigned long addr)
+static __always_inline bool is_ttbr1_addr(unsigned long addr)
 {
 	/* TTBR1 addresses may have a tag if KASAN_SW_TAGS is in use */
 	return arch_kasan_reset_tag(addr) >= PAGE_OFFSET;



[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