]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
gpu: nova-core: vbios: avoid reading too far in read_more_at_offset
authorEliot Courtney <ecourtney@nvidia.com>
Mon, 25 May 2026 13:57:21 +0000 (22:57 +0900)
committerDanilo Krummrich <dakr@kernel.org>
Mon, 25 May 2026 14:30:34 +0000 (16:30 +0200)
commit33f1402bcfa6cfd85fa265ce6fa5c6bb7d981c6d
tree769efd4344242e20fc89cb8f8d9b67e62c195de7
parent7a1d09e477b6496f13f92b84ed9b2eab191b3366
gpu: nova-core: vbios: avoid reading too far in read_more_at_offset

Fix bug where `read_more_at_offset` would unnecessarily read more data.
This happens when the window to read has some part cached and some part
not. It would read `len` bytes instead of just the uncached portion,
which could read past `BIOS_MAX_SCAN_LEN`.

Fixes: 6fda04e7f0cd ("gpu: nova-core: vbios: Add base support for VBIOS construction and iteration")
Reviewed-by: John Hubbard <jhubbard@nvidia.com>
Signed-off-by: Eliot Courtney <ecourtney@nvidia.com>
Link: https://patch.msgid.link/20260525-fix-vbios-v5-3-e5e455251537@nvidia.com
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
drivers/gpu/nova-core/vbios.rs