Commit 14ae91a8 authored by Rhys Lloyd's avatar Rhys Lloyd Committed by Alexandre Courbot
Browse files

gpu: nova-core: fix bounds check in PmuLookupTableEntry::new



data is sliced from 2..6, but the bounds check data.len() < 5
does not satisfy those bounds.

Fixes: 47c4846e ("gpu: nova-core: vbios: Add support for FWSEC ucode extraction")
Reviewed-by: default avatarAlexandre Courbot <acourbot@nvidia.com>
Reviewed-by: default avatarJoel Fernandes <joelagnelf@nvidia.com>
Signed-off-by: default avatarRhys Lloyd <krakow20@gmail.com>
Link: https://lore.kernel.org/r/20250713025108.9364-2-krakow20@gmail.com


Signed-off-by: default avatarAlexandre Courbot <acourbot@nvidia.com>
parent 215a3f91
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -901,7 +901,7 @@ struct PmuLookupTableEntry {

impl PmuLookupTableEntry {
    fn new(data: &[u8]) -> Result<Self> {
        if data.len() < 5 {
        if data.len() < 6 {
            return Err(EINVAL);
        }