From: Lorenz Hetterich <lorenz.hetterich@cispa.de>
To: <chenhuacai@kernel.org>
Cc: <loongarch@lists.linux.dev>, <linux-kernel@vger.kernel.org>,
Lorenz Hetterich <lorenz.hetterich@cispa.de>
Subject: [PATCH 0/2] Fix issues in LoongArch page fault handling
Date: Wed, 18 Mar 2026 16:18:19 +0100 [thread overview]
Message-ID: <20260318151821.190439-1-lorenz.hetterich@cispa.de> (raw)
This patch series addresses two issues in LoongArch page fault handling.
First, the page fault handler calls kprobe_page_fault
with the current thread's trap_nr.
However, the thread's trap number is not updated prior
to the call leading to a stale value being used.
Second, the page fault handler never sets the FAULT_FLAG_INSTRUCTION flag.
This means architecture-independent linux code like
handle_mm_fault cannot distinguish between read and execute faults.
While this does not seem to cause immediate problems,
it is inconsistent with other architectures like x86, arm64, and riscv.
Signed-off-by: Lorenz Hetterich <lorenz.hetterich@cispa.de>
Lorenz Hetterich (2):
Loongarch: Fix stale value in __do_page_fault()
LoongArch: Set FAULT_FLAG_INSTRUCTION in __do_page_fault()
arch/loongarch/include/asm/exception.h | 3 +++
arch/loongarch/mm/fault.c | 4 ++++
2 files changed, 7 insertions(+)
--
2.43.0
next reply other threads:[~2026-03-18 15:55 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-18 15:18 Lorenz Hetterich [this message]
2026-03-18 15:18 ` [PATCH 1/2] Loongarch: Fix stale value in __do_page_fault() Lorenz Hetterich
2026-03-19 8:30 ` Huacai Chen
2026-03-18 15:18 ` [PATCH 2/2] LoongArch: Set FAULT_FLAG_INSTRUCTION " Lorenz Hetterich
2026-03-19 8:30 ` Huacai Chen
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=20260318151821.190439-1-lorenz.hetterich@cispa.de \
--to=lorenz.hetterich@cispa.de \
--cc=chenhuacai@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=loongarch@lists.linux.dev \
/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
all inboxes | Powered by JetHome®