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] [day] [month] [year] [list]
Message-ID: <ZOXu0xq7fgwsZ5Co@kernel.org>
Date:   Wed, 23 Aug 2023 08:34:43 -0300
From:   Arnaldo Carvalho de Melo <acme@...nel.org>
To:     Namhyung Kim <namhyung@...nel.org>
Cc:     Jiri Olsa <jolsa@...nel.org>, Ian Rogers <irogers@...gle.com>,
        Adrian Hunter <adrian.hunter@...el.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...nel.org>,
        LKML <linux-kernel@...r.kernel.org>,
        linux-perf-users@...r.kernel.org,
        Athira Rajeev <atrajeev@...ux.vnet.ibm.com>
Subject: Re: [PATCH 2/2] perf test: Add perf record sample filtering test

Em Tue, Aug 22, 2023 at 05:50:26PM -0700, Namhyung Kim escreveu:
> Hi Arnaldo,
> 
> On Tue, Aug 15, 2023 at 10:42 AM Arnaldo Carvalho de Melo
> <acme@...nel.org> wrote:
> >
> > Em Tue, Aug 15, 2023 at 02:30:18PM -0300, Arnaldo Carvalho de Melo escreveu:
> > > Em Thu, Aug 10, 2023 at 07:58:22PM -0700, Namhyung Kim escreveu:
> > > >   $ sudo ./perf test 'sample filter' -v
> > > >    94: perf record sample filtering (by BPF) tests                     :
> > > >   --- start ---
> > > >   test child forked, pid 3817527
> > > >   Checking BPF-filter privilege
> > > >   Basic bpf-filter test
> > > >   Basic bpf-filter test [Success]
> > > >   Failing bpf-filter test
> > > >   Error: task-clock event does not have PERF_SAMPLE_CPU
> > > >   Failing bpf-filter test [Success]
> > > >   Group bpf-filter test
> > > >   Error: task-clock event does not have PERF_SAMPLE_CPU
> > > >   Error: task-clock event does not have PERF_SAMPLE_CODE_PAGE_SIZE
> > > >   Group bpf-filter test [Success]
> > > >   test child finished with 0
> > > >   ---- end ----
> > > >   perf record sample filtering (by BPF) tests: Ok
> > >
> > > [root@...e ~]# perf test -v "by BPF"
> > >  91: perf record sample filtering (by BPF) tests                     :
> > > --- start ---
> > > test child forked, pid 64165
> > > Checking BPF-filter privilege
> > > Basic bpf-filter test
> > >  ffffffff97f4f688
> > >  ffffffff97f73859
> > >  ffffffff97412ce6
> > >  ffffffff976da215
> > >  ffffffff973a92bf
> > >  ffffffff97376ad7
> > >  ffffffff97f73859
> > <SNIP
> > >  ffffffff971fdca5
> > >  ffffffff9737dbc4
> > >  ffffffff971b4e04
> > > Basic bpf-filter test [Failed invalid output]
> > > test child finished with -1
> > > ---- end ----
> > > perf record sample filtering (by BPF) tests: FAILED!
> > > [root@...e ~]#
> > >
> > > [root@...e ~]# uname -a
> > > Linux five 6.2.15-100.fc36.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 11 16:51:53 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
> > > [root@...e ~]#
> >
> > Above was on a AMD Ryzen 5950X, the following was on a lenovo t480s,
> > Intel notebook:
> 
> Thanks for the test.  I think it's a matter of the kernel version
> rather than the CPU vendor.  6.1 or before will fail the check
> in the beginning but 6.2 kernel lacks a feature to set sample
> flags for some fields and silently accept all samples.  IIRC it's
> added in v6.3.
> 
> Probably I need to add a version check in the error path.

Yeah, we need to do a wider testing of all things enabled
BUILD_BPF_SKEL=1, in more kernels, architectures, distributions.

Thanks for the feedback,

- Arnaldo

 
> Thanks,
> Namhyung
> 
> >
> > [root@...co ~]# uname -a
> > Linux quaco 6.4.7-200.fc38.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Jul 27 20:01:18 UTC 2023 x86_64 GNU/Linux
> > [root@...co ~]# perf test "filter"
> >  30: Filter hist entries                                             : Ok
> >  36: Filter fds with revents mask in a fdarray                       : Ok
> >  67: dlfilter C API                                                  : Ok
> >  91: perf record sample filtering (by BPF) tests                     : Ok
> > [root@...co ~]# perf test -v "by BPF"
> >  91: perf record sample filtering (by BPF) tests                     :
> > --- start ---
> > test child forked, pid 273609
> > Checking BPF-filter privilege
> > Basic bpf-filter test
> > Basic bpf-filter test [Success]
> > Failing bpf-filter test
> > Error: task-clock event does not have PERF_SAMPLE_CPU
> > Failing bpf-filter test [Success]
> > Group bpf-filter test
> > Error: task-clock event does not have PERF_SAMPLE_CPU
> > Error: task-clock event does not have PERF_SAMPLE_CODE_PAGE_SIZE
> > Group bpf-filter test [Success]
> > test child finished with 0
> > ---- end ----
> > perf record sample filtering (by BPF) tests: Ok
> > [root@...co ~]#

-- 

- Arnaldo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ