Skip to content

fix: guard GFD PCI vendor capability parsing against bad lengths - #1928

Open
amarkdotdev wants to merge 1 commit into
NVIDIA:mainfrom
amarkdotdev:fix/gfd-pci-vendor-capability-bounds-1891
Open

fix: guard GFD PCI vendor capability parsing against bad lengths#1928
amarkdotdev wants to merge 1 commit into
NVIDIA:mainfrom
amarkdotdev:fix/gfd-pci-vendor-capability-bounds-1891

Conversation

@amarkdotdev

Copy link
Copy Markdown

Fixes #1891

GFD was panicking on at least one H100 node when it walked a vendor-specific PCI capability with a length that runs past the end of the config buffer.

The fix checks the capability header and body fit inside the config before slicing. Bad entries are skipped like any other broken capability chain instead of crashing the pod.

Added a unit test with a malformed config that used to trigger the panic.

Testing

  • go test ./internal/vgpu/... -run TestGetVendorSpecificCapability

@copy-pr-bot

copy-pr-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

Validate capability header and body bounds before slicing config space
so malformed PCI data does not panic gpu-feature-discovery.

Signed-off-by: amarkdotdev <amarkdotdev@users.noreply.github.com>
@amarkdotdev
amarkdotdev force-pushed the fix/gfd-pci-vendor-capability-bounds-1891 branch from 40d7682 to 9abbec8 Compare July 27, 2026 20:29
@amarkdotdev

Copy link
Copy Markdown
Author

Hey, same ask here. Waiting on CI workflow approval / first-time contributor vetting if a maintainer can kick that off. Thanks!

@myeolenv

myeolenv commented Aug 1, 2026

Copy link
Copy Markdown

Thanks for the contribution. We will review this PR.

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.

[Bug]: gpu-feature-discovery panics in GetVendorSpecificCapability() on malformed PCI vendor capability length

2 participants