* [PATCH] arm64: Re-enable PAN on uaccess_enable
@ 2016-12-12 13:50 Marc Zyngier
2016-12-12 15:06 ` Christoffer Dall
0 siblings, 1 reply; 4+ messages in thread
From: Marc Zyngier @ 2016-12-12 13:50 UTC (permalink / raw)
To: linux-arm-kernel
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")
Reported-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
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(-)
diff --git a/arch/arm64/include/asm/uaccess.h b/arch/arm64/include/asm/uaccess.h
index 6986f56..d26750c 100644
--- a/arch/arm64/include/asm/uaccess.h
+++ b/arch/arm64/include/asm/uaccess.h
@@ -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)
--
2.1.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] arm64: Re-enable PAN on uaccess_enable
2016-12-12 13:50 [PATCH] arm64: Re-enable PAN on uaccess_enable Marc Zyngier
@ 2016-12-12 15:06 ` Christoffer Dall
2016-12-12 15:14 ` Catalin Marinas
0 siblings, 1 reply; 4+ messages in thread
From: Christoffer Dall @ 2016-12-12 15:06 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Dec 12, 2016 at 01:50:26PM +0000, Marc Zyngier wrote:
> 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")
> Reported-by: Christoffer Dall <christoffer.dall@linaro.org>
> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
> ---
> Christoffer, any chance you could give this a go and let me know
> if that fixes your issues?
Yep, fixes the issue. Thanks!
-Christoffer
>
> arch/arm64/include/asm/uaccess.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm64/include/asm/uaccess.h b/arch/arm64/include/asm/uaccess.h
> index 6986f56..d26750c 100644
> --- a/arch/arm64/include/asm/uaccess.h
> +++ b/arch/arm64/include/asm/uaccess.h
> @@ -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)
> --
> 2.1.4
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] arm64: Re-enable PAN on uaccess_enable
2016-12-12 15:06 ` Christoffer Dall
@ 2016-12-12 15:14 ` Catalin Marinas
2016-12-12 15:25 ` Marc Zyngier
0 siblings, 1 reply; 4+ messages in thread
From: Catalin Marinas @ 2016-12-12 15:14 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Dec 12, 2016 at 04:06:36PM +0100, Christoffer Dall wrote:
> On Mon, Dec 12, 2016 at 01:50:26PM +0000, Marc Zyngier wrote:
> > 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")
> > Reported-by: Christoffer Dall <christoffer.dall@linaro.org>
> > Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
> > ---
> > 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.
--
Catalin
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] arm64: Re-enable PAN on uaccess_enable
2016-12-12 15:14 ` Catalin Marinas
@ 2016-12-12 15:25 ` Marc Zyngier
0 siblings, 0 replies; 4+ messages in thread
From: Marc Zyngier @ 2016-12-12 15:25 UTC (permalink / raw)
To: linux-arm-kernel
On 12/12/16 15:14, Catalin Marinas wrote:
> On Mon, Dec 12, 2016 at 04:06:36PM +0100, Christoffer Dall wrote:
>> On Mon, Dec 12, 2016 at 01:50:26PM +0000, Marc Zyngier wrote:
>>> 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")
>>> Reported-by: Christoffer Dall <christoffer.dall@linaro.org>
>>> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
>>> ---
>>> 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.
That looks indeed much better. Thanks!
M.
--
Jazz is not dead. It just smells funny...
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-12-12 15:25 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-12 13:50 [PATCH] arm64: Re-enable PAN on uaccess_enable Marc Zyngier
2016-12-12 15:06 ` Christoffer Dall
2016-12-12 15:14 ` Catalin Marinas
2016-12-12 15:25 ` Marc Zyngier
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).