arm64: Re-enable PAN on uaccess_enable
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 '!'.
---
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
@@ -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
PATCH 1/1 arm64: Re-enable PAN on uaccess_enable
Quoted 5 lines · Marc Zyngier
Commit
4b65a5db3627("arm64: Introduce uaccess_{disable,enable} functionality based onTTBR0_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")Reported-by Christoffer Dall <[email protected]>Signed-off-by Marc Zyngier <[email protected]>---
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@@ -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
Catalin Marinas
maintainerPATCH 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 onTTBR0_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")Reported-by Christoffer Dall <[email protected]>Signed-off-by Marc Zyngier <[email protected]>---
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
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 onTTBR0_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")Reported-by Christoffer Dall <[email protected]>Signed-off-by Marc Zyngier <[email protected]>---
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<-----------------
Commit4b65a5db3627("arm64: Introduce uaccess_{disable,enable} functionality based onTTBR0_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...