From: Kefeng Wang <wangkefeng.wang@huawei.com>
To: Russell King <linux@armlinux.org.uk>,
<linux-arm-kernel@lists.infradead.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
<linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Jungseung Lee <js07.lee@gmail.com>, Will Deacon <will@kernel.org>
Subject: Re: [PATCH v3 0/6] ARM: mm: cleanup page fault and fix pxn process issue
Date: Mon, 19 Jul 2021 20:19:14 +0800 [thread overview]
Message-ID: <c96d7688-a8cd-85cd-9e2b-bdce5bd84db0@huawei.com> (raw)
In-Reply-To: <20210610123556.171328-1-wangkefeng.wang@huawei.com>
Hi Russell, kindly ping after 5.14-rc2, any comments, thanks.
On 2021/6/10 20:35, Kefeng Wang wrote:
> The patchset cleanup ARM page fault handle to improve readability,
> fix the page table entries printing and fix infinite loop in the
> page fault handler when user code execution with privilege mode if
> ARM_LPAE enabled.
>
> echo EXEC_USERSPACE > /sys/kernel/debug/provoke-crash/DIRECT
>
> Before:
> -------
> lkdtm: Performing direct entry EXEC_USERSPACE
> lkdtm: attempting ok execution at c0717674
> lkdtm: attempting bad execution at b6fd6000
> rcu: INFO: rcu_sched self-detected stall on CPU
> rcu: 1-....: (2100 ticks this GP) idle=7e2/1/0x40000002 softirq=136/136 fqs=1050
> (t=2101 jiffies g=-1027 q=16)
> NMI backtrace for cpu 1
> CPU: 1 PID: 57 Comm: sh Not tainted 5.13.0-rc4 #126
> ...
> r9:c1f04000 r8:c0e04cc8 r7:c1f05cbc r6:ffffffff r5:60000113 r4:c03724f8
> [<c03722e0>] (handle_mm_fault) from [<c02152f4>] (do_page_fault+0x1a0/0x3d8)
> r10:c180ec48 r9:c11b1aa0 r8:c11b1ac0 r7:8000020f r6:b6fd6000 r5:c180ec00
> r4:c1f05df8
> [<c0215154>] (do_page_fault) from [<c02157cc>] (do_PrefetchAbort+0x40/0x94)
> r10:0000000f r9:c1f04000 r8:c1f05df8 r7:b6fd6000 r6:c0215154 r5:0000020f
> r4:c0e09b18
> [<c021578c>] (do_PrefetchAbort) from [<c0200c50>] (__pabt_svc+0x50/0x80)
> Exception stack(0xc1f05df8 to 0xc1f05e40)
> 5de0: 0000002b 2e34f000
> 5e00: 3ee77213 3ee77213 b6fd6000 c0b51020 c140d000 c0a4b5dc 0000000f c1f05f58
> 5e20: 0000000f c1f05e64 c1f05d88 c1f05e48 c0717a6c b6fd6000 60000013 ffffffff
> r8:0000000f r7:c1f05e2c r6:ffffffff r5:60000013 r4:b6fd6000
> [<c07179a8>] (lkdtm_EXEC_USERSPACE) from [<c09a51b8>] (lkdtm_do_action+0x48/0x4c)
> r4:00000027
> ...
>
>
> After:
> -------
> lkdtm: Performing direct entry EXEC_USERSPACE
> lkdtm: attempting ok execution at c07176d4
> lkdtm: attempting bad execution at b6f57000
> 8<--- cut here ---
> Unable to handle kernel execution of memory at virtual address b6f57000
> pgd = 81e20f00
> [b6f57000] *pgd=81e23003, *pmd=13ee9c003
> Internal error: Oops: 8000020f [#1] SMP ARM
> Modules linked in:
> CPU: 0 PID: 57 Comm: sh Not tainted 5.13.0-rc4+ #127
> Hardware name: ARM-Versatile Express
> PC is at 0xb6f57000
> LR is at lkdtm_EXEC_USERSPACE+0xc4/0xd4
> pc : [<b6f57000>] lr : [<c0717acc>] psr: 60000013
> sp : c1f3de48 ip : c1f3dd88 fp : c1f3de64
> r10: 0000000f r9 : c1f3df58 r8 : 0000000f
> r7 : c0a4b5dc r6 : c1f1d000 r5 : c0b51070 r4 :b6f57000
> r3 : 7e62f7da r2 : 7e62f7da r1 : 2e330000 r0 :0000002b
> Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
> ...
>
> v3:
> - drop the fix about page table printing
> - kill page table base print instead of printing the physical address
> - only die when permission fault both kernel-mode and user code execution
> with privilege mode
> - drop LPAE specific
>
> v2:
> - split patch into smaller changes suggested by Russell
> - fix page table printing in show_pte()
> - add new die_kernel_fault() helper
> - report "execution of user memory" when user code execution with
> privilege mode
>
>
> Kefeng Wang (6):
> ARM: mm: Rafactor the __do_page_fault()
> ARM: mm: Kill task_struct argument for __do_page_fault()
> ARM: mm: Cleanup access_error()
> ARM: mm: Kill page table base print in show_pte()
> ARM: mm: Provide die_kernel_fault() helper
> ARM: mm: Fix PXN process with LPAE feature
>
> arch/arm/mm/fault.c | 119 +++++++++++++++++++++++---------------------
> arch/arm/mm/fault.h | 4 ++
> 2 files changed, 67 insertions(+), 56 deletions(-)
>
next prev parent reply other threads:[~2021-07-19 12:19 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-10 12:35 Kefeng Wang
2021-06-10 12:35 ` [PATCH v3 1/6] ARM: mm: Rafactor the __do_page_fault() Kefeng Wang
2021-06-10 12:35 ` [PATCH v3 2/6] ARM: mm: Kill task_struct argument for __do_page_fault() Kefeng Wang
2021-06-10 12:35 ` [PATCH v3 3/6] ARM: mm: Cleanup access_error() Kefeng Wang
2021-06-10 12:35 ` [PATCH v3 4/6] ARM: mm: Kill page table base print in show_pte() Kefeng Wang
2021-06-10 12:35 ` [PATCH v3 5/6] ARM: mm: Provide die_kernel_fault() helper Kefeng Wang
2021-06-10 12:35 ` [PATCH v3 6/6] ARM: mm: Fix PXN process with LPAE feature Kefeng Wang
2021-06-15 2:15 ` [PATCH v3 0/6] ARM: mm: cleanup page fault and fix pxn process issue Kefeng Wang
2021-07-19 12:19 ` Kefeng Wang [this message]
2021-07-31 6:42 ` Kefeng Wang
2021-08-12 13:51 ` Kefeng Wang
2021-10-12 1:41 ` Kefeng Wang
2021-10-14 16:28 ` Russell King (Oracle)
2021-10-15 1:05 ` 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=c96d7688-a8cd-85cd-9e2b-bdce5bd84db0@huawei.com \
--to=wangkefeng.wang@huawei.com \
--cc=akpm@linux-foundation.org \
--cc=catalin.marinas@arm.com \
--cc=js07.lee@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=will@kernel.org \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome