[PATCH v2] arm: cmpxchg syscall should data abort if page not write

Nicolas Pitre nicolas.pitre at linaro.org
Thu Mar 17 13:01:53 EDT 2011


On Tue, 15 Mar 2011, Po-Yu Chuang wrote:

> From: Po-Yu Chuang <ratbert at faraday-tech.com>
> 
> If the page to cmpxchg is user mode read only (not write),
> we should simulate a data abort first.
> 
> Signed-off-by: Po-Yu Chuang <ratbert at faraday-tech.com>

Acked-by: Nicolas Pitre <nicolas.pitre at linaro.org>

> ---
> v2:
> remove !pte_young() check
> 
>  arch/arm/kernel/traps.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
> index 446aee9..eac7c05 100644
> --- a/arch/arm/kernel/traps.c
> +++ b/arch/arm/kernel/traps.c
> @@ -563,7 +563,7 @@ asmlinkage int arm_syscall(int no, struct pt_regs *regs)
>  		if (!pmd_present(*pmd))
>  			goto bad_access;
>  		pte = pte_offset_map_lock(mm, pmd, addr, &ptl);
> -		if (!pte_present(*pte) || !pte_dirty(*pte)) {
> +		if (!pte_present(*pte) || !pte_write(*pte) || !pte_dirty(*pte)) {
>  			pte_unmap_unlock(pte, ptl);
>  			goto bad_access;
>  		}
> -- 
> 1.6.3.3
> 



More information about the linux-arm-kernel mailing list