On 9/30/25 3:16 PM, Alistair Popple wrote:
> +impl GspRpcHeader {
> +    pub(crate) fn new(cmd_size: u32, function: u32) -> Self {
> +        Self(bindings::rpc_message_header_v {
> +            // TODO: magic number
> +            header_version: 0x03000000,
> +            signature: bindings::NV_VGPU_MSG_SIGNATURE_VALID,
> +            function,
> +            // We don't ever expect to send a command large enough to 
> overflow.
> +            length: (size_of::<Self>() as 
> u32).checked_add(cmd_size).unwrap(),

This is pretty much equivalent to "we never expect to make any mistakes, hence
just crash the kernel". Please handle errors gracefully.

Reply via email to