Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm

Pull ARM fix from Russell King:
"One further ARM fix for 6.1 from Wang Kefeng, fixing up the handling
for kfence faults"

* tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm:
ARM: 9278/1: kfence: only handle translation faults

+22 -5
+16 -2
arch/arm/mm/fault.c
··· 105 105 return (fsr & FSR_WRITE) && !(fsr & FSR_CM); 106 106 } 107 107 108 + static inline bool is_translation_fault(unsigned int fsr) 109 + { 110 + int fs = fsr_fs(fsr); 111 + #ifdef CONFIG_ARM_LPAE 112 + if ((fs & FS_MMU_NOLL_MASK) == FS_TRANS_NOLL) 113 + return true; 114 + #else 115 + if (fs == FS_L1_TRANS || fs == FS_L2_TRANS) 116 + return true; 117 + #endif 118 + return false; 119 + } 120 + 108 121 static void die_kernel_fault(const char *msg, struct mm_struct *mm, 109 122 unsigned long addr, unsigned int fsr, 110 123 struct pt_regs *regs) ··· 153 140 if (addr < PAGE_SIZE) { 154 141 msg = "NULL pointer dereference"; 155 142 } else { 156 - if (kfence_handle_page_fault(addr, is_write_fault(fsr), regs)) 143 + if (is_translation_fault(fsr) && 144 + kfence_handle_page_fault(addr, is_write_fault(fsr), regs)) 157 145 return; 158 146 159 147 msg = "paging request"; ··· 222 208 { 223 209 int fs = fsr_fs(fsr); 224 210 #ifdef CONFIG_ARM_LPAE 225 - if ((fs & FS_PERM_NOLL_MASK) == FS_PERM_NOLL) 211 + if ((fs & FS_MMU_NOLL_MASK) == FS_PERM_NOLL) 226 212 return true; 227 213 #else 228 214 if (fs == FS_L1_PERM || fs == FS_L2_PERM)
+6 -3
arch/arm/mm/fault.h
··· 14 14 15 15 #ifdef CONFIG_ARM_LPAE 16 16 #define FSR_FS_AEA 17 17 + #define FS_TRANS_NOLL 0x4 17 18 #define FS_PERM_NOLL 0xC 18 - #define FS_PERM_NOLL_MASK 0x3C 19 + #define FS_MMU_NOLL_MASK 0x3C 19 20 20 21 static inline int fsr_fs(unsigned int fsr) 21 22 { ··· 24 23 } 25 24 #else 26 25 #define FSR_FS_AEA 22 27 - #define FS_L1_PERM 0xD 28 - #define FS_L2_PERM 0xF 26 + #define FS_L1_TRANS 0x5 27 + #define FS_L2_TRANS 0x7 28 + #define FS_L1_PERM 0xD 29 + #define FS_L2_PERM 0xF 29 30 30 31 static inline int fsr_fs(unsigned int fsr) 31 32 {