UCT/ZE/IPC: Allow peers to import IPC handles without CMA #12441
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
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
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
tvegas1
What?
Call
ucs_sys_ptrace_enable_peers()fromuct_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 Yamaptrace_scope1, a peer on the same node that is not an ancestor of the exporter passes only if the exporter calledprctl(PR_SET_PTRACER), or if the peer hasCAP_SYS_PTRACE. Before this change, ze_ipc did not grant theexception itself. CMA can grant it during resource discovery, but if no applicable exception is in place, an unprivileged peer can get
EPERMfrompidfd_getfd()and the import fails. ze_ipc has no fallback for a failed import: UCT put/get return an error. In our UCPtag_bwrun over ze_ipc, the rendezvous then did not complete and both sides waited until the timeout.How?
md_open, the same as cuda_ipc and CMA, guarded bySYS_pidfd_openandSYS_pidfd_getfd, like the import path.ptrace_scope=1,PR_SET_PTRACER_ANYremoves 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 filtersUCX_TLS, so excluding ze_ipc fromUCX_TLSdoes not prevent this call.UCX_MODULES=^zesuppresses this ZE call, but CMA can still grant the same process-wide exception: it sets it while querying its resources, regardless ofUCX_TLS.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 withpidfd_getfd()through the real import path on its first PUT. The reset acceptsEINVAL, 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_scopewas 1,CAP_SYS_PTRACEwas 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_getfailed without the fix, withpidfd_getfd()returningEPERMin 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 UCPtag_bwover 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.