Re: [PATCH 1/2] MIPS: Handle page faults of executable but unreadable pages correctly.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 23/07/15 10:10, Ralf Baechle wrote:
> Without this we end taking execeptions in an endless loop hanging the
> thread.

A little more explanation would be nice. Under what situations does this
occur? Does this mean any VM_EXEC and !VM_READ page can't actually be
faulted in without it being treated as an RI violation, or does it only
affect when read from kernel emulation code?

Cheers
James

> 
> Signed-off-by: Ralf Baechle <ralf@xxxxxxxxxxxxxx>
> ---
>  arch/mips/mm/fault.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/mips/mm/fault.c b/arch/mips/mm/fault.c
> index 36c0f26..852a41c 100644
> --- a/arch/mips/mm/fault.c
> +++ b/arch/mips/mm/fault.c
> @@ -133,7 +133,8 @@ good_area:
>  #endif
>  				goto bad_area;
>  			}
> -			if (!(vma->vm_flags & VM_READ)) {
> +			if (!(vma->vm_flags & VM_READ) &&
> +			    exception_epc(regs) != address) {
>  #if 0
>  				pr_notice("Cpu%d[%s:%d:%0*lx:%ld:%0*lx] RI violation\n",
>  					  raw_smp_processor_id(),
> 

Attachment: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux