<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/gpu/drm/vgem, branch v5.10.7</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v5.10.7</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v5.10.7'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2020-09-11T08:47:19+00:00</updated>
<entry>
<title>drm/vgem: Use devm_drm_dev_alloc</title>
<updated>2020-09-11T08:47:19+00:00</updated>
<author>
<name>Daniel Vetter</name>
<email>daniel.vetter@ffwll.ch</email>
</author>
<published>2020-09-09T12:07:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=bcc0ef7f57e51e5a5607eafb2a8ab63c6c1f21ff'/>
<id>urn:sha1:bcc0ef7f57e51e5a5607eafb2a8ab63c6c1f21ff</id>
<content type='text'>
This means we also need to slightly restructure the exit code, so that
final cleanup of the drm_device is triggered by unregistering the
platform device. Note that devres is both clean up when the driver is
unbound (not the case for vgem, we don't bind), and also when unregistering
the device (very much the case for vgem). Therefore we can rely on devres
even though vgem isn't a proper platform device driver.

This also somewhat untangles the load code, since the drm and platform device
setup are no longer interleaved, but two distinct steps.

v2: use devres_open/release_group so we can use devm without real
hacks in the driver core or having to create an entire fake bus for
testing drivers. Might want to extract this into helpers eventually,
maybe as a mock_drm_dev_alloc or test_drm_dev_alloc.

v3: Fix error code handling (Melissa)

Cc: Melissa Wen &lt;melissa.srw@gmail.com&gt;
Reviewed-by: Melissa Wen &lt;melissa.srw@gmail.com&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Cc: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Cc: Emil Velikov &lt;emil.velikov@collabora.com&gt;
Cc: Sean Paul &lt;seanpaul@chromium.org&gt;
Cc: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Cc: Sam Ravnborg &lt;sam@ravnborg.org&gt;
Cc: Rob Clark &lt;robdclark@chromium.org&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20200909120745.716178-1-daniel.vetter@ffwll.ch
</content>
</entry>
<entry>
<title>drm: allow limiting the scatter list size.</title>
<updated>2020-09-09T05:58:56+00:00</updated>
<author>
<name>Gerd Hoffmann</name>
<email>kraxel@redhat.com</email>
</author>
<published>2020-09-07T11:24:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=707d561f77b5e2a6f90c9786bee44ee7a8dedc7e'/>
<id>urn:sha1:707d561f77b5e2a6f90c9786bee44ee7a8dedc7e</id>
<content type='text'>
Add drm_device argument to drm_prime_pages_to_sg(), so we can
call dma_max_mapping_size() to figure the segment size limit
and call into __sg_alloc_table_from_pages() with the correct
limit.

This fixes virtio-gpu with sev.  Possibly it'll fix other bugs
too given that drm seems to totaly ignore segment size limits
so far ...

v2: place max_segment in drm driver not gem object.
v3: move max_segment next to the other gem fields.
v4: just use dma_max_mapping_size().

Signed-off-by: Gerd Hoffmann &lt;kraxel@redhat.com&gt;
Reviewed-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Link: http://patchwork.freedesktop.org/patch/msgid/20200907112425.15610-2-kraxel@redhat.com
</content>
</entry>
<entry>
<title>drm/vgem: add missing platform_device_unregister() in vgem_init()</title>
<updated>2020-08-10T13:31:02+00:00</updated>
<author>
<name>Qinglang Miao</name>
<email>miaoqinglang@huawei.com</email>
</author>
<published>2020-08-10T12:59:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=57fb54082d5d14512dfd21bc39d91945d3ad1ee9'/>
<id>urn:sha1:57fb54082d5d14512dfd21bc39d91945d3ad1ee9</id>
<content type='text'>
When vgem_init() get into out_put, the unregister call of
vgem_device-&gt;platform is missing. So add it before return.

Fixes: 363de9e7d4f6 ("drm/vgem: Use drmm_add_final_kfree")
Signed-off-by: Qinglang Miao &lt;miaoqinglang@huawei.com&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20200810125942.186637-1-miaoqinglang@huawei.com
</content>
</entry>
<entry>
<title>drm/vgem: Replace opencoded version of drm_gem_dumb_map_offset()</title>
<updated>2020-07-08T21:00:21+00:00</updated>
<author>
<name>Chris Wilson</name>
<email>chris@chris-wilson.co.uk</email>
</author>
<published>2020-07-08T15:49:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=119c53d2d4044c59c450c4f5a568d80b9d861856'/>
<id>urn:sha1:119c53d2d4044c59c450c4f5a568d80b9d861856</id>
<content type='text'>
drm_gem_dumb_map_offset() now exists and does everything
vgem_gem_dump_map does and *ought* to do.

In particular, vgem_gem_dumb_map() was trying to reject mmapping an
imported dmabuf by checking the existence of obj-&gt;filp. Unfortunately,
we always allocated an obj-&gt;filp, even if unused for an imported dmabuf.
Instead, the drm_gem_dumb_map_offset(), since commit 90378e589192
("drm/gem: drm_gem_dumb_map_offset(): reject dma-buf"), uses the
obj-&gt;import_attach to reject such invalid mmaps.

This prevents vgem from allowing userspace mmapping the dumb handle and
attempting to incorrectly fault in remote pages belonging to another
device, where there may not even be a struct page.

v2: Use the default drm_gem_dumb_map_offset() callback

Fixes: af33a9190d02 ("drm/vgem: Enable dmabuf import interfaces")
Signed-off-by: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Reviewed-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Cc: &lt;stable@vger.kernel.org&gt; # v4.13+
Link: https://patchwork.freedesktop.org/patch/msgid/20200708154911.21236-1-chris@chris-wilson.co.uk
</content>
</entry>
<entry>
<title>drm/vgem: remove _unlocked suffix in drm_gem_object_put_unlocked</title>
<updated>2020-05-19T21:31:36+00:00</updated>
<author>
<name>Emil Velikov</name>
<email>emil.velikov@collabora.com</email>
</author>
<published>2020-05-15T09:51:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a71a215a04e5dd82c302563ba3a8102d0b4683f5'/>
<id>urn:sha1:a71a215a04e5dd82c302563ba3a8102d0b4683f5</id>
<content type='text'>
Spelling out _unlocked for each and every driver is a annoying.
Especially if we consider how many drivers, do not know (or need to)
about the horror stories involving struct_mutex.

Just drop the suffix. It makes the API cleaner.

Done via the following script:

__from=drm_gem_object_put_unlocked
__to=drm_gem_object_put
for __file in $(git grep --name-only $__from); do
  sed -i  "s/$__from/$__to/g" $__file;
done

Cc: David Airlie &lt;airlied@linux.ie&gt;
Cc: Daniel Vetter &lt;daniel@ffwll.ch&gt;
Cc: Emil Velikov &lt;emil.velikov@collabora.com&gt;
Signed-off-by: Emil Velikov &lt;emil.velikov@collabora.com&gt;
Acked-by: Sam Ravnborg &lt;sam@ravnborg.org&gt;
Reviewed-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Acked-by: Thomas Zimmermann &lt;tzimmermann@suse.de&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20200515095118.2743122-35-emil.l.velikov@gmail.com
</content>
</entry>
<entry>
<title>drm: Garbage collect drm_dev_fini</title>
<updated>2020-03-26T14:45:36+00:00</updated>
<author>
<name>Daniel Vetter</name>
<email>daniel.vetter@ffwll.ch</email>
</author>
<published>2020-03-23T14:49:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d33b58d0115e7eee011fddee2d8e25c6a09fb279'/>
<id>urn:sha1:d33b58d0115e7eee011fddee2d8e25c6a09fb279</id>
<content type='text'>
It has become empty. Given the few users I figured not much point
splitting this up.

v2: Rebase over i915 changes.

v3: Rebase over patch split fix.

Acked-by: Sam Ravnborg &lt;sam@ravnborg.org&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-26-daniel.vetter@ffwll.ch
</content>
</entry>
<entry>
<title>drm/vgem: Use drmm_add_final_kfree</title>
<updated>2020-03-26T14:26:51+00:00</updated>
<author>
<name>Daniel Vetter</name>
<email>daniel.vetter@ffwll.ch</email>
</author>
<published>2020-03-23T14:49:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=363de9e7d4f6b1dd7993f316a064df1f9abc3341'/>
<id>urn:sha1:363de9e7d4f6b1dd7993f316a064df1f9abc3341</id>
<content type='text'>
With this we can drop the final kfree from the release function.

v2: After drm_dev_init/drmm_add_final_kfree we need to clean up
everything through a drm_dev_put. Rework the unwind code to match
that.

Acked-by: Sam Ravnborg &lt;sam@ravnborg.org&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@intel.com&gt;
Cc: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Cc: Emil Velikov &lt;emil.velikov@collabora.com&gt;
Cc: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Cc: Sean Paul &lt;seanpaul@chromium.org&gt;
Cc: Eric Anholt &lt;eric@anholt.net&gt;
Cc: Rob Clark &lt;robdclark@chromium.org&gt;
Cc: Sam Ravnborg &lt;sam@ravnborg.org&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20200323144950.3018436-14-daniel.vetter@ffwll.ch
</content>
</entry>
<entry>
<title>drm/vgem: Close use-after-free race in vgem_gem_create</title>
<updated>2020-02-06T18:04:41+00:00</updated>
<author>
<name>Daniel Vetter</name>
<email>daniel.vetter@ffwll.ch</email>
</author>
<published>2020-02-02T13:21:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4b848f20eda5974020f043ca14bacf7a7e634fc8'/>
<id>urn:sha1:4b848f20eda5974020f043ca14bacf7a7e634fc8</id>
<content type='text'>
There's two references floating around here (for the object reference,
not the handle_count reference, that's a different thing):

- The temporary reference held by vgem_gem_create, acquired by
  creating the object and released by calling
  drm_gem_object_put_unlocked.

- The reference held by the object handle, created by
  drm_gem_handle_create. This one generally outlives the function,
  except if a 2nd thread races with a GEM_CLOSE ioctl call.

So usually everything is correct, except in that race case, where the
access to gem_object-&gt;size could be looking at freed data already.
Which again isn't a real problem (userspace shot its feet off already
with the race, we could return garbage), but maybe someone can exploit
this as an information leak.

Cc: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Cc: Hillf Danton &lt;hdanton@sina.com&gt;
Reported-by: syzbot+0dc4444774d419e916c8@syzkaller.appspotmail.com
Cc: stable@vger.kernel.org
Cc: Emil Velikov &lt;emil.velikov@collabora.com&gt;
Cc: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Cc: Sean Paul &lt;seanpaul@chromium.org&gt;
Cc: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Cc: Eric Anholt &lt;eric@anholt.net&gt;
Cc: Sam Ravnborg &lt;sam@ravnborg.org&gt;
Cc: Rob Clark &lt;robdclark@chromium.org&gt;
Reviewed-by: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20200202132133.1891846-1-daniel.vetter@ffwll.ch
</content>
</entry>
<entry>
<title>dma-buf: rename reservation_object to dma_resv</title>
<updated>2019-08-13T07:09:30+00:00</updated>
<author>
<name>Christian König</name>
<email>christian.koenig@amd.com</email>
</author>
<published>2019-08-11T08:06:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=52791eeec1d9f4a7e7fe08aaba0b1553149d93bc'/>
<id>urn:sha1:52791eeec1d9f4a7e7fe08aaba0b1553149d93bc</id>
<content type='text'>
Be more consistent with the naming of the other DMA-buf objects.

Signed-off-by: Christian König &lt;christian.koenig@amd.com&gt;
Reviewed-by: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Link: https://patchwork.freedesktop.org/patch/323401/
</content>
</entry>
<entry>
<title>drm/vgem: drop DRM_AUTH usage from the driver</title>
<updated>2019-08-07T15:53:21+00:00</updated>
<author>
<name>Emil Velikov</name>
<email>emil.velikov@collabora.com</email>
</author>
<published>2019-05-27T08:17:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0a0b65d8eae3eb25dde57f72596b7a7c81a126fa'/>
<id>urn:sha1:0a0b65d8eae3eb25dde57f72596b7a7c81a126fa</id>
<content type='text'>
The authentication can be circumvented, by design, by using the render
node.

From the driver POV there is no distinction between primary and render
nodes, thus we can drop the token.

Cc: David Airlie &lt;airlied@linux.ie&gt;
Cc: Daniel Vetter &lt;daniel@ffwll.ch&gt;
Signed-off-by: Emil Velikov &lt;emil.velikov@collabora.com&gt;
Signed-off-by: Sean Paul &lt;seanpaul@chromium.org&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20190527081741.14235-11-emil.l.velikov@gmail.com
</content>
</entry>
</feed>
