LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Kefeng Wang <wangkefeng.wang@huawei.com>
To: ownia <ownia.linux@gmail.com>
Cc: Russell King <linux@armlinux.org.uk>,
	Alexander Potapenko <glider@google.com>,
	Marco Elver <elver@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Dmitry Vyukov <dvyukov@google.com>,
	<linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<kasan-dev@googlegroups.com>
Subject: Re: [PATCH 3/4] ARM: Support KFENCE for ARM
Date: Wed, 25 Aug 2021 22:31:45 +0800	[thread overview]
Message-ID: <8531455d-3198-96cd-e26b-03156f95ac80@huawei.com> (raw)
In-Reply-To: <51b02ecd-0f3d-99b0-c943-1d4da26174d0@gmail.com>


On 2021/8/25 21:18, ownia wrote:
> On 2021/8/25 17:21, Kefeng Wang wrote:
>> Add architecture specific implementation details for KFENCE and enable
>> KFENCE on ARM. In particular, this implements the required interface in
>>   <asm/kfence.h>.
>>
>> KFENCE requires that attributes for pages from its memory pool can
>> individually be set. Therefore, force the kfence pool to be mapped
>> at page granularity.
>>
>> Testing this patch using the testcases in kfence_test.c and all passed
>> with or without ARM_LPAE.
>>
>> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
...
>> +#endif /* __ASM_ARM_KFENCE_H */
>> diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c
>> index f7ab6dabe89f..9fa221ffa1b9 100644
>> --- a/arch/arm/mm/fault.c
>> +++ b/arch/arm/mm/fault.c
>> @@ -17,6 +17,7 @@
>>   #include <linux/sched/debug.h>
>>   #include <linux/highmem.h>
>>   #include <linux/perf_event.h>
>> +#include <linux/kfence.h>
>>   
>>   #include <asm/system_misc.h>
>>   #include <asm/system_info.h>
>> @@ -131,10 +132,14 @@ __do_kernel_fault(struct mm_struct *mm, unsigned long addr, unsigned int fsr,
>>   	/*
>>   	 * No handler, we'll have to terminate things with extreme prejudice.
>>   	 */
>> -	if (addr < PAGE_SIZE)
>> +	if (addr < PAGE_SIZE) {
>>   		msg = "NULL pointer dereference";
>> -	else
>> +	} else {
>> +		if (kfence_handle_page_fault(addr, is_write_fault(fsr), regs))
>> +			return;
>> +
>>   		msg = "paging request";
>> +	}
>
> I think here should do some fixup to follow upstream mainline code.

Yes, the fixup is still there, as the cover-letter said,

NOTE:
The context of patch2/3 changes in arch/arm/mm/fault.c is based on link[1],
which make some refactor and cleanup about page fault.

...

[1]https://lore.kernel.org/linux-arm-kernel/20210610123556.171328-1-wangkefeng.wang@huawei.com/

>
>>   
>>   	die_kernel_fault(msg, mm, addr, fsr, regs);
>>   }
> .
>

  reply	other threads:[~2021-08-25 14:31 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-25  9:21 [PATCH 0/4] ARM: Support KFENCE feature Kefeng Wang
2021-08-25  9:21 ` [PATCH 1/4] ARM: mm: Provide set_memory_valid() Kefeng Wang
2021-08-25  9:21 ` [PATCH 2/4] ARM: mm: Provide is_write_fault() Kefeng Wang
2021-08-25  9:21 ` [PATCH 3/4] ARM: Support KFENCE for ARM Kefeng Wang
2021-08-25 13:18   ` ownia
2021-08-25 14:31     ` Kefeng Wang [this message]
2021-08-25  9:21 ` [PATCH 4/4] mm: kfence: Only load kfence_test when kfence is enabled Kefeng Wang
2021-08-25  9:31   ` Alexander Potapenko
2021-08-25  9:54     ` Marco Elver
2021-08-25  9:55     ` Kefeng Wang
2021-08-25  9:59       ` Marco Elver
2021-08-25 10:14 ` [PATCH 0/4] ARM: Support KFENCE feature Marco Elver
2021-08-25 10:57   ` Marco Elver
2021-08-25 14:15     ` Kefeng Wang
2021-08-25 14:28     ` Kefeng Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8531455d-3198-96cd-e26b-03156f95ac80@huawei.com \
    --to=wangkefeng.wang@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=dvyukov@google.com \
    --cc=elver@google.com \
    --cc=glider@google.com \
    --cc=kasan-dev@googlegroups.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=ownia.linux@gmail.com \
    --subject='Re: [PATCH 3/4] ARM: Support KFENCE for ARM' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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).