cuda.core: validate IPC descriptor lengths before import (Glasswing V2.1/V7.1)#2223
Merged
Andy-Jost merged 2 commits intoJun 15, 2026
Merged
Conversation
Reject truncated buffer and event IPC descriptors before memcpy or deviceptr_import_ipc can read past the peer-supplied payload (Glasswing V2.1 / V7.1, NVBugs 6268888 / 6268898).
This was referenced Jun 15, 2026
This comment has been minimized.
This comment has been minimized.
mdboom
approved these changes
Jun 15, 2026
Resolve test_errors.py conflict: keep both truncated-descriptor and negative-fd rejection tests.
This comment has been minimized.
This comment has been minimized.
1 similar comment
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Addresses two related Glasswing IPC import findings: peer-supplied descriptor payloads shorter than the driver struct size could be read past bounds during buffer pointer import or event-handle memcpy.
Changes
cuda_core/cuda/core/_memory/_ipc.pyx: rejectIPCBufferDescriptorpayloads smaller thansizeof(CUmemPoolPtrExportData)beforedeviceptr_import_ipc(V2.1)cuda_core/cuda/core/_event.pyx: rejectIPCEventDescriptorreserved fields smaller thansizeof(CUipcEventHandle)beforememcpy(V7.1)cuda_core/tests/memory_ipc/test_errors.py:test_import_truncated_buffer_descriptorcuda_core/tests/test_event.py:test_import_truncated_event_descriptorTest Coverage
ValueErrorbefore driver import (IPC fixture)ValueErrorbefore memcpy (no GPU required)Related Work