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]
Date:	Fri, 3 Jun 2011 17:54:40 -0400 (EDT)
From:	Vince Weaver <vweaver1@...s.utk.edu>
To:	Ingo Molnar <mingo@...e.hu>
cc:	David Ahern <dsahern@...il.com>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	linux-kernel@...r.kernel.org, paulus@...ba.org, acme@...hat.com
Subject: [patch] perf - comment /proc/sys/kernel/perf_event_paranoid to be
 part of user ABI 

On Tue, 24 May 2011, Ingo Molnar wrote:

> I agree with Vince that as far as shell scripts are concerned, checking 
> /proc/sys/kernel/perf_event_paranoid would work best - and it works better than 
> having to check the perf syscall.
> 
> Vince: mind sending a patch that adds a comment to perf_event_paranoid that 
> userspace relies on the existence of that file as a feature check? Having such 
> reminders in the code works even better than frequent testing ;-)

Such a patch is included below.  Not sure if this is exactly what you 
meant.

> As far as the actual PAPI library goes i really hope it checks the syscall 
> itself: that's much faster and more robust than an 
> access("/proc/sys/kernel/perf_event_paranoid") call ...

For PAPI itself we decide with substrate to use at compile time.
This casme up because one of the vendors who ships PAPI on various kernel 
revisions had a script to choose the right package to install, and as of 
2.6.37 this broke due to /sys/devices/system/cpu/perf_events going away.

Thanks,

Vince
vweaver1@...s.utk.edu

Signed-off-by: Vince Weaver <vweaver1@...s.utk.edu>

diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 4fc9244..cbdc7bc 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -938,6 +938,8 @@ static struct ctl_table kern_table[] = {
 	},
 #endif
 #ifdef CONFIG_PERF_EVENTS
+	/* Userspace relies on this file existing as a check for */
+	/* perf_events being enabled.  Do not remove!            */
 	{
 		.procname	= "perf_event_paranoid",
 		.data		= &sysctl_perf_event_paranoid,
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ