Thank you for your contribution! Sashiko AI review found 2 potential issue(s) 
to consider:

New issues:
- [Low] The import modification violates the Rust vertical import style 
guideline by omitting a trailing comma.

Pre-existing issues:
- [High] The size field of the GSP registry table is incorrectly initialized, 
missing the base structure's size.
--

commit 6004d87646aa24143dd922fea1595d59bd5bbcb7
Author: Pedro Yudi Honda <[email protected]>

drm/nova: remove unused trait in commands.rs

This commit removes the unused transmute::FromBytes implementation and its
import in drivers/gpu/nova-core/gsp/commands.rs.

> diff --git a/drivers/gpu/nova-core/gsp/commands.rs 
> b/drivers/gpu/nova-core/gsp/commands.rs
> index f84de9f4f0450..a3c0b7fa3b9ed 100644
> --- a/drivers/gpu/nova-core/gsp/commands.rs
> +++ b/drivers/gpu/nova-core/gsp/commands.rs
> @@ -12,10 +12,7 @@
>      device,
>      pci,
>      prelude::*,
> -    transmute::{
> -        AsBytes,
> -        FromBytes, //
> -    }, //
> +    transmute::AsBytes//

[Severity: Low]
Does this modification violate the Rust vertical import style guideline by
omitting a trailing comma?

[ ... ]

This is a pre-existing issue, but I noticed a potential problem in
SetRegistry::init() in this same file:

drivers/gpu/nova-core/gsp/commands.rs:SetRegistry::init() {
    ...
    fn init(&self) -> impl Init<Self::Command, Self::InitError> {
        Self::Command::init(Self::NUM_ENTRIES as u32, 
self.variable_payload_len() as u32)
    }
    ...
}

[Severity: High]
Is the size field of the GSP registry table incorrectly initialized here by
omitting the base structure's size? 

Since the table size provided to the GSP firmware only accounts for the
variable payload and omits the table's header size, the string offsets
computed for the registry keys will mathematically exceed the declared table
size. 

Will the firmware reject the command due to an apparent out-of-bounds access,
potentially causing driver bring-up to fail entirely?

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/[email protected]?part=7

Reply via email to