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:   Wed, 13 Dec 2023 17:00:40 +0530
From:   Naveen N Rao <naveen@...nel.org>
To:     Masami Hiramatsu <mhiramat@...nel.org>
Cc:     linux-kselftest@...r.kernel.org, linux-kernel@...r.kernel.org,
        Steven Rostedt <rostedt@...dmis.org>,
        Shuah Khan <shuah@...nel.org>,
        Michael Ellerman <mpe@...erman.id.au>
Subject: Re: [PATCH] selftests/ftrace: Add test to exercize function tracer
 across cpu hotplug

On Wed, Dec 13, 2023 at 09:40:38AM +0900, Masami Hiramatsu wrote:
> Hi Naveen,
> 
> On Tue, 12 Dec 2023 14:26:07 +0530
> Naveen N Rao <naveen@...nel.org> wrote:
> 
> > Add a test to exercize cpu hotplug with the function tracer active to
> > ensure that sensitive functions in idle path are excluded from being
> > traced. This helps catch issues such as the one fixed by commit
> > 4b3338aaa74d ("powerpc/ftrace: Fix stack teardown in ftrace_no_trace").
> > 
> > Signed-off-by: Naveen N Rao <naveen@...nel.org>
> > ---
> >  .../ftrace/test.d/ftrace/func_hotplug.tc      | 30 +++++++++++++++++++
> >  1 file changed, 30 insertions(+)
> >  create mode 100644 tools/testing/selftests/ftrace/test.d/ftrace/func_hotplug.tc
> > 
> > diff --git a/tools/testing/selftests/ftrace/test.d/ftrace/func_hotplug.tc b/tools/testing/selftests/ftrace/test.d/ftrace/func_hotplug.tc
> > new file mode 100644
> > index 000000000000..49731a2b5c23
> > --- /dev/null
> > +++ b/tools/testing/selftests/ftrace/test.d/ftrace/func_hotplug.tc
> > @@ -0,0 +1,30 @@
> > +#!/bin/sh
> > +# SPDX-License-Identifier: GPL-2.0
> > +# description: ftrace - function trace across cpu hotplug
> > +# requires: function:tracer
> > +
> > +if ! which nproc ; then
> > +  nproc() {
> > +    ls -d /sys/devices/system/cpu/cpu[0-9]* | wc -l
> > +  }
> > +fi
> > +
> > +NP=`nproc`
> > +
> > +if [ $NP -eq 1 ] ;then
> > +  echo "We can not test cpu hotplug in UP environment"
> > +  exit_unresolved
> > +fi
> 
> This looks good, but can you find the 2nd online CPU before
> this test?
> I mean, there is a case that cpu1 is already offlined and others
> like cpu2 is onlined. So we need to use the 2nd online cpu.

Good point, thanks. I will send a v2.

- Naveen

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ