-
Notifications
You must be signed in to change notification settings - Fork 811
Description
Recommendations from report.
Consider using a safer abstraction for deserializing scalar values from buffers
that encapsulates the size check. A templated helper function that reads exactly
sizeof(T) bytes and fails if insufficient data is available would eliminate the possibility of
introducing similar vulnerabilities in future code paths handling external data.
Implement comprehensive input validation for all fields in .pte files during
deserialization, before any memory operations are performed. Add range checks that
reject invalid values, such as offsets near SIZE_MAX or sizes exceeding reasonable model
data limits.
Implement validation at the PTE parsing layer to reject tensor specifications with
dimensions that would cause overflow when computing byte sizes. Additionally, modify the
torch::executor::HierarchicalAllocator::get_offset_address validation to
reject size_bytes = 0 for tensors with numel > 0, as this combination indicates a
calculation error.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status