Skip to contentSkip to conversation

arm64: Re-enable PAN on uaccess_enable

PATCH New Marc Zyngier 3 participants 4 messages Dec 12, 2016 arm64

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm64: Re-enable PAN on uaccess_enable

Commit 4b65a5db3627 ("arm64: Introduce uaccess_{disable,enable} functionality based on TTBR0_EL1") added conditional PAN enable/disable. Unfortunately, a typo prevents PAN from being re-enabled once it has been disabled.

Restore the PAN functionnality by adding the missing '!'.

Fixes b65a5db3627 ("arm64: Introduce uaccess_{disable,enable} functionality based on TTBR0_EL1")

---
Christoffer, any chance you could give this a go and let me know if that fixes your issues?

 arch/arm64/include/asm/uaccess.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/include/asm/uaccess.h +1 -1
index 6986f56..d26750c 100644
@@ -188,7 +188,7 @@ do {									\
 
 #define __uaccess_enable(alt)						\
 do {									\
-	if (uaccess_ttbr0_enable())					\
+	if (!uaccess_ttbr0_enable())					\
 		asm(ALTERNATIVE("nop", SET_PSTATE_PAN(0), alt,		\
 				CONFIG_ARM64_PAN));			\
 } while (0)
Signature · 1 line
2.1.4
#1 lore raw

PATCH 1/1 arm64: Re-enable PAN on uaccess_enable

Quoted 5 lines · Marc Zyngier

Commit 4b65a5db3627 ("arm64: Introduce uaccess_{disable,enable} functionality based on TTBR0_EL1") added conditional PAN enable/disable. Unfortunately, a typo prevents PAN from being re-enabled once it has been disabled.

Quoted 8 lines

Restore the PAN functionnality by adding the missing '!'.

Fixes b65a5db3627 ("arm64: Introduce uaccess_{disable,enable} functionality based on TTBR0_EL1")

---
Christoffer, any chance you could give this a go and let me know if that fixes your issues?

Yep, fixes the issue. Thanks!

-Christoffer

Quoted 20 lines
 arch/arm64/include/asm/uaccess.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/include/asm/uaccess.h +1 -1
index 6986f56..d26750c 100644
@@ -188,7 +188,7 @@ do {									\
 
 #define __uaccess_enable(alt)						\
 do {									\
-	if (uaccess_ttbr0_enable())					\
+	if (!uaccess_ttbr0_enable())					\
 		asm(ALTERNATIVE("nop", SET_PSTATE_PAN(0), alt,		\
 				CONFIG_ARM64_PAN));			\
 } while (0)
Signature · 1 line
2.1.4
maintainer
#2 lore raw

PATCH 1/1 arm64: Re-enable PAN on uaccess_enable

Quoted 8 lines · Christoffer Dall
Quoted 7 lines · Marc Zyngier

Commit 4b65a5db3627 ("arm64: Introduce uaccess_{disable,enable} functionality based on TTBR0_EL1") added conditional PAN enable/disable. Unfortunately, a typo prevents PAN from being re-enabled once it has been disabled.

Restore the PAN functionnality by adding the missing '!'.

Quoted 8 lines
Quoted 6 lines
Fixes b65a5db3627 ("arm64: Introduce uaccess_{disable,enable} functionality based on TTBR0_EL1")

---
Christoffer, any chance you could give this a go and let me know if that fixes your issues?

Yep, fixes the issue. Thanks!

Thanks for confirming. I merged this with a slightly updated commit log:

------8<-----------------
Commit 4b65a5db3627 ("arm64: Introduce uaccess_{disable,enable} functionality based on TTBR0_EL1") added conditional user access enable/disable. Unfortunately, a typo prevents the PAN bit from being cleared for user access functions.

Signature · 1 line
Catalin
#3 lore raw

PATCH 1/1 arm64: Re-enable PAN on uaccess_enable

Quoted 18 lines · Catalin Marinas
Quoted 8 lines · Christoffer Dall
Quoted 7 lines · Marc Zyngier

Commit 4b65a5db3627 ("arm64: Introduce uaccess_{disable,enable} functionality based on TTBR0_EL1") added conditional PAN enable/disable. Unfortunately, a typo prevents PAN from being re-enabled once it has been disabled.

Restore the PAN functionnality by adding the missing '!'.

Quoted 8 lines
Quoted 6 lines
Fixes b65a5db3627 ("arm64: Introduce uaccess_{disable,enable} functionality based on TTBR0_EL1")

---
Christoffer, any chance you could give this a go and let me know if that fixes your issues?

Yep, fixes the issue. Thanks!

Quoted 7 lines

Thanks for confirming. I merged this with a slightly updated commit log:

------8<-----------------
Commit 4b65a5db3627 ("arm64: Introduce uaccess_{disable,enable} functionality based on TTBR0_EL1") added conditional user access enable/disable. Unfortunately, a typo prevents the PAN bit from being cleared for user access functions.

That looks indeed much better. Thanks!

	M.
Signature · 1 line
Jazz is not dead. It just smells funny...