lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZoWHXERaW8jgaJD_@krava>
Date: Wed, 3 Jul 2024 19:16:12 +0200
From: Jiri Olsa <olsajiri@...il.com>
To: Andrii Nakryiko <andrii.nakryiko@...il.com>
Cc: Oleg Nesterov <oleg@...hat.com>, Peter Zijlstra <peterz@...radead.org>,
	Alexei Starovoitov <ast@...nel.org>,
	Daniel Borkmann <daniel@...earbox.net>,
	Andrii Nakryiko <andrii@...nel.org>, bpf@...r.kernel.org,
	Martin KaFai Lau <kafai@...com>, Song Liu <songliubraving@...com>,
	Yonghong Song <yhs@...com>,
	John Fastabend <john.fastabend@...il.com>,
	KP Singh <kpsingh@...omium.org>,
	Stanislav Fomichev <sdf@...gle.com>, Hao Luo <haoluo@...gle.com>,
	Steven Rostedt <rostedt@...dmis.org>,
	Masami Hiramatsu <mhiramat@...nel.org>,
	linux-kernel@...r.kernel.org, linux-trace-kernel@...r.kernel.org
Subject: Re: [PATCHv2 bpf-next 8/9] selftests/bpf: Add uprobe session
 recursive test

On Tue, Jul 02, 2024 at 03:01:35PM -0700, Andrii Nakryiko wrote:
> On Mon, Jul 1, 2024 at 9:43 AM Jiri Olsa <jolsa@...nel.org> wrote:
> >
> > 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 <jolsa@...nel.org>
> > ---
> >  .../bpf/prog_tests/uprobe_multi_test.c        | 57 +++++++++++++++++++
> >  .../progs/uprobe_multi_session_recursive.c    | 44 ++++++++++++++
> >  2 files changed, 101 insertions(+)
> >  create mode 100644 tools/testing/selftests/bpf/progs/uprobe_multi_session_recursive.c
> >
> 
> Nice!
> 
> Acked-by: Andrii Nakryiko <andrii@...nel.org>
> 
> 
> [...]
> 
> > +static void test_session_recursive_skel_api(void)
> > +{
> > +       struct uprobe_multi_session_recursive *skel = NULL;
> > +       int i, err;
> > +
> > +       skel = uprobe_multi_session_recursive__open_and_load();
> > +       if (!ASSERT_OK_PTR(skel, "uprobe_multi_session_recursive__open_and_load"))
> > +               goto cleanup;
> > +
> > +       skel->bss->pid = getpid();
> > +
> > +       err = uprobe_multi_session_recursive__attach(skel);
> > +       if (!ASSERT_OK(err, "uprobe_multi_session_recursive__attach"))
> > +               goto cleanup;
> > +
> > +       for (i = 0; i < ARRAY_SIZE(skel->bss->test_uprobe_cookie_entry); i++)
> > +               skel->bss->test_uprobe_cookie_entry[i] = i + 1;
> > +
> > +       uprobe_session_recursive(5);
> > +
> > +       /*
> 
> nit: unnecessary empty comment line

ok

jirka

> 
> > +        *                                         entry uprobe:
> > +        * uprobe_session_recursive(5) {             *cookie = 1, return 0
> > +        *   uprobe_session_recursive(4) {           *cookie = 2, return 1
> > +        *     uprobe_session_recursive(3) {         *cookie = 3, return 0
> > +        *       uprobe_session_recursive(2) {       *cookie = 4, return 1
> > +        *         uprobe_session_recursive(1) {     *cookie = 5, return 0
> > +        *           uprobe_session_recursive(0) {   *cookie = 6, return 1
> > +        *                                          return uprobe:
> > +        *           } i = 0                          not executed
> > +        *         } i = 1                            test_uprobe_cookie_return[0] = 5
> > +        *       } i = 2                              not executed
> > +        *     } i = 3                                test_uprobe_cookie_return[1] = 3
> > +        *   } i = 4                                  not executed
> > +        * } i = 5                                    test_uprobe_cookie_return[2] = 1
> > +        */
> > +
> 
> [...]

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ