mirror of
https://github.com/torvalds/linux.git
synced 2026-11-24 07:22:34 +00:00
It appears like nr could be a Spectre v1 gadget as it's supplied by a
user and used as an array index. Prevent the contents
of kernel memory from being leaked to userspace via speculative
execution by using array_index_nospec.
Signed-off-by: Jordy Zomer <[email protected]>
Fixes: c02a81fba7 ("dma-buf: Add dma-buf heaps framework")
Cc: <[email protected]> # v5.6+
Acked-by: John Stultz <[email protected]>
Signed-off-by: Sumit Semwal <[email protected]>
[sumits: added fixes and cc: stable tags]
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]