From: Vladimir Kondratiev <vladimir.kondratiev@mobileye.com>
To: Paul Walmsley <pjw@kernel.org>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>,
Alexandre Ghiti <alex@ghiti.fr>,
Masami Hiramatsu <mhiramat@kernel.org>,
Oleg Nesterov <oleg@redhat.com>,
Peter Zijlstra <peterz@infradead.org>
Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org,
linux-trace-kernel@vger.kernel.org,
Vladimir Kondratiev <vladimir.kondratiev@mobileye.com>,
Sashiko <sashiko-bot@kernel.org>
Subject: [PATCH v2 0/2] riscv: probes: reject probes inside an LR/SC sequence
Date: Wed, 11 Nov 2026 19:01:06 +0200 [thread overview]
Message-ID: <20261111-probes-in-lrsc-v2-0-b2525b7e1e8e@mobileye.com> (raw)
Patch 1 fixes page fault reported by sashiko-bot@kernel.org that
existed before this patch series
Patch 2 rejects probes inside the LR/SC sequence. This commit was
submitted as patch 1 of the series [1].
Detaching it from that series with slightly edited commit message,
because it is not depending on other stuff.
[1] https://patch.msgid.link/20261110-lrsc-only-v6-0-bafc3cc0fcae@mobileye.com
---
Changes in v2:
- Allow kprobe on the LR itself unless it is part of the LR/SC loop.
- Fix error (reported by sashiko-bot@kernel.org) where
arch_prepare_kprobe() returns -EILSEQ for LR/SC probes.
Make codes returned by arch_check_kprobe to indicate -EINVAL
if probe falls within the LR/SC loop, consistent with the case when
INSN_REJECTED returned by riscv_probe_decode_insn
- add patch fixing out-of-bounds read in riscv_probe_decode_insn()
reported by sashiko-bot@kernel.org (as patch 1)
- Link to v1: https://patch.msgid.link/20261111-probes-in-lrsc-v1-1-4f99ddea5f68@mobileye.com
To: Paul Walmsley <pjw@kernel.org>
To: Palmer Dabbelt <palmer@dabbelt.com>
To: Albert Ou <aou@eecs.berkeley.edu>
To: Alexandre Ghiti <alex@ghiti.fr>
To: Masami Hiramatsu <mhiramat@kernel.org>
To: Oleg Nesterov <oleg@redhat.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: linux-riscv@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-trace-kernel@vger.kernel.org
Signed-off-by: Vladimir Kondratiev <vladimir.kondratiev@mobileye.com>
---
Vladimir Kondratiev (2):
riscv: kprobes: fix out-of-bounds read in riscv_probe_decode_insn
riscv: probes: reject probes inside an LR/SC sequence
arch/riscv/include/asm/insn.h | 28 +++++++++++
arch/riscv/kernel/probes/decode-insn.c | 91 ++++++++++++++++++++++++++++++++++
arch/riscv/kernel/probes/decode-insn.h | 7 +++
arch/riscv/kernel/probes/kprobes.c | 29 +++++++----
arch/riscv/kernel/probes/uprobes.c | 31 ++++++++++++
5 files changed, 177 insertions(+), 9 deletions(-)
---
base-commit: c03c1a14507dfaf8b856c2608f9ac216021fc222
change-id: 20261111-probes-in-lrsc-4ccde6cbf436
Best regards,
--
Vladimir Kondratiev <vladimir.kondratiev@mobileye.com>
next reply other threads:[~2026-11-11 17:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-11 17:01 Vladimir Kondratiev [this message]
2026-11-11 17:01 ` [PATCH v2 1/2] riscv: kprobes: fix out-of-bounds read in riscv_probe_decode_insn Vladimir Kondratiev
2026-11-11 17:01 ` [PATCH v2 2/2] riscv: probes: reject probes inside an LR/SC sequence Vladimir Kondratiev
2026-11-12 7:54 ` Nam Cao
2026-11-12 11:19 ` Vladimir Kondratiev
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=20261111-probes-in-lrsc-v2-0-b2525b7e1e8e@mobileye.com \
--to=vladimir.kondratiev@mobileye.com \
--cc=alex@ghiti.fr \
--cc=aou@eecs.berkeley.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mhiramat@kernel.org \
--cc=oleg@redhat.com \
--cc=palmer@dabbelt.com \
--cc=peterz@infradead.org \
--cc=pjw@kernel.org \
--cc=sashiko-bot@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
all inboxes | Powered by JetHome®