<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/dma-buf/heaps, branch v5.15.209</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v5.15.209</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v5.15.209'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2024-10-17T13:10:37+00:00</updated>
<entry>
<title>dma-buf: heaps: Fix off-by-one in CMA heap fault handler</title>
<updated>2024-10-17T13:10:37+00:00</updated>
<author>
<name>T.J. Mercier</name>
<email>tjmercier@google.com</email>
</author>
<published>2024-08-30T19:26:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=79cce5e81d20fa9ad553be439d665ac3302d3c95'/>
<id>urn:sha1:79cce5e81d20fa9ad553be439d665ac3302d3c95</id>
<content type='text'>
commit ea5ff5d351b520524019f7ff7f9ce418de2dad87 upstream.

Until VM_DONTEXPAND was added in commit 1c1914d6e8c6 ("dma-buf: heaps:
Don't track CMA dma-buf pages under RssFile") it was possible to obtain
a mapping larger than the buffer size via mremap and bypass the overflow
check in dma_buf_mmap_internal. When using such a mapping to attempt to
fault past the end of the buffer, the CMA heap fault handler also checks
the fault offset against the buffer size, but gets the boundary wrong by
1. Fix the boundary check so that we don't read off the end of the pages
array and insert an arbitrary page in the mapping.

Reported-by: Xingyu Jin &lt;xingyuj@google.com&gt;
Fixes: a5d2d29e24be ("dma-buf: heaps: Move heap-helper logic into the cma_heap implementation")
Cc: stable@vger.kernel.org # Applicable &gt;= 5.10. Needs adjustments only for 5.10.
Signed-off-by: T.J. Mercier &lt;tjmercier@google.com&gt;
Acked-by: John Stultz &lt;jstultz@google.com&gt;
Signed-off-by: Sumit Semwal &lt;sumit.semwal@linaro.org&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20240830192627.2546033-1-tjmercier@google.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>dma-buf: cma_heap: Fix mutex locking section</title>
<updated>2022-03-08T18:12:37+00:00</updated>
<author>
<name>Weizhao Ouyang</name>
<email>o451686892@gmail.com</email>
</author>
<published>2022-01-04T07:35:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1a62246c2c600e4b5dabe1a5794c6d0bf5a860b5'/>
<id>urn:sha1:1a62246c2c600e4b5dabe1a5794c6d0bf5a860b5</id>
<content type='text'>
[ Upstream commit 54329e6f7beea6af56c1230da293acc97d6a6ee7 ]

Fix cma_heap_buffer mutex locking critical section to protect vmap_cnt
and vaddr.

Fixes: a5d2d29e24be ("dma-buf: heaps: Move heap-helper logic into the cma_heap implementation")
Signed-off-by: Weizhao Ouyang &lt;o451686892@gmail.com&gt;
Acked-by: John Stultz &lt;john.stultz@linaro.org&gt;
Signed-off-by: Sumit Semwal &lt;sumit.semwal@linaro.org&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20220104073545.124244-1-o451686892@gmail.com
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>dma-buf: system_heap: Use 'for_each_sgtable_sg' in pages free flow</title>
<updated>2021-12-08T08:04:42+00:00</updated>
<author>
<name>Guangming</name>
<email>Guangming.Cao@mediatek.com</email>
</author>
<published>2021-11-26T07:49:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c1079ff6f9a082902eef86246a28de80bb33a011'/>
<id>urn:sha1:c1079ff6f9a082902eef86246a28de80bb33a011</id>
<content type='text'>
commit 679d94cd7d900871e5bc9cf780bd5b73af35ab42 upstream.

For previous version, it uses 'sg_table.nent's to traverse sg_table in pages
free flow.
However, 'sg_table.nents' is reassigned in 'dma_map_sg', it means the number of
created entries in the DMA adderess space.
So, use 'sg_table.nents' in pages free flow will case some pages can't be freed.

Here we should use sg_table.orig_nents to free pages memory, but use the
sgtable helper 'for each_sgtable_sg'(, instead of the previous rather common
helper 'for_each_sg' which maybe cause memory leak) is much better.

Fixes: d963ab0f15fb0 ("dma-buf: system_heap: Allocate higher order pages if available")
Signed-off-by: Guangming &lt;Guangming.Cao@mediatek.com&gt;
Reviewed-by: Robin Murphy &lt;robin.murphy@arm.com&gt;
Cc: &lt;stable@vger.kernel.org&gt; # 5.11.*
Reviewed-by: Christian König &lt;christian.koenig@amd.com&gt;
Reviewed-by: John Stultz &lt;john.stultz@linaro.org&gt;
Signed-off-by: Sumit Semwal &lt;sumit.semwal@linaro.org&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20211126074904.88388-1-guangming.cao@mediatek.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'drm-misc-next-2021-03-03' of git://anongit.freedesktop.org/drm/drm-misc into drm-next</title>
<updated>2021-03-16T07:08:46+00:00</updated>
<author>
<name>Dave Airlie</name>
<email>airlied@redhat.com</email>
</author>
<published>2021-03-16T06:45:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=51c3b916a4d7e24b4918925965867fdd9bd8dd59'/>
<id>urn:sha1:51c3b916a4d7e24b4918925965867fdd9bd8dd59</id>
<content type='text'>
drm-misc-next for 5.13:

UAPI Changes:

Cross-subsystem Changes:

Core Changes:
  - %p4cc printk format modifier
  - atomic: introduce drm_crtc_commit_wait, rework atomic plane state
    helpers to take the drm_commit_state structure
  - dma-buf: heaps rework to return a struct dma_buf
  - simple-kms: Add plate state helpers
  - ttm: debugfs support, removal of sysfs

Driver Changes:
  - Convert drivers to shadow plane helpers
  - arc: Move to drm/tiny
  - ast: cursor plane reworks
  - gma500: Remove TTM and medfield support
  - mxsfb: imx8mm support
  - panfrost: MMU IRQ handling rework
  - qxl: rework to better handle resources deallocation, locking
  - sun4i: Add alpha properties for UI and VI layers
  - vc4: RPi4 CEC support
  - vmwgfx: doc cleanup

Signed-off-by: Dave Airlie &lt;airlied@redhat.com&gt;

From: Maxime Ripard &lt;maxime@cerno.tech&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20210303100600.dgnkadonzuvfnu22@gilmour
</content>
</entry>
<entry>
<title>dma-buf: heaps: Fix the name used when exporting dmabufs to be the actual heap name</title>
<updated>2021-02-25T12:58:24+00:00</updated>
<author>
<name>John Stultz</name>
<email>john.stultz@linaro.org</email>
</author>
<published>2021-02-09T19:48:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2eebbdbaab5fcde967c76892bf568a701c62e1d7'/>
<id>urn:sha1:2eebbdbaab5fcde967c76892bf568a701c62e1d7</id>
<content type='text'>
By default dma_buf_export() sets the exporter name to be
KBUILD_MODNAME. Unfortunately this may not be identical to the
string used as the heap name (ie: "system" vs "system_heap").

This can cause some minor confusion with tooling, and there is
the future potential where multiple heap types may be exported
by the same module (but would all have the same name).

So to avoid all this, set the exporter exp_name to the heap name.

Cc: Daniel Vetter &lt;daniel@ffwll.ch&gt;
Cc: Sumit Semwal &lt;sumit.semwal@linaro.org&gt;
Cc: Liam Mark &lt;lmark@codeaurora.org&gt;
Cc: Chris Goldsworthy &lt;cgoldswo@codeaurora.org&gt;
Cc: Laura Abbott &lt;labbott@kernel.org&gt;
Cc: Brian Starkey &lt;Brian.Starkey@arm.com&gt;
Cc: Hridya Valsaraju &lt;hridya@google.com&gt;
Cc: Suren Baghdasaryan &lt;surenb@google.com&gt;
Cc: Sandeep Patil &lt;sspatil@google.com&gt;
Cc: Daniel Mentz &lt;danielmentz@google.com&gt;
Cc: Ørjan Eide &lt;orjan.eide@arm.com&gt;
Cc: Robin Murphy &lt;robin.murphy@arm.com&gt;
Cc: Ezequiel Garcia &lt;ezequiel@collabora.com&gt;
Cc: Simon Ser &lt;contact@emersion.fr&gt;
Cc: James Jones &lt;jajones@nvidia.com&gt;
Cc: linux-media@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
Acked-by: Daniel Vetter &lt;daniel@ffwll.ch&gt;
Signed-off-by: Sumit Semwal &lt;sumit.semwal@linaro.org&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20210209194818.2459062-2-john.stultz@linaro.org
</content>
</entry>
<entry>
<title>dma-buf: heaps: Rework heap allocation hooks to return struct dma_buf instead of fd</title>
<updated>2021-02-24T15:34:54+00:00</updated>
<author>
<name>John Stultz</name>
<email>john.stultz@linaro.org</email>
</author>
<published>2021-01-19T20:45:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=abf4451b340b09f797c87341b3010f95af9215c0'/>
<id>urn:sha1:abf4451b340b09f797c87341b3010f95af9215c0</id>
<content type='text'>
Every heap needs to create a dmabuf and then export it to a fd
via dma_buf_fd(), so to consolidate things a bit, have the heaps
just return a struct dmabuf * and let the top level
dma_heap_buffer_alloc() call handle creating the fd via
dma_buf_fd().

Cc: Sumit Semwal &lt;sumit.semwal@linaro.org&gt;
Cc: Liam Mark &lt;lmark@codeaurora.org&gt;
Cc: Laura Abbott &lt;labbott@kernel.org&gt;
Cc: Brian Starkey &lt;Brian.Starkey@arm.com&gt;
Cc: Hridya Valsaraju &lt;hridya@google.com&gt;
Cc: Suren Baghdasaryan &lt;surenb@google.com&gt;
Cc: Sandeep Patil &lt;sspatil@google.com&gt;
Cc: Daniel Mentz &lt;danielmentz@google.com&gt;
Cc: Chris Goldsworthy &lt;cgoldswo@codeaurora.org&gt;
Cc: Ørjan Eide &lt;orjan.eide@arm.com&gt;
Cc: Robin Murphy &lt;robin.murphy@arm.com&gt;
Cc: Ezequiel Garcia &lt;ezequiel@collabora.com&gt;
Cc: Simon Ser &lt;contact@emersion.fr&gt;
Cc: James Jones &lt;jajones@nvidia.com&gt;
Cc: linux-media@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
Signed-off-by: Sumit Semwal &lt;sumit.semwal@linaro.org&gt;
 [sumits: minor reword of commit message]

Link: https://patchwork.freedesktop.org/patch/msgid/20210119204508.9256-3-john.stultz@linaro.org
(cherry picked from commit c7f59e3dd60313071a989227dcb69094f499d310)
Signed-off-by: Sumit Semwal &lt;sumit.semwal@linaro.org&gt;
</content>
</entry>
<entry>
<title>dma-buf: system_heap: Make sure to return an error if we abort</title>
<updated>2021-02-24T15:34:25+00:00</updated>
<author>
<name>John Stultz</name>
<email>john.stultz@linaro.org</email>
</author>
<published>2021-01-19T20:45:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=cc84a8e65d87990ebb09f65a745b38e95b4d2721'/>
<id>urn:sha1:cc84a8e65d87990ebb09f65a745b38e95b4d2721</id>
<content type='text'>
If we abort from the allocation due to a fatal_signal_pending(),
be sure we report an error so any return code paths don't trip
over the fact that the allocation didn't succeed.

Cc: Sumit Semwal &lt;sumit.semwal@linaro.org&gt;
Cc: Liam Mark &lt;lmark@codeaurora.org&gt;
Cc: Laura Abbott &lt;labbott@kernel.org&gt;
Cc: Brian Starkey &lt;Brian.Starkey@arm.com&gt;
Cc: Hridya Valsaraju &lt;hridya@google.com&gt;
Cc: Suren Baghdasaryan &lt;surenb@google.com&gt;
Cc: Sandeep Patil &lt;sspatil@google.com&gt;
Cc: Daniel Mentz &lt;danielmentz@google.com&gt;
Cc: Chris Goldsworthy &lt;cgoldswo@codeaurora.org&gt;
Cc: Ørjan Eide &lt;orjan.eide@arm.com&gt;
Cc: Robin Murphy &lt;robin.murphy@arm.com&gt;
Cc: Ezequiel Garcia &lt;ezequiel@collabora.com&gt;
Cc: Simon Ser &lt;contact@emersion.fr&gt;
Cc: James Jones &lt;jajones@nvidia.com&gt;
Cc: linux-media@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Suggested-by: Suren Baghdasaryan &lt;surenb@google.com&gt;
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
Signed-off-by: Sumit Semwal &lt;sumit.semwal@linaro.org&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20210119204508.9256-1-john.stultz@linaro.org
(cherry picked from commit 14a117252f57839bdf0123a1c888a96102e3a843)
Signed-off-by: Sumit Semwal &lt;sumit.semwal@linaro.org&gt;
</content>
</entry>
<entry>
<title>dma-buf: heaps: Rework heap allocation hooks to return struct dma_buf instead of fd</title>
<updated>2021-01-22T08:04:39+00:00</updated>
<author>
<name>John Stultz</name>
<email>john.stultz@linaro.org</email>
</author>
<published>2021-01-19T20:45:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c7f59e3dd60313071a989227dcb69094f499d310'/>
<id>urn:sha1:c7f59e3dd60313071a989227dcb69094f499d310</id>
<content type='text'>
Every heap needs to create a dmabuf and then export it to a fd
via dma_buf_fd(), so to consolidate things a bit, have the heaps
just return a struct dmabuf * and let the top level
dma_heap_buffer_alloc() call handle creating the fd via
dma_buf_fd().

Cc: Sumit Semwal &lt;sumit.semwal@linaro.org&gt;
Cc: Liam Mark &lt;lmark@codeaurora.org&gt;
Cc: Laura Abbott &lt;labbott@kernel.org&gt;
Cc: Brian Starkey &lt;Brian.Starkey@arm.com&gt;
Cc: Hridya Valsaraju &lt;hridya@google.com&gt;
Cc: Suren Baghdasaryan &lt;surenb@google.com&gt;
Cc: Sandeep Patil &lt;sspatil@google.com&gt;
Cc: Daniel Mentz &lt;danielmentz@google.com&gt;
Cc: Chris Goldsworthy &lt;cgoldswo@codeaurora.org&gt;
Cc: Ørjan Eide &lt;orjan.eide@arm.com&gt;
Cc: Robin Murphy &lt;robin.murphy@arm.com&gt;
Cc: Ezequiel Garcia &lt;ezequiel@collabora.com&gt;
Cc: Simon Ser &lt;contact@emersion.fr&gt;
Cc: James Jones &lt;jajones@nvidia.com&gt;
Cc: linux-media@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
Signed-off-by: Sumit Semwal &lt;sumit.semwal@linaro.org&gt;
 [sumits: minor reword of commit message]

Link: https://patchwork.freedesktop.org/patch/msgid/20210119204508.9256-3-john.stultz@linaro.org
</content>
</entry>
<entry>
<title>dma-buf: system_heap: Make sure to return an error if we abort</title>
<updated>2021-01-22T08:04:21+00:00</updated>
<author>
<name>John Stultz</name>
<email>john.stultz@linaro.org</email>
</author>
<published>2021-01-19T20:45:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=14a117252f57839bdf0123a1c888a96102e3a843'/>
<id>urn:sha1:14a117252f57839bdf0123a1c888a96102e3a843</id>
<content type='text'>
If we abort from the allocation due to a fatal_signal_pending(),
be sure we report an error so any return code paths don't trip
over the fact that the allocation didn't succeed.

Cc: Sumit Semwal &lt;sumit.semwal@linaro.org&gt;
Cc: Liam Mark &lt;lmark@codeaurora.org&gt;
Cc: Laura Abbott &lt;labbott@kernel.org&gt;
Cc: Brian Starkey &lt;Brian.Starkey@arm.com&gt;
Cc: Hridya Valsaraju &lt;hridya@google.com&gt;
Cc: Suren Baghdasaryan &lt;surenb@google.com&gt;
Cc: Sandeep Patil &lt;sspatil@google.com&gt;
Cc: Daniel Mentz &lt;danielmentz@google.com&gt;
Cc: Chris Goldsworthy &lt;cgoldswo@codeaurora.org&gt;
Cc: Ørjan Eide &lt;orjan.eide@arm.com&gt;
Cc: Robin Murphy &lt;robin.murphy@arm.com&gt;
Cc: Ezequiel Garcia &lt;ezequiel@collabora.com&gt;
Cc: Simon Ser &lt;contact@emersion.fr&gt;
Cc: James Jones &lt;jajones@nvidia.com&gt;
Cc: linux-media@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Suggested-by: Suren Baghdasaryan &lt;surenb@google.com&gt;
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
Signed-off-by: Sumit Semwal &lt;sumit.semwal@linaro.org&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20210119204508.9256-1-john.stultz@linaro.org
</content>
</entry>
<entry>
<title>dma-buf: cma_heap: Fix memory leak in CMA heap</title>
<updated>2021-01-10T17:38:21+00:00</updated>
<author>
<name>John Stultz</name>
<email>john.stultz@linaro.org</email>
</author>
<published>2021-01-07T20:26:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a0adc8eabb402cfb9f32d15edd9f65f65e35cdce'/>
<id>urn:sha1:a0adc8eabb402cfb9f32d15edd9f65f65e35cdce</id>
<content type='text'>
Bing Song noticed the CMA heap was leaking memory due to a flub
I made in commit a5d2d29e24be ("dma-buf: heaps: Move heap-helper
logic into the cma_heap implementation"), and provided this fix
which ensures the pagelist is also freed on release.

Cc: Bing Song &lt;bing.song@nxp.com&gt;
Cc: Sumit Semwal &lt;sumit.semwal@linaro.org&gt;
Cc: Liam Mark &lt;lmark@codeaurora.org&gt;
Cc: Laura Abbott &lt;labbott@kernel.org&gt;
Cc: Brian Starkey &lt;Brian.Starkey@arm.com&gt;
Cc: Hridya Valsaraju &lt;hridya@google.com&gt;
Cc: Suren Baghdasaryan &lt;surenb@google.com&gt;
Cc: Sandeep Patil &lt;sspatil@google.com&gt;
Cc: Daniel Mentz &lt;danielmentz@google.com&gt;
Cc: Chris Goldsworthy &lt;cgoldswo@codeaurora.org&gt;
Cc: Ørjan Eide &lt;orjan.eide@arm.com&gt;
Cc: Robin Murphy &lt;robin.murphy@arm.com&gt;
Cc: Ezequiel Garcia &lt;ezequiel@collabora.com&gt;
Cc: Simon Ser &lt;contact@emersion.fr&gt;
Cc: James Jones &lt;jajones@nvidia.com&gt;
Cc: linux-media@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Reported-by: Bing Song &lt;bing.song@nxp.com&gt;
Fixes: a5d2d29e24be ("dma-buf: heaps: Move heap-helper logic into the cma_heap implementation")
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
Signed-off-by: Sumit Semwal &lt;sumit.semwal@linaro.org&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20210107202616.75170-1-john.stultz@linaro.org
</content>
</entry>
</feed>
