On Mon, Sep 30, 2024 at 11:59:20PM +, tyrone-wu wrote:
> Previously when retrieving `bpf_link_info.perf_event` for
> kprobe/uprobe/tracepoint, the `name_len` field was not populated by the
> kernel, leaving it to reflect the value initially set by the user. This
> behavior was inconsistent with
On Thu, Aug 29, 2024 at 04:31:18PM -0700, Andrii Nakryiko wrote:
> On Thu, Aug 29, 2024 at 4:10 PM Jiri Olsa wrote:
> >
> > On Thu, Aug 29, 2024 at 11:37:37AM -0700, Andrii Nakryiko wrote:
> > > uprobe->register_rwsem is one of a few big bottlenecks to scalability of
&
On Thu, Aug 29, 2024 at 11:37:37AM -0700, Andrii Nakryiko wrote:
> uprobe->register_rwsem is one of a few big bottlenecks to scalability of
> uprobes, so we need to get rid of it to improve uprobe performance and
> multi-CPU scalability.
>
> First, we turn uprobe's consumer list to a typical doubl
The idea is to create and monitor 3 uprobes, each trigered in separate
process and make sure the bpf program gets executed just for the proper
PID specified via pid filter.
Signed-off-by: Jiri Olsa
---
.../bpf/prog_tests/uprobe_multi_test.c| 103 ++
.../bpf/progs
Adding child argument to spawn_child function to allow
to create multiple children in following change.
Signed-off-by: Jiri Olsa
---
.../bpf/prog_tests/uprobe_multi_test.c| 85 +--
1 file changed, 39 insertions(+), 46 deletions(-)
diff --git a/tools/testing/selftests
https://lore.kernel.org/linux-trace-kernel/me0p300mb0416034322b9915ecd3888649d...@me0p300mb0416.ausp300.prod.outlook.com/
---
Jiri Olsa (2):
selftests/bpf: Add child argument to spawn_child function
selftests/bpf: Add uprobe pid filter test for multiple processes
tools/testing/selftest
s heavy
> cache line bouncing, limiting uprobe/uretprobe performance scaling with
> number of CPUs.
>
> Solve both problems by making this a per-CPU counter.
>
> Reviewed-by: Oleg Nesterov
> Signed-off-by: Andrii Nakryiko
lgtm, fwiw
Reviewed-by: Jiri Olsa
jirka
>
On Thu, Aug 22, 2024 at 09:59:29AM -0700, Andrii Nakryiko wrote:
> On Thu, Aug 22, 2024 at 7:22 AM Jiri Olsa wrote:
> >
> > On Mon, Aug 12, 2024 at 09:29:08PM -0700, Andrii Nakryiko wrote:
> >
> > SNIP
> >
> > > @@ -1125,18 +1103,31 @@ void uprobe_unreg
On Mon, Aug 12, 2024 at 09:29:08PM -0700, Andrii Nakryiko wrote:
SNIP
> @@ -1125,18 +1103,31 @@ void uprobe_unregister(struct uprobe *uprobe, struct
> uprobe_consumer *uc)
> int err;
>
> down_write(&uprobe->register_rwsem);
> - if (WARN_ON(!consumer_del(uprobe, uc))) {
> -
On Mon, Aug 05, 2024 at 09:50:45AM +0800, Ubisectech Sirius wrote:
>
>
> Hello.
> We are Ubisectech Sirius Team, the vulnerability lab of China ValiantSec.
> Recently, our team has discovered a issue in Linux kernel 6.8. Attached to
> the email were a PoC file of the issue.
>
> Stack dump:
>
; page then.
> >
> > >
> > > >
> > > > Please add the changes proposed below to your patch, tweak anything if
> > > > you consider it appropriate) and send it as v10.
> > >
> > > it looks good to me, thanks a lot
> >
and send it as v10.
it looks good to me, thanks a lot
Acked-by: From: Jiri Olsa
jirka
>
> Have a lovely day!
> Alex
>
>
> diff --git i/man/man2/uretprobe.2 w/man/man2/uretprobe.2
> index cf1c2b0d8..51b566998 100644
> --- i/man/man2/uretprobe.2
> +++ w/man/man2
re.kernel.org/all/382d39061f59f...@google.com/
> Tested-by: syzbot+f7a1c2c2711e4a780...@syzkaller.appspotmail.com
> Acked-by: Andrii Nakryiko
> Signed-off-by: Oleg Nesterov
thanks for fixing this
Acked-by: Jiri Olsa
jirka
> ---
> kernel/trace/bpf_trace.c | 9 ++
On Mon, Aug 05, 2024 at 01:28:03PM -0700, Andrii Nakryiko wrote:
> trace_uprobe->nhit counter is not incremented atomically, so its value
> is bogus in practice. On the other hand, it's actually a pretty big
> uprobe scalability problem due to heavy cache line bouncing between CPUs
> triggering the
On Wed, Jul 31, 2024 at 02:42:50PM -0700, Andrii Nakryiko wrote:
SNIP
> -/*
> - * There could be threads that have already hit the breakpoint. They
> - * will recheck the current insn and restart if find_uprobe() fails.
> - * See find_active_uprobe().
> - */
> -static void delete_uprobe(struct up
On Wed, Jul 31, 2024 at 02:42:53PM -0700, Andrii Nakryiko wrote:
SNIP
> static int __copy_insn(struct address_space *mapping, struct file *filp,
> void *insn, int nbytes, loff_t offset)
> {
> @@ -924,7 +901,8 @@ static bool filter_chain(struct uprobe *uprobe, struct
> mm_
On Thu, Aug 01, 2024 at 02:26:45PM +0200, Oleg Nesterov wrote:
> On 08/01, Jiri Olsa wrote:
> >
> > > Note the additional path_put() in testmod_unregister_uprobe(). Does it
> > > need
> > > a separate patch or can it come with 5/5 ?
> >
> > I thin
On Thu, Aug 01, 2024 at 02:00:18PM +0200, Oleg Nesterov wrote:
> On 08/01, Jiri Olsa wrote:
> >
> > > @@ -474,10 +477,10 @@ static void testmod_unregister_uprobe(void)
> > > {
> > > mutex_lock(&testmod_uprobe_mutex
On Wed, Jul 31, 2024 at 09:18:00AM -0700, Andrii Nakryiko wrote:
SNIP
> diff --git a/tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c
> b/tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c
> index 5f152afdec2f..73a6b041bcce 100644
> --- a/tools/testing/selftests/bpf/bpf_testmod/bpf_testmo
On Wed, Jul 31, 2024 at 02:42:50PM -0700, Andrii Nakryiko wrote:
SNIP
> static void put_uprobe(struct uprobe *uprobe)
> {
> - if (refcount_dec_and_test(&uprobe->ref)) {
> - /*
> - * If application munmap(exec_vma) before uprobe_unregister()
> - * gets c
a12...@redhat.com/
> >
> > I sent yesterday.
> >
> > Oleg.
> > ---
> >
>
> Both patch sets look good to me. It would be nice to get them applied
> ASAP to have a stable uprobes code base to work on. Rebasing is
> painful and error-prone.
lgtm, +1 for having them applied soon
Reviewed-by: Jiri Olsa
thanks,
jirka
uprobes.h
> - kernel-doc fixes/updates
> - fix use-after free in uprobe_unregister(). See "TODO:" in 5/5.
lgtm
Reviewed-by: Jiri Olsa
thanks,
jirka
>
> Oleg.
> ---
>
> include/linux/uprobes.h | 22 +--
> kernel/events/uprobes.c
On Mon, Jul 15, 2024 at 02:46:51PM +0900, Masami Hiramatsu wrote:
> On Fri, 12 Jul 2024 11:27:30 -0700
> Andrii Nakryiko wrote:
>
> > On Fri, Jul 12, 2024 at 6:53 AM Jiri Olsa wrote:
> > >
> > > Fixing the syscall number value.
> > >
> > >
Fixing the syscall number value.
Fixes: 9e7f74e64ae5 ("selftests/bpf: Add uretprobe syscall call from user space
test")
Signed-off-by: Jiri Olsa
---
tools/testing/selftests/bpf/prog_tests/uprobe_syscall.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/too
Arnd Bergmann
Signed-off-by: Jiri Olsa
---
arch/x86/entry/syscalls/syscall_64.tbl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/entry/syscalls/syscall_64.tbl
b/arch/x86/entry/syscalls/syscall_64.tbl
index 6452c2ec469a..dabf1982de6d 100644
--- a/arch/x86/entry/sysc
bl and selftest change, but it could
be merged together if needed.
The patches are based on:
https://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git
probes/for-next
thanks,
jirka
---
Jiri Olsa (2):
uprobe: Change uretprobe syscall scope and number
selftests/bpf: C
On Thu, Jul 11, 2024 at 01:02:43PM +0200, Peter Zijlstra wrote:
SNIP
> /* Tracing handlers use ->utask to communicate with fetch methods */
> if (!get_utask())
> - goto out;
> + return;
>
> if (arch_uprobe_ignore(&uprobe->arch, regs))
> - go
On Thu, Jul 11, 2024 at 01:02:36PM +0200, Peter Zijlstra wrote:
SNIP
> @@ -1159,7 +1159,7 @@ static int __uprobe_register(struct inod
> if (!IS_ALIGNED(ref_ctr_offset, sizeof(short)))
> return -EINVAL;
>
> - retry:
> +retry:
> uprobe = alloc_uprobe(inode, offset, ref_c
On Wed, Jul 10, 2024 at 11:23:10AM -0700, Andrii Nakryiko wrote:
> On Wed, Jul 10, 2024 at 9:49 AM Jiri Olsa wrote:
> >
> > On Wed, Jul 10, 2024 at 06:31:33PM +0200, Oleg Nesterov wrote:
> >
> > SNIP
> >
> > > diff --git a/kernel/trace/bpf_trac
On Wed, Jul 10, 2024 at 06:31:33PM +0200, Oleg Nesterov wrote:
SNIP
> diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c
> index 467f358c8ce7..7571811127a2 100644
> --- a/kernel/trace/bpf_trace.c
> +++ b/kernel/trace/bpf_trace.c
> @@ -3157,6 +3157,7 @@ struct bpf_uprobe {
> lo
an remove it now.
>
> Signed-off-by: Menglong Dong
lgtm, cc-ing Masami
Acked-by: Jiri Olsa
jirka
> ---
> include/linux/trace_events.h | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/include/linux/trace_events.h b/include/linux/trace_events.h
> index 9d
On Fri, Jul 05, 2024 at 05:35:44PM +0900, Masami Hiramatsu wrote:
SNIP
> > > > > Also, if we can set session enabled by default, and skip ret_handler
> > > > > by handler's
> > > > > return value, it is more simpler. (If handler returns a specific
> > > > > value, skip ret_handler)
> > > >
> >
On Wed, Jul 03, 2024 at 02:48:28PM -0700, Andrii Nakryiko wrote:
> On Wed, Jul 3, 2024 at 10:13 AM Jiri Olsa wrote:
> >
> > On Tue, Jul 02, 2024 at 01:51:28PM -0700, Andrii Nakryiko wrote:
> >
> > SNIP
> >
> > > > #ifdef CONFIG_UPROBES
On Tue, Jul 02, 2024 at 03:10:55PM -0700, Andrii Nakryiko wrote:
> On Mon, Jul 1, 2024 at 9:44 AM Jiri Olsa wrote:
> >
> > Adding test that attached/detaches multiple consumers on
> > single uprobe and verifies all were hit as expected.
> >
> > Signed-off-by
On Tue, Jul 02, 2024 at 03:01:35PM -0700, Andrii Nakryiko wrote:
> On Mon, Jul 1, 2024 at 9:43 AM Jiri Olsa wrote:
> >
> > Adding uprobe session test that verifies the cookie value is stored
> > properly when single uprobe-ed function is executed recursively.
> >
&
On Tue, Jul 02, 2024 at 02:56:34PM -0700, Andrii Nakryiko wrote:
> On Mon, Jul 1, 2024 at 9:43 AM Jiri Olsa wrote:
> >
> > Adding uprobe session attach type name to attach_type_name,
> > so libbpf_bpf_attach_type_str returns proper string name for
> > BPF_TRACE
On Tue, Jul 02, 2024 at 02:34:34PM -0700, Andrii Nakryiko wrote:
> On Mon, Jul 1, 2024 at 9:42 AM Jiri Olsa wrote:
> >
> > Adding support to attach program in uprobe session mode
> > with bpf_program__attach_uprobe_multi function.
> >
> > Adding session bool to
On Tue, Jul 02, 2024 at 01:51:28PM -0700, Andrii Nakryiko wrote:
SNIP
> > #ifdef CONFIG_UPROBES
> > @@ -80,6 +83,12 @@ struct uprobe_task {
> > unsigned intdepth;
> > };
> >
> > +struct session_consumer {
> > + __u64 cookie;
> > + unsigned int
On Wed, Jul 03, 2024 at 05:31:32PM +0200, Jiri Olsa wrote:
> On Tue, Jul 02, 2024 at 01:52:38PM -0700, Andrii Nakryiko wrote:
> > On Tue, Jul 2, 2024 at 9:11 AM Jiri Olsa wrote:
> > >
> > > On Tue, Jul 02, 2024 at 03:04:08PM +0200, Peter Zijlstra wrote:
> > >
On Tue, Jul 02, 2024 at 05:13:38PM -0700, Andrii Nakryiko wrote:
> On Tue, Jul 2, 2024 at 4:55 PM Masami Hiramatsu wrote:
> >
> > Hi Jiri,
> >
> > On Mon, 1 Jul 2024 18:41:07 +0200
> > Jiri Olsa wrote:
> >
> > > Adding support for uprobe cons
On Tue, Jul 02, 2024 at 01:52:38PM -0700, Andrii Nakryiko wrote:
> On Tue, Jul 2, 2024 at 9:11 AM Jiri Olsa wrote:
> >
> > On Tue, Jul 02, 2024 at 03:04:08PM +0200, Peter Zijlstra wrote:
> > > On Mon, Jul 01, 2024 at 06:41:07PM +0200, Jiri Olsa wrote:
&g
On Tue, Jul 02, 2024 at 03:04:08PM +0200, Peter Zijlstra wrote:
> On Mon, Jul 01, 2024 at 06:41:07PM +0200, Jiri Olsa wrote:
>
> > +static void
> > +uprobe_consumer_account(struct uprobe *uprobe, struct uprobe_consumer *uc)
> > +{
> > + static unsigned int se
Adding test that attached/detaches multiple consumers on
single uprobe and verifies all were hit as expected.
Signed-off-by: Jiri Olsa
---
.../bpf/prog_tests/uprobe_multi_test.c| 203 ++
.../progs/uprobe_multi_session_consumers.c| 53 +
2 files changed, 256
Adding uprobe session test that verifies the cookie value is stored
properly when single uprobe-ed function is executed recursively.
Signed-off-by: Jiri Olsa
---
.../bpf/prog_tests/uprobe_multi_test.c| 57 +++
.../progs/uprobe_multi_session_recursive.c| 44
Adding uprobe session test that verifies the cookie value
get properly propagated from entry to return program.
Signed-off-by: Jiri Olsa
---
.../bpf/prog_tests/uprobe_multi_test.c| 31
.../bpf/progs/uprobe_multi_session_cookie.c | 48 +++
2 files changed
Adding uprobe session test and testing that the entry program
return value controls execution of the return probe program.
Signed-off-by: Jiri Olsa
---
.../bpf/prog_tests/uprobe_multi_test.c| 42 +++
.../bpf/progs/uprobe_multi_session.c | 53 +++
2
Adding uprobe session attach type name to attach_type_name,
so libbpf_bpf_attach_type_str returns proper string name for
BPF_TRACE_UPROBE_SESSION attach type.
Signed-off-by: Jiri Olsa
---
tools/lib/bpf/libbpf.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/lib/bpf/libbpf.c b/tools
loader section that allows:
SEC("uprobe.session/bpf_fentry_test*")
and loads/attaches uprobe program as uprobe session.
Signed-off-by: Jiri Olsa
---
tools/lib/bpf/bpf.c| 1 +
tools/lib/bpf/libbpf.c | 50 --
tools/lib/bpf/libbpf.h | 4 +++
Placing bpf_session_run_ctx layer in between bpf_run_ctx and
bpf_uprobe_multi_run_ctx, so the session data can be retrieved
from uprobe_multi link.
Plus granting session kfuncs access to uprobe session programs.
Signed-off-by: Jiri Olsa
---
kernel/trace/bpf_trace.c | 23
probe.
It's possible to control execution of the bpf program on return
probe simply by returning zero or non zero from the entry bpf
program execution to execute or not the bpf program on return
probe respectively.
Signed-off-by: Jiri Olsa
---
include/uapi/linux/bpf.h | 1 +
kerne
n the result we decide to run the return
uprobe (or not).
It's also convenient to share the data between session callbacks.
The control of 'ret_handler' callback execution is done via return
value of the 'handler' callback. If it's 0 we install and execute
return
- entry and return callbacks can share data/cookie
On more details please see patch #1.
v2 changes:
- re-implement uprobe session support [Andrii]
- added test for mixed uprobe consumers
thanks,
jirka
---
Jiri Olsa (9):
uprobe: Add support for session consumer
bpf: Add support
On Fri, Jun 21, 2024 at 03:17:58PM +0200, Jiri Olsa wrote:
> On Fri, Jun 21, 2024 at 02:01:50PM +0200, Oleg Nesterov wrote:
> > On 06/20, Andrii Nakryiko wrote:
> > >
> > > On Thu, Jun 20, 2024 at 12:40 PM Oleg Nesterov wrote:
> > > >
> > > &g
On Fri, Jun 21, 2024 at 02:01:50PM +0200, Oleg Nesterov wrote:
> On 06/20, Andrii Nakryiko wrote:
> >
> > On Thu, Jun 20, 2024 at 12:40 PM Oleg Nesterov wrote:
> > >
> > > But I can't understand what does it do, it calls emit_break() and
> > > git grep -w emit_break finds nothing.
> > >
> >
> > It
On Mon, Jun 17, 2024 at 03:53:50PM -0700, Andrii Nakryiko wrote:
> On Mon, Jun 10, 2024 at 4:06 AM Jiri Olsa wrote:
> >
> > On Thu, Jun 06, 2024 at 09:52:39AM -0700, Andrii Nakryiko wrote:
> > > On Thu, Jun 6, 2024 at 9:46 AM Jiri Olsa wrote:
> > > >
> &
e it to initialize static variable.
Cc: Oleg Nesterov
Fixes: ff474a78cef5 ("uprobe: Add uretprobe syscall to speed up return probe")
Reported-by: Nathan Chancellor
Signed-off-by: Jiri Olsa
---
kernel/events/uprobes.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/kern
On Sun, Jun 16, 2024 at 09:51:18PM +0200, Jiri Olsa wrote:
> On Sun, Jun 16, 2024 at 01:19:11AM +0900, Masami Hiramatsu wrote:
> > On Sun, 16 Jun 2024 00:19:20 +0900
> > Masami Hiramatsu (Google) wrote:
> >
> > > On Fri, 14 Jun 2024 12:15:09 +0200
> > >
On Sun, Jun 16, 2024 at 01:19:11AM +0900, Masami Hiramatsu wrote:
> On Sun, 16 Jun 2024 00:19:20 +0900
> Masami Hiramatsu (Google) wrote:
>
> > On Fri, 14 Jun 2024 12:15:09 +0200
> > Jiri Olsa wrote:
> >
> > > Fixing the __NR_uretprobe number in uprobe_sy
On Fri, Jun 14, 2024 at 10:48:22AM -0700, Nathan Chancellor wrote:
> Hi Jiri,
>
> On Tue, Jun 11, 2024 at 01:21:52PM +0200, Jiri Olsa wrote:
> > Adding uretprobe syscall instead of trap to speed up return probe.
> ...
> > diff --git a/kernel/events/uprobes.c b/kernel/ev
Fixing the __NR_uretprobe number in uprobe_syscall test,
because it changed due to merge conflict.
Signed-off-by: Jiri Olsa
---
tools/testing/selftests/bpf/prog_tests/uprobe_syscall.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/bpf/prog_tests
Adding man page for new uretprobe syscall.
Acked-by: Andrii Nakryiko
Reviewed-by: Alejandro Colomar
Signed-off-by: Jiri Olsa
---
man/man2/uretprobe.2 | 56
1 file changed, 56 insertions(+)
create mode 100644 man/man2/uretprobe.2
diff --git a/man
Adding uretprobe shadow stack test that runs all existing
uretprobe tests with shadow stack enabled if it's available.
Acked-by: Andrii Nakryiko
Reviewed-by: Masami Hiramatsu (Google)
Signed-off-by: Jiri Olsa
---
.../selftests/bpf/prog_tests/uprobe_syscall.c | 60 +++
1
Adding test to verify that when called from outside of the
trampoline provided by kernel, the uretprobe syscall will cause
calling process to receive SIGILL signal and the attached bpf
program is not executed.
Acked-by: Andrii Nakryiko
Reviewed-by: Masami Hiramatsu (Google)
Signed-off-by: Jiri
syscall trampoline and which are later checked in the test.
Acked-by: Andrii Nakryiko
Reviewed-by: Masami Hiramatsu (Google)
Signed-off-by: Jiri Olsa
---
.../selftests/bpf/bpf_testmod/bpf_testmod.c | 123 +-
.../selftests/bpf/prog_tests/uprobe_syscall.c | 67 ++
2 files
Add uretprobe syscall test that compares register values before
and after the uretprobe is hit. It also compares the register
values seen from attached bpf program.
Acked-by: Andrii Nakryiko
Reviewed-by: Masami Hiramatsu (Google)
Signed-off-by: Jiri Olsa
---
tools/include/linux/compiler.h
Adding return uprobe test for shadow stack and making sure it's
working properly. Borrowed some of the code from bpf selftests.
Acked-by: Andrii Nakryiko
Signed-off-by: Jiri Olsa
---
.../testing/selftests/x86/test_shadow_stack.c | 145 ++
1 file changed, 145 insertions(+)
Andrii Nakryiko
Reviewed-by: Oleg Nesterov
Reviewed-by: Masami Hiramatsu (Google)
Acked-by: Andrii Nakryiko
Signed-off-by: Oleg Nesterov
Signed-off-by: Jiri Olsa
---
arch/x86/include/asm/shstk.h | 2 +
arch/x86/kernel/shstk.c | 5 ++
arch/x86/kernel/uprobes.c| 117 +++
Hiramatsu (Google)
Acked-by: Andrii Nakryiko
Signed-off-by: Jiri Olsa
---
arch/x86/entry/syscalls/syscall_64.tbl | 1 +
include/linux/syscalls.h | 2 ++
include/uapi/asm-generic/unistd.h | 5 -
kernel/sys_ni.c| 2 ++
4 files changed, 9 insertions(+), 1
probe code to keep shadow stack in sync with uretprobe
changes to user stack.
Acked-by: Andrii Nakryiko
Acked-by: Rick Edgecombe
Reviewed-by: Oleg Nesterov
Fixes: 488af8ea7131 ("x86/shstk: Wire in shadow stack interface")
Signed-off-by: Jiri Olsa
---
arch/x86/include/asm/shstk.h |
ran ltp on top of this change.
- Man Page
Attached.
- Do not call System Calls in the Kernel
N/A.
[0] https://lore.kernel.org/bpf/ZeCXHKJ--iYYbmLj@krava/
---
Jiri Olsa (8):
x86/shstk: Make return uprobe work with shadow stack
uprobe: Wire up uretprobe system call
uprobe:
On Tue, Jun 11, 2024 at 07:05:21AM +0900, Masami Hiramatsu wrote:
> On Thu, 23 May 2024 14:11:42 +0200
> Jiri Olsa wrote:
>
> > Wiring up uretprobe system call, which comes in following changes.
> > We need to do the wiring before, because the uretprobe implementation
On Thu, Jun 06, 2024 at 09:52:39AM -0700, Andrii Nakryiko wrote:
> On Thu, Jun 6, 2024 at 9:46 AM Jiri Olsa wrote:
> >
> > On Wed, Jun 05, 2024 at 10:50:11PM +0200, Jiri Olsa wrote:
> > > On Wed, Jun 05, 2024 at 07:56:19PM +0200, Oleg Nesterov wrote:
> > >
On Wed, Jun 05, 2024 at 10:50:11PM +0200, Jiri Olsa wrote:
> On Wed, Jun 05, 2024 at 07:56:19PM +0200, Oleg Nesterov wrote:
> > On 06/05, Andrii Nakryiko wrote:
> > >
> > > so any such
> > > limitations will cause problems, issue reports, investigation, etc.
On Wed, Jun 05, 2024 at 01:47:00PM -0700, Andrii Nakryiko wrote:
> On Wed, Jun 5, 2024 at 10:57 AM Oleg Nesterov wrote:
> >
> > On 06/05, Andrii Nakryiko wrote:
> > >
> > > so any such
> > > limitations will cause problems, issue reports, investigation, etc.
> >
> > Agreed...
> >
> > > As one poss
On Wed, Jun 05, 2024 at 10:25:56AM -0700, Andrii Nakryiko wrote:
SNIP
> > ---
> > include/linux/uprobes.h | 18 +++
> > kernel/events/uprobes.c | 69 +++--
> > 2 files changed, 78 insertions(+), 9 deletions(-)
> >
> > diff --git a/include/linux/uprobes
On Wed, Jun 05, 2024 at 07:56:19PM +0200, Oleg Nesterov wrote:
> On 06/05, Andrii Nakryiko wrote:
> >
> > so any such
> > limitations will cause problems, issue reports, investigation, etc.
>
> Agreed...
>
> > As one possible solution, what if we do
> >
> > struct return_instance {
> > ...
>
On Wed, Jun 05, 2024 at 06:36:25PM +0200, Oleg Nesterov wrote:
> On 06/05, Oleg Nesterov wrote:
> >
> > On 06/05, Oleg Nesterov wrote:
> > >
> > > > +/*
> > > > + * Make sure all the uprobe consumers have only one type of entry
> > > > + * callback registered (either handler or handler_session) due
Adding uprobe session test that verifies the cookie value is stored
properly when single uprobe-ed function is executed recursively.
Signed-off-by: Jiri Olsa
---
.../bpf/prog_tests/uprobe_multi_test.c| 57 +++
.../progs/uprobe_multi_session_recursive.c| 44
Adding uprobe session test that verifies the cookie value
get properly propagated from entry to return program.
Signed-off-by: Jiri Olsa
---
.../bpf/prog_tests/uprobe_multi_test.c| 31
.../bpf/progs/uprobe_multi_session_cookie.c | 50 +++
2 files changed
Adding uprobe session test to check that just single
session instance is allowed or single uprobe.
Signed-off-by: Jiri Olsa
---
.../bpf/prog_tests/uprobe_multi_test.c| 27 +++
1 file changed, 27 insertions(+)
diff --git a/tools/testing/selftests/bpf/prog_tests
Adding uprobe session test and testing that the entry program
return value controls execution of the return probe program.
Signed-off-by: Jiri Olsa
---
.../bpf/prog_tests/uprobe_multi_test.c| 38 ++
.../bpf/progs/uprobe_multi_session.c | 52 +++
2
ARRAY_SIZE is used on multiple places, move its definition in
bpf_misc.h header.
Signed-off-by: Jiri Olsa
---
tools/testing/selftests/bpf/progs/bpf_misc.h | 2 ++
tools/testing/selftests/bpf/progs/iters.c| 2 --
tools/testing/selftests/bpf/progs
Adding uprobe session attach type name to attach_type_name,
so libbpf_bpf_attach_type_str returns proper string name for
BPF_TRACE_UPROBE_SESSION attach type.
Signed-off-by: Jiri Olsa
---
tools/lib/bpf/libbpf.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/lib/bpf/libbpf.c b/tools
loader section that allows:
SEC("uprobe.session/bpf_fentry_test*")
and loads/attaches uprobe program as uprobe session.
Signed-off-by: Jiri Olsa
---
tools/lib/bpf/bpf.c| 1 +
tools/lib/bpf/libbpf.c | 50 --
tools/lib/bpf/libbpf.h | 4 +++
Placing bpf_session_run_ctx layer in between bpf_run_ctx and
bpf_uprobe_multi_run_ctx, so the session data can be retrieved
from uprobe_multi link.
Plus granting session kfuncs access to uprobe session programs.
Signed-off-by: Jiri Olsa
---
kernel/trace/bpf_trace.c | 26
probe.
It's possible to control execution of the bpf program on return
probe simply by returning zero or non zero from the entry bpf
program execution to execute or not the bpf program on return
probe respectively.
Signed-off-by: Jiri Olsa
---
include/uapi/linux/bpf.h | 1 +
kerne
and feedback.
Signed-off-by: Jiri Olsa
---
include/linux/uprobes.h | 18 +++
kernel/events/uprobes.c | 69 +++--
2 files changed, 78 insertions(+), 9 deletions(-)
diff --git a/include/linux/uprobes.h b/include/linux/uprobes.h
index f46e0ca0169c..
- entry and return callbacks can share data/cookie
On more details please see patch #1.
thanks,
jirka
---
Jiri Olsa (10):
uprobe: Add session callbacks to uprobe_consumer
bpf: Add support for uprobe multi session attach
bpf: Add support for uprobe multi session context
On Sun, Jun 02, 2024 at 10:52:43PM +0200, Jiri Olsa wrote:
> On Sun, Jun 02, 2024 at 12:09:50PM +0900, Masami Hiramatsu wrote:
> > On Thu, 30 May 2024 23:50:32 -0700
> > syzbot wrote:
> >
> > > Hello trace maintainers/developers,
> > >
> > &
On Sun, Jun 02, 2024 at 12:09:50PM +0900, Masami Hiramatsu wrote:
> On Thu, 30 May 2024 23:50:32 -0700
> syzbot wrote:
>
> > Hello trace maintainers/developers,
> >
> > This is a 31-day syzbot report for the trace subsystem.
> > All related reports/information can be found at:
> > https://syzkal
Adding man page for new uretprobe syscall.
Reviewed-by: Alejandro Colomar
Signed-off-by: Jiri Olsa
---
man/man2/uretprobe.2 | 56
1 file changed, 56 insertions(+)
create mode 100644 man/man2/uretprobe.2
diff --git a/man/man2/uretprobe.2 b/man/man2
Adding uretprobe shadow stack test that runs all existing
uretprobe tests with shadow stack enabled if it's available.
Signed-off-by: Jiri Olsa
---
.../selftests/bpf/prog_tests/uprobe_syscall.c | 60 +++
1 file changed, 60 insertions(+)
diff --git a/tools/testing/selftest
Adding test to verify that when called from outside of the
trampoline provided by kernel, the uretprobe syscall will cause
calling process to receive SIGILL signal and the attached bpf
program is not executed.
Acked-by: Andrii Nakryiko
Reviewed-by: Masami Hiramatsu (Google)
Signed-off-by: Jiri
syscall trampoline and which are later checked in the test.
Acked-by: Andrii Nakryiko
Reviewed-by: Masami Hiramatsu (Google)
Signed-off-by: Jiri Olsa
---
.../selftests/bpf/bpf_testmod/bpf_testmod.c | 123 +-
.../selftests/bpf/prog_tests/uprobe_syscall.c | 67 ++
2 files
Add uretprobe syscall test that compares register values before
and after the uretprobe is hit. It also compares the register
values seen from attached bpf program.
Acked-by: Andrii Nakryiko
Reviewed-by: Masami Hiramatsu (Google)
Signed-off-by: Jiri Olsa
---
tools/include/linux/compiler.h
Adding return uprobe test for shadow stack and making sure it's
working properly. Borrowed some of the code from bpf selftests.
Signed-off-by: Jiri Olsa
---
.../testing/selftests/x86/test_shadow_stack.c | 145 ++
1 file changed, 145 insertions(+)
diff --git a/tools/te
Andrii Nakryiko
Reviewed-by: Oleg Nesterov
Reviewed-by: Masami Hiramatsu (Google)
Acked-by: Andrii Nakryiko
Signed-off-by: Oleg Nesterov
Signed-off-by: Jiri Olsa
---
arch/x86/include/asm/shstk.h | 2 +
arch/x86/kernel/shstk.c | 5 ++
arch/x86/kernel/uprobes.c| 117 +++
Hiramatsu (Google)
Acked-by: Andrii Nakryiko
Signed-off-by: Jiri Olsa
---
arch/x86/entry/syscalls/syscall_64.tbl | 1 +
include/linux/syscalls.h | 2 ++
include/uapi/asm-generic/unistd.h | 5 -
kernel/sys_ni.c| 2 ++
4 files changed, 9 insertions(+), 1
probe code to keep shadow stack in sync with uretprobe
changes to user stack.
Reviewed-by: Oleg Nesterov
Fixes: 488af8ea7131 ("x86/shstk: Wire in shadow stack interface")
Signed-off-by: Jiri Olsa
---
arch/x86/include/asm/shstk.h | 2 ++
arch/x86/kernel/shstk.c | 11 +++
w bpf selftests and ran ltp on top of this change.
- Man Page
Attached.
- Do not call System Calls in the Kernel
N/A.
[0] https://lore.kernel.org/bpf/ZeCXHKJ--iYYbmLj@krava/
---
Jiri Olsa (8):
x86/shstk: Make return uprobe work with shadow stack
uprobe: Wire up uretprobe system ca
1 - 100 of 3055 matches
Mail list logo