All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arm64: print additional fault message when executing non-exec memory
@ 2019-10-28  9:08 ` Xiang Zheng
  0 siblings, 0 replies; 6+ messages in thread
From: Xiang Zheng @ 2019-10-28  9:08 UTC (permalink / raw)
  To: catalin.marinas, will
  Cc: james.morse, linux-arm-kernel, linux-kernel, wanghaibin.wang

When attempting to executing non-executable memory, the fault message
shows:

  Unable to handle kernel read from unreadable memory at virtual address
  ffff802dac469000

This may confuse someone, so add a new fault message for instruction
abort.

Signed-off-by: Xiang Zheng <zhengxiang9@huawei.com>
---
 arch/arm64/mm/fault.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
index 9fc6db0bcbad..68bf4ec376d0 100644
--- a/arch/arm64/mm/fault.c
+++ b/arch/arm64/mm/fault.c
@@ -318,6 +318,8 @@ static void __do_kernel_fault(unsigned long addr, unsigned int esr,
 	if (is_el1_permission_fault(addr, esr, regs)) {
 		if (esr & ESR_ELx_WNR)
 			msg = "write to read-only memory";
+		else if (is_el1_instruction_abort(esr))
+			msg = "execute non-executable memory";
 		else
 			msg = "read from unreadable memory";
 	} else if (addr < PAGE_SIZE) {
-- 
2.19.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH] arm64: print additional fault message when executing non-exec memory
@ 2019-10-28  9:08 ` Xiang Zheng
  0 siblings, 0 replies; 6+ messages in thread
From: Xiang Zheng @ 2019-10-28  9:08 UTC (permalink / raw)
  To: catalin.marinas, will
  Cc: wanghaibin.wang, james.morse, linux-kernel, linux-arm-kernel

When attempting to executing non-executable memory, the fault message
shows:

  Unable to handle kernel read from unreadable memory at virtual address
  ffff802dac469000

This may confuse someone, so add a new fault message for instruction
abort.

Signed-off-by: Xiang Zheng <zhengxiang9@huawei.com>
---
 arch/arm64/mm/fault.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
index 9fc6db0bcbad..68bf4ec376d0 100644
--- a/arch/arm64/mm/fault.c
+++ b/arch/arm64/mm/fault.c
@@ -318,6 +318,8 @@ static void __do_kernel_fault(unsigned long addr, unsigned int esr,
 	if (is_el1_permission_fault(addr, esr, regs)) {
 		if (esr & ESR_ELx_WNR)
 			msg = "write to read-only memory";
+		else if (is_el1_instruction_abort(esr))
+			msg = "execute non-executable memory";
 		else
 			msg = "read from unreadable memory";
 	} else if (addr < PAGE_SIZE) {
-- 
2.19.1



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] arm64: print additional fault message when executing non-exec memory
  2019-10-28  9:08 ` Xiang Zheng
@ 2019-10-28 16:41   ` Will Deacon
  -1 siblings, 0 replies; 6+ messages in thread
From: Will Deacon @ 2019-10-28 16:41 UTC (permalink / raw)
  To: Xiang Zheng
  Cc: catalin.marinas, james.morse, linux-arm-kernel, linux-kernel,
	wanghaibin.wang

On Mon, Oct 28, 2019 at 05:08:37PM +0800, Xiang Zheng wrote:
> When attempting to executing non-executable memory, the fault message
> shows:
> 
>   Unable to handle kernel read from unreadable memory at virtual address
>   ffff802dac469000
> 
> This may confuse someone, so add a new fault message for instruction
> abort.
> 
> Signed-off-by: Xiang Zheng <zhengxiang9@huawei.com>
> ---
>  arch/arm64/mm/fault.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
> index 9fc6db0bcbad..68bf4ec376d0 100644
> --- a/arch/arm64/mm/fault.c
> +++ b/arch/arm64/mm/fault.c
> @@ -318,6 +318,8 @@ static void __do_kernel_fault(unsigned long addr, unsigned int esr,
>  	if (is_el1_permission_fault(addr, esr, regs)) {
>  		if (esr & ESR_ELx_WNR)
>  			msg = "write to read-only memory";
> +		else if (is_el1_instruction_abort(esr))
> +			msg = "execute non-executable memory";

nit, please make this "execute from non-executable memory".

With that:

Acked-by: Will Deacon <will@kernel.org>

Will

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] arm64: print additional fault message when executing non-exec memory
@ 2019-10-28 16:41   ` Will Deacon
  0 siblings, 0 replies; 6+ messages in thread
From: Will Deacon @ 2019-10-28 16:41 UTC (permalink / raw)
  To: Xiang Zheng
  Cc: catalin.marinas, james.morse, linux-kernel, linux-arm-kernel,
	wanghaibin.wang

On Mon, Oct 28, 2019 at 05:08:37PM +0800, Xiang Zheng wrote:
> When attempting to executing non-executable memory, the fault message
> shows:
> 
>   Unable to handle kernel read from unreadable memory at virtual address
>   ffff802dac469000
> 
> This may confuse someone, so add a new fault message for instruction
> abort.
> 
> Signed-off-by: Xiang Zheng <zhengxiang9@huawei.com>
> ---
>  arch/arm64/mm/fault.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
> index 9fc6db0bcbad..68bf4ec376d0 100644
> --- a/arch/arm64/mm/fault.c
> +++ b/arch/arm64/mm/fault.c
> @@ -318,6 +318,8 @@ static void __do_kernel_fault(unsigned long addr, unsigned int esr,
>  	if (is_el1_permission_fault(addr, esr, regs)) {
>  		if (esr & ESR_ELx_WNR)
>  			msg = "write to read-only memory";
> +		else if (is_el1_instruction_abort(esr))
> +			msg = "execute non-executable memory";

nit, please make this "execute from non-executable memory".

With that:

Acked-by: Will Deacon <will@kernel.org>

Will

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] arm64: print additional fault message when executing non-exec memory
  2019-10-28 16:41   ` Will Deacon
@ 2019-10-29  1:02     ` Xiang Zheng
  -1 siblings, 0 replies; 6+ messages in thread
From: Xiang Zheng @ 2019-10-29  1:02 UTC (permalink / raw)
  To: Will Deacon
  Cc: catalin.marinas, james.morse, linux-arm-kernel, linux-kernel,
	wanghaibin.wang



On 2019/10/29 0:41, Will Deacon wrote:
> On Mon, Oct 28, 2019 at 05:08:37PM +0800, Xiang Zheng wrote:
>> When attempting to executing non-executable memory, the fault message
>> shows:
>>
>>   Unable to handle kernel read from unreadable memory at virtual address
>>   ffff802dac469000
>>
>> This may confuse someone, so add a new fault message for instruction
>> abort.
>>
>> Signed-off-by: Xiang Zheng <zhengxiang9@huawei.com>
>> ---
>>  arch/arm64/mm/fault.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
>> index 9fc6db0bcbad..68bf4ec376d0 100644
>> --- a/arch/arm64/mm/fault.c
>> +++ b/arch/arm64/mm/fault.c
>> @@ -318,6 +318,8 @@ static void __do_kernel_fault(unsigned long addr, unsigned int esr,
>>  	if (is_el1_permission_fault(addr, esr, regs)) {
>>  		if (esr & ESR_ELx_WNR)
>>  			msg = "write to read-only memory";
>> +		else if (is_el1_instruction_abort(esr))
>> +			msg = "execute non-executable memory";
> 
> nit, please make this "execute from non-executable memory".

Thanks, I will make this in the next version of patch.

> 
> With that:
> 
> Acked-by: Will Deacon <will@kernel.org>
> 
> Will
> 
> .
> 

-- 

Thanks,
Xiang


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] arm64: print additional fault message when executing non-exec memory
@ 2019-10-29  1:02     ` Xiang Zheng
  0 siblings, 0 replies; 6+ messages in thread
From: Xiang Zheng @ 2019-10-29  1:02 UTC (permalink / raw)
  To: Will Deacon
  Cc: catalin.marinas, james.morse, linux-kernel, linux-arm-kernel,
	wanghaibin.wang



On 2019/10/29 0:41, Will Deacon wrote:
> On Mon, Oct 28, 2019 at 05:08:37PM +0800, Xiang Zheng wrote:
>> When attempting to executing non-executable memory, the fault message
>> shows:
>>
>>   Unable to handle kernel read from unreadable memory at virtual address
>>   ffff802dac469000
>>
>> This may confuse someone, so add a new fault message for instruction
>> abort.
>>
>> Signed-off-by: Xiang Zheng <zhengxiang9@huawei.com>
>> ---
>>  arch/arm64/mm/fault.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
>> index 9fc6db0bcbad..68bf4ec376d0 100644
>> --- a/arch/arm64/mm/fault.c
>> +++ b/arch/arm64/mm/fault.c
>> @@ -318,6 +318,8 @@ static void __do_kernel_fault(unsigned long addr, unsigned int esr,
>>  	if (is_el1_permission_fault(addr, esr, regs)) {
>>  		if (esr & ESR_ELx_WNR)
>>  			msg = "write to read-only memory";
>> +		else if (is_el1_instruction_abort(esr))
>> +			msg = "execute non-executable memory";
> 
> nit, please make this "execute from non-executable memory".

Thanks, I will make this in the next version of patch.

> 
> With that:
> 
> Acked-by: Will Deacon <will@kernel.org>
> 
> Will
> 
> .
> 

-- 

Thanks,
Xiang


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-10-29  1:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-28  9:08 [PATCH] arm64: print additional fault message when executing non-exec memory Xiang Zheng
2019-10-28  9:08 ` Xiang Zheng
2019-10-28 16:41 ` Will Deacon
2019-10-28 16:41   ` Will Deacon
2019-10-29  1:02   ` Xiang Zheng
2019-10-29  1:02     ` Xiang Zheng

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.