Skip to content

cuda.core: validate IPC buffer import size against mapped extent (Glasswing V2.2)#2224

Open
Andy-Jost wants to merge 1 commit into
NVIDIA:mainfrom
Andy-Jost:ajost/glasswing-v2-2-ipc-size-vs-extent
Open

cuda.core: validate IPC buffer import size against mapped extent (Glasswing V2.2)#2224
Andy-Jost wants to merge 1 commit into
NVIDIA:mainfrom
Andy-Jost:ajost/glasswing-v2-2-ipc-size-vs-extent

Conversation

@Andy-Jost

Copy link
Copy Markdown
Contributor

Summary

Addresses Glasswing finding V2.2 (NVBUG 6268889): a peer-supplied IPCBufferDescriptor.size was trusted as buf._size and used as the cuMemcpyAsync length without checking against the actual mapped allocation extent, enabling an oversized device copy when the receiver imported and copied a forged descriptor.

Changes

  • cuda_core/cuda/core/_memory/_ipc.pyx: after deviceptr_import_ipc, query CU_POINTER_ATTRIBUTE_RANGE_SIZE on the imported pointer and reject descriptors whose advertised size exceeds the mapped extent before calling Buffer_from_deviceptr_handle
  • cuda_core/tests/memory_ipc/test_errors.py: TestImportOversizedBufferDescriptorSize — cross-process harness that forges an oversized size on a valid export payload and asserts import raises ValueError

Test Coverage

  • TestImportOversizedBufferDescriptorSize — peer forges oversized size on a valid 64-byte export blob; child import raises ValueError (DeviceMR and PinnedMR parametrizations)

Related Work

Reject peer-supplied IPCBufferDescriptor sizes larger than the driver-reported
allocation extent before storing buf._size, preventing oversized cuMemcpyAsync
lengths on imported buffers (Glasswing V2.2).
@Andy-Jost Andy-Jost added this to the cuda.core v1.1.0 milestone Jun 15, 2026
@Andy-Jost Andy-Jost added bug Something isn't working P1 Medium priority - Should do cuda.core Everything related to the cuda.core module labels Jun 15, 2026
@Andy-Jost Andy-Jost self-assigned this Jun 15, 2026
@Andy-Jost Andy-Jost requested a review from rwgk June 15, 2026 19:03
@github-actions

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working cuda.core Everything related to the cuda.core module P1 Medium priority - Should do

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants