diff options
| author | Alexandre Courbot <acourbot@nvidia.com> | 2026-04-04 14:04:24 +0900 |
|---|---|---|
| committer | Danilo Krummrich <dakr@kernel.org> | 2026-04-05 15:35:07 +0200 |
| commit | 8e6c34785a30012a53417b6d92e0ced71b9115a7 (patch) | |
| tree | 0792de64fc882e7a46cbd8b767ce2832291cad94 /tools/testing/vma/include/git@git.tavy.me:linux.git | |
| parent | 7c50d748b4a635bc39802ea3f6b120e66b1b9067 (diff) | |
gpu: nova-core: gsp: fix undefined behavior in command queue code
`driver_read_area` and `driver_write_area` are internal methods that
return slices containing the area of the command queue buffer that the
driver has exclusive read or write access, respectively.
While their returned value is correct and safe to use, internally they
temporarily create a reference to the whole command-buffer slice,
including GSP-owned regions. These regions can change without notice,
and thus creating a slice to them, even if never accessed, is undefined
behavior.
Fix this by making these methods create slices to valid regions only.
Fixes: 75f6b1de8133 ("gpu: nova-core: gsp: Add GSP command queue bindings and handling")
Reported-by: Danilo Krummrich <dakr@kernel.org>
Closes: https://lore.kernel.org/all/DH47AVPEKN06.3BERUSJIB4M1R@kernel.org/
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Link: https://patch.msgid.link/20260404-cmdq-ub-fix-v5-1-53d21f4752f5@nvidia.com
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Diffstat (limited to 'tools/testing/vma/include/git@git.tavy.me:linux.git')
0 files changed, 0 insertions, 0 deletions
