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]
Date:   Tue, 27 Jun 2023 12:33:02 -0700
From:   Namhyung Kim <namhyung@...nel.org>
To:     Jiri Olsa <olsajiri@...il.com>
Cc:     Arnaldo Carvalho de Melo <acme@...nel.org>,
        lkml <linux-kernel@...r.kernel.org>,
        Peter Zijlstra <a.p.zijlstra@...llo.nl>,
        Ingo Molnar <mingo@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Ian Rogers <irogers@...gle.com>,
        Adrian Hunter <adrian.hunter@...el.com>,
        linux-perf-users@...r.kernel.org
Subject: Re: [PATCH] perf tools: Add missing else to cmd_daemon subcommand condition

On Tue, Jun 27, 2023 at 1:35 AM Jiri Olsa <olsajiri@...il.com> wrote:
>
> On Mon, Jun 26, 2023 at 01:58:48PM -0700, Namhyung Kim wrote:
> > Hi Jiri,
> >
> > On Mon, Jun 26, 2023 at 1:16 PM Jiri Olsa <jolsa@...nel.org> wrote:
> > >
> > > Namhyung reported segfault in perf daemon start command.
> > >
> > > It's caused by extra check on argv[0] which is set to NULL by previous
> > > __cmd_start call. Adding missing else to skip the extra check.
> > >
> > > Fixes: 92294b906e6c ("perf daemon: Dynamically allocate path to perf")
> > > Reported-by: Namhyung Kim <namhyung@...nel.org>
> > > Signed-off-by: Jiri Olsa <jolsa@...nel.org>
> >
> > Thanks for the fix.  Now it runs ok.
> >
> > Before:
> >   $ sudo ./perf test -v daemon
> >    85: daemon operations                                               :
> >   --- start ---
> >   test child forked, pid 82420
> >   test daemon list
> >   ./tests/shell/daemon.sh: line 133: 82426 Segmentation fault
> > perf daemon start --config ${config}
> >   test daemon reconfig
> >   ./tests/shell/daemon.sh: line 133: 82520 Segmentation fault
> > perf daemon start --config ${config}
> >   test daemon stop
> >   ./tests/shell/daemon.sh: line 133: 82636 Segmentation fault
> > perf daemon start --config ${config}
> >   test daemon signal
> >   ./tests/shell/daemon.sh: line 133: 82674 Segmentation fault
> > perf daemon start --config ${config}
> >   signal 12 sent to session 'test [82676]'
> >   signal 12 sent to session 'test [82676]'
> >   test daemon ping
> >   ./tests/shell/daemon.sh: line 133: 82702 Segmentation fault
> > perf daemon start --config ${config}
> >   test daemon lock
> >   ./tests/shell/daemon.sh: line 133: 82734 Segmentation fault
> > perf daemon start --config ${config}
> >   test child finished with 0
> >   ---- end ----
> >   daemon operations: Ok
> >
> > Maybe we need to investigate more why it was ok..
> > But at least I don't see segfaults anymore
>
> yea, for some reason parse_options would put NULL into argv[0]
>
> I'll try to check what changed, in any case the fix makes the
> condition alligned with the other legs and fixes the segfault

Yep, thanks for checking.

In the meantime, Thomas Richter reported the same problem and
fix.  I'll take yours but leave it for the record.

  http://lore.kernel.org/r/20230627092633.2135105-1-tmricht@linux.ibm.com

Applied to perf-tools-next, thanks!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ