Skip to content

fix(vsock): remove redundant buffer check - #1019

Merged
sgrams merged 1 commit into
intel:mainfrom
mpojmaj:fix/remove_redundant_buffer_check
Sep 1, 2026
Merged

fix(vsock): remove redundant buffer check#1019
sgrams merged 1 commit into
intel:mainfrom
mpojmaj:fix/remove_redundant_buffer_check

Conversation

@mpojmaj

@mpojmaj mpojmaj commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Drop the check from Packet::check and rely on the existing check in recv_packet_connected, which already validates the payload against the buffer it was read into

if packet.data_len() as usize <= recv.len() {
recv.truncate(packet.data_len() as usize);
} else {
return Err(VsockError::Illegal);
}

This is the real trust boundary; the protocol.rs addition is redundant as well as incorrect for the split header/payload path.

@mpojmaj
mpojmaj requested review from jyao1 and sgrams as code owners September 1, 2026 10:49
Signed-off-by: Pojmaj, Marcin <marcin.pojmaj@intel.com>
@mpojmaj
mpojmaj force-pushed the fix/remove_redundant_buffer_check branch from 283c2f6 to d1e2f6c Compare September 1, 2026 11:41
@sgrams
sgrams merged commit 56461b7 into intel:main Sep 1, 2026
61 checks passed
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.

2 participants