LWN: Comments on "Disallowing perf_event_open()" https://lwn.net/Articles/696216/ This is a special feed containing comments posted to the individual LWN article titled "Disallowing perf_event_open()". en-us Sun, 02 Nov 2025 12:33:33 +0000 Sun, 02 Nov 2025 12:33:33 +0000 https://www.rssboard.org/rss-specification lwn@lwn.net Disallowing perf_event_open() https://lwn.net/Articles/697225/ https://lwn.net/Articles/697225/ MarcB <div class="FormattedComment"> Somehow, I get the impression some kernel developers have disconnected from reality. Or maybe live in a different one, that consists only of developer workstations, back-end systems and maybe super-computing. Obviously, perf is always fine and useful in this reality.<br> <p> However, there is a significant, other reality that has nasty places like regular end user devices (usually called "smartp hones") or even shared hosting environments.<br> <p> The latter ones face malicious code and malicious, local users on a daily basis. The operating system running them needs to cope with this or it is simply unfit for this purpose.<br> Nowadays, mainline Linux *is* unfit for such environments - and the unavoidable perf is a major reason for this.<br> <p> Now, if this were about removing perf from the kernel, I could understand the opposition. But it is simply about giving the option to disable it. Arguing that "bugs will be fixed" is irrelevant: The risk is still increased. Arguing that administrators are clueless is hubris: Experienced administrators are lazy. If the default configuration works for them, they stick with it. If they change it - or even start patching the kernel - there must be a very good reason and kernel developer would be well-advised to try to understand it.<br> </div> Mon, 15 Aug 2016 13:41:31 +0000 Disallowing perf_event_open() https://lwn.net/Articles/696806/ https://lwn.net/Articles/696806/ deater <div class="FormattedComment"> For those keeping track, I ran the perf_fuzzer on a Haswell machine running 4.8-rc1.<br> <p> The bug mentioned previously that quickly locked the machine turns out to be a known bug (found with trinity a few weeks ago) with a working patch that hasn't hit upstream yet. Once I patched for the bug I let perf_fuzzer run again.<br> <p> It lasted 6 hours before completely crashing. Along the way it found:<br> <p> 2 known WARNings<br> 2 new WARNings<br> 3 gpf/slab poisoning warnings<br> <p> and then it finally crashed hard.<br> <p> </div> Tue, 09 Aug 2016 15:34:08 +0000 Disallowing perf_event_open() https://lwn.net/Articles/696666/ https://lwn.net/Articles/696666/ deater And it turns out that 4.8-rc1 falls over even more quickly than normal with the perf_fuzzer.<p> The fun part is that the serial console only manages to print<br> <tt>[163405.758086] BUG: unable to handle kernel</tt><br> before completely locking up.<p> I'll try reporting this to linux-kernel, but the reports are usually ignored and the deep seated problems the fuzzer is tickling are a bit out of my league to track down. Mon, 08 Aug 2016 15:09:36 +0000 Disallowing perf_event_open() https://lwn.net/Articles/696607/ https://lwn.net/Articles/696607/ spender <div class="FormattedComment"> I like that we have two comments now in this thread alone demonstrating how people have no problem at all with the serious security side-effects of the coarseness of the toggle in the other direction, yet all the complaints are focused on the mere option of an additional, more secure setting. When you consider that even CONFIG_NET can be disabled, but PERF_EVENTS cannot, it's obvious that all the pushback has to do with an arch maintainer also being the maintainer of a pet project he wants to force on everyone, spending more time on adding new bells and whistles and not on (for instance) fixing known issues deater has been talking about here for years now exposed by simple fuzzing, meanwhile offering users no way to mitigate those issues.<br> <p> -Brad<br> </div> Sat, 06 Aug 2016 18:06:05 +0000 Disallowing perf_event_open() https://lwn.net/Articles/696606/ https://lwn.net/Articles/696606/ anton I run stable, and I find that the default restrictions of perf are broken for my uses, so I have this nice line in /etc/rc.local: <pre> echo 0 &gt;/proc/sys/kernel/perf_event_paranoid </pre> Sat, 06 Aug 2016 17:35:18 +0000 Disallowing perf_event_open() https://lwn.net/Articles/696476/ https://lwn.net/Articles/696476/ nybble41 <div class="FormattedComment"> <font class="QuotedText">&gt; …but I managed to write my first ever systemd init config to write a sensible value to /proc/sys/kernel/perf_event_paranoid on boot up…</font><br> <p> Why a systemd init config? Isn't this exactly why we have /etc/sysctl.conf and /etc/sysctl.d/?<br> <p> # echo "kernel.perf_event_paranoid = 0" &gt; /etc/sysctl.d/perf_events.conf<br> # update-initramfs -k all -u<br> </div> Fri, 05 Aug 2016 04:36:59 +0000 Disallowing perf_event_open() https://lwn.net/Articles/696472/ https://lwn.net/Articles/696472/ creemj <div class="FormattedComment"> I upgraded to testing two or three weeks ago and had to spend some time working out why my profiling code stopped working. It was a bit annoying to find that perf events was disabled in the kernel from scratch, but I managed to write my first ever systemd init config to write a sensible value to /proc/sys/kernel/perf_event_paranoid on boot up so that I wouldn't be pissed off every time I rebooted.<br> <p> The pain level has to be quite high before I would report a bug or issue back to Debian --- I hate the reportbug interface and find 'apt-get purge crappy-buggy-package' a much easier and quicker solution in most cases.<br> <p> I am wondering, however, whether there is a kernel option to change the default? That would be a neater solution.<br> <p> </div> Fri, 05 Aug 2016 00:57:59 +0000 Disallowing perf_event_open() https://lwn.net/Articles/696470/ https://lwn.net/Articles/696470/ deater <div class="FormattedComment"> <font class="QuotedText">&gt; or maybe because perf is not disabled by default on Debian.</font><br> <p> I always forget that most people do not run unstable.<br> <p> </div> Fri, 05 Aug 2016 00:17:21 +0000 Disallowing perf_event_open() https://lwn.net/Articles/696461/ https://lwn.net/Articles/696461/ ballombe <div class="FormattedComment"> <font class="QuotedText">&gt; (it hasn't started problems yet because most users aren't using Debian)</font><br> or maybe because perf is not disabled by default on Debian.<br> </div> Thu, 04 Aug 2016 22:51:35 +0000 Disallowing perf_event_open() https://lwn.net/Articles/696445/ https://lwn.net/Articles/696445/ nix <div class="FormattedComment"> Quite. That's not the only use case either. My firewall, in common with much semi-embedded hardware, has no useful PMUs and runs no software that would benefit (and even if it did, I frankly don't care if I break self-tuning JITs on a firewall: it's not doing anything else so the performance of things like that is of minimal interest). But as firewalls tend to be, it is network-exposed to hostile attackers and really should not have huge unused lumps of security-critical code on it at all, let alone exposed to unprivileged users.<br> <p> I have no idea why there isn't a config knob to compile perf out entirely. There surely should be. Not everything needs it; not everything can benefit; and those things that don't are purely harmed by its distinctly non-zero-sized vulnerability surface.<br> <p> </div> Thu, 04 Aug 2016 20:01:41 +0000 Disallowing perf_event_open() https://lwn.net/Articles/696329/ https://lwn.net/Articles/696329/ deater <div class="FormattedComment"> Any word on how the CVEs were found? Via a fuzzer or some other way? It is a bit annoying to find internal bugs in your own architectural driver and your solution is to disable a global interface for everyone.<br> <p> At the same time, the perf_fuzzer can still reliably crash any x86 machine within a few hours despite years of trying to get that fixed, so it probably is a good idea to provide a way to block the syscall.<br> <p> I see both sides of the issue here, as having perf_event disabled by default is really going to cause annoyance for high-performance computing users (it hasn't started problems yet because most users aren't using Debian). If you start requiring root or sysadmin action in order for perf to work, people are going to go back to skipping perf altogether for tools like LIKWID (they also usually require root or sysadmin intervention).<br> <p> <p> </div> Thu, 04 Aug 2016 12:52:09 +0000