[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <8531455d-3198-96cd-e26b-03156f95ac80@huawei.com>
Date: Wed, 25 Aug 2021 22:31:45 +0800
From: Kefeng Wang <wangkefeng.wang@...wei.com>
To: ownia <ownia.linux@...il.com>
CC: Russell King <linux@...linux.org.uk>,
Alexander Potapenko <glider@...gle.com>,
Marco Elver <elver@...gle.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Dmitry Vyukov <dvyukov@...gle.com>,
<linux-kernel@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
<kasan-dev@...glegroups.com>
Subject: Re: [PATCH 3/4] ARM: Support KFENCE for ARM
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@...wei.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);
>> }
> .
>
Powered by blists - more mailing lists