Re: [PATCH] dma-buf: heaps: Fix off by one in cma_heap_vm_fault()

2023-10-03 Thread T.J. Mercier
On Tue, Oct 3, 2023 at 1:30 AM Dan Carpenter wrote: > > On Mon, Oct 02, 2023 at 10:16:24AM -0700, T.J. Mercier wrote: > > On Mon, Oct 2, 2023 at 12:04 AM Dan Carpenter > > wrote: > > > > > > The buffer->pages[] has "buffer->pagecount" elements so this > comparison > > > has to be changed to >= t

Re: [PATCH] dma-buf: heaps: Fix off by one in cma_heap_vm_fault()

2023-10-03 Thread Dan Carpenter
On Mon, Oct 02, 2023 at 10:16:24AM -0700, T.J. Mercier wrote: > On Mon, Oct 2, 2023 at 12:04 AM Dan Carpenter > wrote: > > > > The buffer->pages[] has "buffer->pagecount" elements so this > comparison > > has to be changed to >= to avoid reading beyond the end of the array. > > The buffer->pages[

Re: [PATCH] dma-buf: heaps: Fix off by one in cma_heap_vm_fault()

2023-10-02 Thread T.J. Mercier
On Mon, Oct 2, 2023 at 12:04 AM Dan Carpenter wrote: > > The buffer->pages[] has "buffer->pagecount" elements so this > comparison > has to be changed to >= to avoid reading beyond the end of the array. > The buffer->pages[] array is allocated in cma_heap_allocate(). > > Fixes: a5d2d29e24be ("dma-

[PATCH] dma-buf: heaps: Fix off by one in cma_heap_vm_fault()

2023-10-02 Thread Dan Carpenter
The buffer->pages[] has "buffer->pagecount" elements so this > comparison has to be changed to >= to avoid reading beyond the end of the array. The buffer->pages[] array is allocated in cma_heap_allocate(). Fixes: a5d2d29e24be ("dma-buf: heaps: Move heap-helper logic into the cma_heap implementat