aboutsummaryrefslogtreecommitdiff
path: root/lib/test-string_helpers.c
diff options
context:
space:
mode:
authorMark Rutland <[email protected]>2023-12-15 11:24:50 +0000
committerPeter Zijlstra <[email protected]>2023-12-15 12:33:23 +0100
commit7e2c1e4b34f07d9aa8937fab88359d4a0fce468e (patch)
tree3fe66c682b97c9107d8e20883053231ad922a0d9 /lib/test-string_helpers.c
parenta39b6ac3781d46ba18193c9dbb2110f31e9bffe9 (diff)
perf: Fix perf_event_validate_size() lockdep splat
When lockdep is enabled, the for_each_sibling_event(sibling, event) macro checks that event->ctx->mutex is held. When creating a new group leader event, we call perf_event_validate_size() on a partially initialized event where event->ctx is NULL, and so when for_each_sibling_event() attempts to check event->ctx->mutex, we get a splat, as reported by Lucas De Marchi: WARNING: CPU: 8 PID: 1471 at kernel/events/core.c:1950 __do_sys_perf_event_open+0xf37/0x1080 This only happens for a new event which is its own group_leader, and in this case there cannot be any sibling events. Thus it's safe to skip the check for siblings, which avoids having to make invasive and ugly changes to for_each_sibling_event(). Avoid the splat by bailing out early when the new event is its own group_leader. Fixes: 382c27f4ed28f803 ("perf: Fix perf_event_validate_size()") Closes: https://lore.kernel.org/lkml/[email protected]/ Closes: https://lore.kernel.org/lkml/ZXpm6gQ%[email protected]/ Reported-by: Lucas De Marchi <[email protected]> Reported-by: Pengfei Xu <[email protected]> Signed-off-by: Mark Rutland <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
Diffstat (limited to 'lib/test-string_helpers.c')
0 files changed, 0 insertions, 0 deletions