From: Rhys Lloyd Date: Sun, 13 Jul 2025 02:51:08 +0000 (-0700) Subject: gpu: nova-core: fix bounds check in PmuLookupTableEntry::new X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=14ae91a81ec8fa0bc23170d4aa16dd2a20d54105;p=thirdparty%2Flinux.git 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: 47c4846e4319 ("gpu: nova-core: vbios: Add support for FWSEC ucode extraction") Reviewed-by: Alexandre Courbot Reviewed-by: Joel Fernandes Signed-off-by: Rhys Lloyd Link: https://lore.kernel.org/r/20250713025108.9364-2-krakow20@gmail.com Signed-off-by: Alexandre Courbot --- diff --git a/drivers/gpu/nova-core/vbios.rs b/drivers/gpu/nova-core/vbios.rs index 663fc50e8b66c..5b5d9f38cbb3a 100644 --- a/drivers/gpu/nova-core/vbios.rs +++ b/drivers/gpu/nova-core/vbios.rs @@ -901,7 +901,7 @@ struct PmuLookupTableEntry { impl PmuLookupTableEntry { fn new(data: &[u8]) -> Result { - if data.len() < 5 { + if data.len() < 6 { return Err(EINVAL); }