Skip to content

[XPTI] Fix data races in tracepoint lookup and deletion#21874

Open
againull wants to merge 1 commit intointel:syclfrom
againull:xpti_tp_data_race
Open

[XPTI] Fix data races in tracepoint lookup and deletion#21874
againull wants to merge 1 commit intointel:syclfrom
againull:xpti_tp_data_race

Conversation

@againull
Copy link
Copy Markdown
Contributor

Several functions in the Tracepoints class accessed MUID64Check and dereferenced tracepoint pointers without holding MTracepointMutex, allowing use-after-free when concurrent threads perform lookups (xptiLookupEvent) and deletions (xptiDeleteTracepoint).

Fixes:

  • lookupEventData: acquire shared lock before MUID64Check access
  • releaseEvent: acquire exclusive lock before MUID64Check access (was only locked for the erase/delete, not the preceding check)
  • isValidUID64: acquire shared lock before MUID64Check access
  • deleteTracepoint: move TP->MUId read inside the exclusive lock
  • findEvent, queryPayloadByUID, lookupPayload: move into implemenation into new thread-safe Tracepoints methods

Several functions in the Tracepoints class accessed MUID64Check and
dereferenced tracepoint pointers without holding MTracepointMutex,
allowing use-after-free when concurrent threads perform lookups
(xptiLookupEvent) and deletions (xptiDeleteTracepoint).

Fixes:
- lookupEventData: acquire shared lock before MUID64Check access
- releaseEvent: acquire exclusive lock before MUID64Check access
  (was only locked for the erase/delete, not the preceding check)
- isValidUID64: acquire shared lock before MUID64Check access
- deleteTracepoint: move TP->MUId read inside the exclusive lock
- findEvent, queryPayloadByUID, lookupPayload: move into implemenation
  into new thread-safe Tracepoints methods
@againull againull requested a review from a team as a code owner April 24, 2026 23:36
@againull againull requested a review from cperkinsintel April 24, 2026 23:36
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 this pull request may close these issues.

1 participant