linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gpu: nova-core: fix bounds check in PmuLookupTableEntry::new
@ 2025-07-13  2:51 Rhys Lloyd
  2025-07-13  2:51 ` [PATCH] gpu: nova-core: define named constants for magic numbers Rhys Lloyd
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Rhys Lloyd @ 2025-07-13  2:51 UTC (permalink / raw)
  To: dakr, acourbot
  Cc: airlied, simona, nouveau, dri-devel, linux-kernel, rust-for-linux,
	Rhys Lloyd

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")

Signed-off-by: Rhys Lloyd <krakow20@gmail.com>
---
Changes in v2:
- Ensure commit description does not spill into commit message
- Fix author to match SoB
- Add "Fixes:" tag
- Add base commit

---
 drivers/gpu/nova-core/vbios.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/nova-core/vbios.rs b/drivers/gpu/nova-core/vbios.rs
index 663fc50e8b66..5b5d9f38cbb3 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<Self> {
-        if data.len() < 5 {
+        if data.len() < 6 {
             return Err(EINVAL);
         }
 

base-commit: 215a3f91713383a3c0d2da82d223a608a3c17ac1
-- 
2.50.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-07-17  5:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-13  2:51 [PATCH] gpu: nova-core: fix bounds check in PmuLookupTableEntry::new Rhys Lloyd
2025-07-13  2:51 ` [PATCH] gpu: nova-core: define named constants for magic numbers Rhys Lloyd
2025-07-14  3:11   ` Alexandre Courbot
2025-07-14  6:10     ` Rhys Lloyd
2025-07-14  3:06 ` [PATCH] gpu: nova-core: fix bounds check in PmuLookupTableEntry::new Alexandre Courbot
2025-07-17  5:15 ` Alexandre Courbot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).