Skip to content

Commit a4031af

Browse files
chleroympe
authored andcommitted
powerpc/8xx: Fix clearing of bits 20-23 in ITLB miss
In ITLB miss handled the line supposed to clear bits 20-23 on the L2 ITLB entry is buggy and does indeed nothing, leading to undefined value which could allow execution when it shouldn't. Properly do the clearing with the relevant instruction. Fixes: 74fabca ("powerpc/8xx: don't use r12/SPRN_SPRG_SCRATCH2 in TLB Miss handlers") Cc: [email protected] # v5.0+ Signed-off-by: Christophe Leroy <[email protected]> Reviewed-by: Leonardo Bras <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/4f70c2778163affce8508a210f65d140e84524b4.1581272050.git.christophe.leroy@c-s.fr
1 parent 50a175d commit a4031af

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/powerpc/kernel/head_8xx.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ InstructionTLBMiss:
256256
* set. All other Linux PTE bits control the behavior
257257
* of the MMU.
258258
*/
259-
rlwimi r10, r10, 0, 0x0f00 /* Clear bits 20-23 */
259+
rlwinm r10, r10, 0, ~0x0f00 /* Clear bits 20-23 */
260260
rlwimi r10, r10, 4, 0x0400 /* Copy _PAGE_EXEC into bit 21 */
261261
ori r10, r10, RPN_PATTERN | 0x200 /* Set 22 and 24-27 */
262262
mtspr SPRN_MI_RPN, r10 /* Update TLB entry */

0 commit comments

Comments
 (0)