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: <0683D134-7465-46A8-A3FF-2E2D9131BB3D@gmail.com>
Date:   Tue, 16 Nov 2021 11:03:54 -0300
From:   Arnaldo Carvalho de Melo <arnaldo.melo@...il.com>
To:     Marco Elver <elver@...gle.com>,
        Arnaldo Carvalho de Melo <acme@...nel.org>
CC:     Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        Mark Rutland <mark.rutland@....com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Jiri Olsa <jolsa@...hat.com>,
        Namhyung Kim <namhyung@...nel.org>,
        Adrian Hunter <adrian.hunter@...el.com>,
        Fabian Hemmer <copy@...y.sh>, Ian Rogers <irogers@...gle.com>,
        linux-kernel@...r.kernel.org, linux-perf-users@...r.kernel.org,
        kasan-dev@...glegroups.com
Subject: Re: [PATCH] perf test: Add basic stress test for sigtrap handling



On November 16, 2021 10:57:33 AM GMT-03:00, Marco Elver <elver@...gle.com> wrote:
>On Tue, Nov 16, 2021 at 09:51AM -0300, Arnaldo Carvalho de Melo wrote:
>> Em Mon, Nov 15, 2021 at 12:28:23PM +0100, Marco Elver escreveu:
>> > Add basic stress test for sigtrap handling as a perf tool built-in test.
>> > This allows sanity checking the basic sigtrap functionality from within
>> > the perf tool.
>> 
>> Works as root:
>> 
>> [root@...e ~]# perf test sigtrap
>> 73: Sigtrap                                                         : Ok
>> [root@...e ~]
>> 
>> Not for !root:
>[...]
>> FAILED sys_perf_event_open(): Permission denied
>> test child finished with -1
>> ---- end ----
>> Sigtrap: FAILED!
>
>Ah, that shouldn't be the case. It's missing exclude_kernel/hv, and this
>test should work just fine as non-root. Please squash the below as well.
>Let me know if you'd like a v2.

I'll squash

>
>Ack for your change printing errors as well.
>
>Thanks,
>-- Marco
>
>------ >8 ------
>
>From: Marco Elver <elver@...gle.com>
>Date: Tue, 16 Nov 2021 14:52:18 +0100
>Subject: [PATCH] fixup! perf test: Add basic stress test for sigtrap handling
>
>Exclude kernel/hypervisor so the test can run as non-root.
>
>Signed-off-by: Marco Elver <elver@...gle.com>
>---
> tools/perf/tests/sigtrap.c | 2 ++
> 1 file changed, 2 insertions(+)
>
>diff --git a/tools/perf/tests/sigtrap.c b/tools/perf/tests/sigtrap.c
>index febfa1609356..e566f855bf74 100644
>--- a/tools/perf/tests/sigtrap.c
>+++ b/tools/perf/tests/sigtrap.c
>@@ -46,6 +46,8 @@ static struct perf_event_attr make_event_attr(void)
> 		.remove_on_exec = 1, /* Required by sigtrap. */
> 		.sigtrap	= 1, /* Request synchronous SIGTRAP on event. */
> 		.sig_data	= TEST_SIG_DATA,
>+		.exclude_kernel = 1,
>+		.exclude_hv	= 1,
> 	};
> 	return attr;
> }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ