From ecaed009a9743ac085227b3740ea80f5ffc5063d Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Sat, 4 May 2019 19:40:30 +0000 Subject: arm64: Properly restore PAN when done with userspace access in casueword. Approved by: andrew Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/arm64/arm64/support.S | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/arm64/arm64/support.S b/sys/arm64/arm64/support.S index 4b4d34469126..f936cab4e2cd 100644 --- a/sys/arm64/arm64/support.S +++ b/sys/arm64/arm64/support.S @@ -64,8 +64,8 @@ ENTRY(casueword32) b.ne 2f /* Not equal, exit */ stxr w5, w3, [x0] /* Store the new data */ cbnz w5, 1b /* Retry on failure */ - EXIT_USER_ACCESS(w6) -2: SET_FAULT_HANDLER(xzr, x5) /* Reset the fault handler */ +2: EXIT_USER_ACCESS(w6) + SET_FAULT_HANDLER(xzr, x5) /* Reset the fault handler */ str w4, [x2] /* Store the read data */ mov x0, #0 /* Success */ ret /* Return */ @@ -86,8 +86,8 @@ ENTRY(casueword) b.ne 2f /* Not equal, exit */ stxr w5, x3, [x0] /* Store the new data */ cbnz w5, 1b /* Retry on failure */ - EXIT_USER_ACCESS(w6) -2: SET_FAULT_HANDLER(xzr, x5) /* Reset the fault handler */ +2: EXIT_USER_ACCESS(w6) + SET_FAULT_HANDLER(xzr, x5) /* Reset the fault handler */ str x4, [x2] /* Store the read data */ mov x0, #0 /* Success */ ret /* Return */ -- cgit v1.2.3