BPF List
 help / color / mirror / Atom feed
From: Menglong Dong <menglong8.dong@gmail.com>
To: ast@kernel.org
Cc: bpf@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-trace-kernel@vger.kernel.org, jiang.biao@linux.dev
Subject: [PATCH RFC bpf-next 2/3] x86,bpf: use bpf_prog_report_probe_violation for x86
Date: Sat, 27 Sep 2025 14:12:09 +0800	[thread overview]
Message-ID: <20250927061210.194502-3-menglong.dong@linux.dev> (raw)
In-Reply-To: <20250927061210.194502-1-menglong.dong@linux.dev>

Use bpf_prog_report_probe_violation() to report the memory probe fault
in ex_handler_bpf().

Signed-off-by: Menglong Dong <menglong.dong@linux.dev>
---
 arch/x86/net/bpf_jit_comp.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c
index fc13306af15f..03d4d8385f4c 100644
--- a/arch/x86/net/bpf_jit_comp.c
+++ b/arch/x86/net/bpf_jit_comp.c
@@ -1470,6 +1470,8 @@ bool ex_handler_bpf(const struct exception_table_entry *x, struct pt_regs *regs)
 		off = FIELD_GET(DATA_ARENA_OFFSET_MASK, x->data);
 		addr = *(unsigned long *)((void *)regs + arena_reg) + off;
 		bpf_prog_report_arena_violation(is_write, addr, regs->ip);
+	} else {
+		bpf_prog_report_probe_violation(is_write, regs->ip);
 	}
 
 	/* jump over faulting load and clear dest register */
-- 
2.51.0


  parent reply	other threads:[~2025-09-27  6:12 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-27  6:12 [PATCH RFC bpf-next 0/3] bpf: report probe fault to BPF stderr Menglong Dong
2025-09-27  6:12 ` [PATCH RFC bpf-next 1/3] " Menglong Dong
2025-10-02  2:03   ` Alexei Starovoitov
2025-10-07  6:14     ` Menglong Dong
2025-10-08 14:40       ` Leon Hwang
2025-10-08 16:27         ` bpf_errno. Was: " Alexei Starovoitov
2025-10-08 17:08           ` Kumar Kartikeya Dwivedi
2025-10-08 19:34             ` Eduard Zingerman
2025-10-08 20:08               ` Kumar Kartikeya Dwivedi
2025-10-08 20:30                 ` Eduard Zingerman
2025-10-08 20:59                   ` Kumar Kartikeya Dwivedi
2025-10-09 14:29                 ` Leon Hwang
2025-10-09 15:15                   ` Leon Hwang
2025-10-10 12:05                 ` Menglong Dong
2025-10-10 15:10                   ` Menglong Dong
2025-10-10 18:55                   ` Eduard Zingerman
2025-10-11  1:23                     ` Menglong Dong
2025-10-09 14:15           ` Leon Hwang
2025-10-09 14:45             ` Alexei Starovoitov
2025-10-10 14:22               ` Leon Hwang
2025-09-27  6:12 ` Menglong Dong [this message]
2025-09-27  6:12 ` [PATCH RFC bpf-next 3/3] selftests/bpf: add testcase for probe read fault Menglong Dong

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=20250927061210.194502-3-menglong.dong@linux.dev \
    --to=menglong8.dong@gmail.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=jiang.biao@linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.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