Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf_event_uncore doesn't consider capabilities #200

Open
voidbert opened this issue Jun 28, 2024 · 0 comments · May be fixed by #201
Open

perf_event_uncore doesn't consider capabilities #200

voidbert opened this issue Jun 28, 2024 · 0 comments · May be fixed by #201
Assignees

Comments

@voidbert
Copy link

The perf_event_uncore component checks if the user has permissions for reading uncore counters before trying to do so. It does so by running the this code, abridged below:

// read /proc/sys/kernel/perf_event_paranoid
// ...

if ((paranoid_level>0) && (getuid()!=0)) {
    // fail due to lack of permissions
}

// Success

However, checking for root is too strong of a check, as it's possible for a regular user to be able to read counters even with perf_event_paranoid > 0. To achieve that, the current thread must have one of the following capabilities: CAP_SYS_ADMIN or CAP_PERFMON.

@voidbert voidbert linked a pull request Jun 28, 2024 that will close this issue
3 tasks
@Treece-Burgess Treece-Burgess linked a pull request Sep 28, 2024 that will close this issue
3 tasks
@Treece-Burgess Treece-Burgess self-assigned this Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants