Re: [PATCH] dma-buf: heaps: Fix potential spectre v1 gadget

2022-02-01 Thread Sumit Semwal
Hello Jordy, On Tue, 1 Feb 2022 at 02:09, John Stultz wrote: > > On Sat, Jan 29, 2022 at 7:06 AM Jordy Zomer wrote: > > > > 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 us

Re: [PATCH] dma-buf: heaps: Fix potential spectre v1 gadget

2022-01-31 Thread John Stultz
On Sat, Jan 29, 2022 at 7:06 AM Jordy Zomer wrote: > > 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

[PATCH] dma-buf: heaps: Fix potential spectre v1 gadget

2022-01-31 Thread Jordy Zomer
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 --- drivers/dma-buf/dma-heap.c | 2 ++ 1 f