Skip to content

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

Merged
againull merged 1 commit into
intel:syclfrom
againull:xpti_tp_data_race
Apr 27, 2026
Merged

[XPTI] Fix data races in tracepoint lookup and deletion#21874
againull merged 1 commit into
intel: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
@againull
Copy link
Copy Markdown
Contributor Author

CUDA failure is known:
SYCL :: KernelCompiler/sycl_device_globals.cpp
#20408
and supposed to be fixed by #21867

@againull againull merged commit 6a495e3 into intel:sycl Apr 27, 2026
43 of 46 checks passed
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.

2 participants