Skip to content

Commit a1639ce

Browse files
committed
Merge tag 'perf_urgent_for_v6.16_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull perf fixes from Borislav Petkov: - Revert uprobes to using CAP_SYS_ADMIN again as currently they can destructively modify kernel code from an unprivileged process - Move a warning to where it belongs * tag 'perf_urgent_for_v6.16_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf: Revert to requiring CAP_SYS_ADMIN for uprobes perf/core: Fix the WARN_ON_ONCE is out of lock protected region
2 parents 5fc2e89 + ba677db commit a1639ce

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

kernel/events/core.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -951,8 +951,6 @@ static void perf_cgroup_switch(struct task_struct *task)
951951
if (READ_ONCE(cpuctx->cgrp) == NULL)
952952
return;
953953

954-
WARN_ON_ONCE(cpuctx->ctx.nr_cgroups == 0);
955-
956954
cgrp = perf_cgroup_from_task(task, NULL);
957955
if (READ_ONCE(cpuctx->cgrp) == cgrp)
958956
return;
@@ -964,6 +962,8 @@ static void perf_cgroup_switch(struct task_struct *task)
964962
if (READ_ONCE(cpuctx->cgrp) == NULL)
965963
return;
966964

965+
WARN_ON_ONCE(cpuctx->ctx.nr_cgroups == 0);
966+
967967
perf_ctx_disable(&cpuctx->ctx, true);
968968

969969
ctx_sched_out(&cpuctx->ctx, NULL, EVENT_ALL|EVENT_CGROUP);
@@ -11116,7 +11116,7 @@ static int perf_uprobe_event_init(struct perf_event *event)
1111611116
if (event->attr.type != perf_uprobe.type)
1111711117
return -ENOENT;
1111811118

11119-
if (!perfmon_capable())
11119+
if (!capable(CAP_SYS_ADMIN))
1112011120
return -EACCES;
1112111121

1112211122
/*

0 commit comments

Comments
 (0)