← Back to Pull requests

UCT/ZE/IPC: Allow peers to import IPC handles without CMA #12441

Closed
unknown closed this pull request without merging on Nov 25, 2026 11:52 UTC
View on GitHub
unknown unknown commented on Nov 23, 2026 17:28 UTC
Author

What?


Call ucs_sys_ptrace_enable_peers() from uct_ze_ipc_md_open(), and add a regression test.

Follow-up to #12165, which did the same for cuda_ipc.

Why?


A ze_ipc importer duplicates the exporter's dma-buf fd with pidfd_getfd(), which must pass the ptrace access check against the exporter. Under Yama ptrace_scope 1, a peer on the same node that is not an ancestor of the exporter passes only if the exporter called prctl(PR_SET_PTRACER), or if the peer has CAP_SYS_PTRACE. Before this change, ze_ipc did not grant the
exception itself. CMA can grant it during resource discovery, but if no applicable exception is in place, an unprivileged peer can get EPERM from pidfd_getfd() and the import fails. ze_ipc has no fallback for a failed import: UCT put/get return an error. In our UCP tag_bw run over ze_ipc, the rendezvous then did not complete and both sides waited until the timeout.

How?


  • Call the helper in md_open, the same as cuda_ipc and CMA, guarded by SYS_pidfd_open and SYS_pidfd_getfd, like the import path.

  • The exception is process-wide. Under Yama ptrace_scope=1, PR_SET_PTRACER_ANY removes Yama's ancestry restriction for otherwise permitted callers, not just UCX peers. Closing the MD does not restore the previous setting. UCP opens every MD before it filters UCX_TLS, so excluding ze_ipc from UCX_TLS does not prevent this call. UCX_MODULES=^ze suppresses this ZE call, but CMA can still grant the same process-wide exception: it sets it while querying its resources, regardless of UCX_TLS.

  • The cross-process tests (test_ze_ipc_rma_xproc) now clear the exporter's ptracer exception before it opens the ze_ipc MD. This drops grants made earlier, e.g. by the CMA resource query. The importer, an exec'd child of the exporter, then takes the fds with pidfd_getfd() through the real import path on its first PUT. The reset accepts EINVAL, which means Yama is not loaded. If another library in the process grants the exception while the MD opens, the tests also pass without the fix.
  • For the comparison below, Yama ptrace_scope was 1, CAP_SYS_PTRACE was dropped, and no exception granted by another component was in effect when access was checked.

    On B60 and B70, test_ze_ipc_rma_xproc.put_get failed without the fix, with pidfd_getfd() returning EPERM in the importer, and passed with it, including with CMA disabled. The other three cross-process tests behaved the same. Separately, on B60 and B70 with CMA disabled, UCT put/get and UCP tag_bw over ze_ipc failed without the fix and passed with it.

    The ZE gtest suite completed successfully on B60 and B70: 63 cases per run, 9 of them skipped.

    Diff: 335 lines (+251 / -84) across 4 files Reviewer: tvegas1 Review duration: 2544m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.42) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.42 · 335 lines diff across 4 files
    0.42
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.348
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #12441"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 42.2% (MEDIUM) · Higher = larger blast radius
    42.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 16.7% · Safe to merge
    16.7%
    Repository