<feed xmlns='http://www.w3.org/2005/Atom'>
<title>BMC/Intel-BMC/linux.git/drivers/gpu/drm/drm_ioctl.c, branch dev-5.2</title>
<subtitle>Intel OpenBMC Linux kernel source tree (mirror)</subtitle>
<id>https://git.radix-linux.su/BMC/Intel-BMC/linux.git/atom?h=dev-5.2</id>
<link rel='self' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/atom?h=dev-5.2'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/'/>
<updated>2019-05-02T02:36:47+00:00</updated>
<entry>
<title>drm: introduce a capability flag for syncobj timeline support</title>
<updated>2019-05-02T02:36:47+00:00</updated>
<author>
<name>Lionel Landwerlin</name>
<email>lionel.g.landwerlin@intel.com</email>
</author>
<published>2019-04-16T12:57:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=060cebb20cdbcd3185d593e7194fa7a738201817'/>
<id>urn:sha1:060cebb20cdbcd3185d593e7194fa7a738201817</id>
<content type='text'>
Unfortunately userspace users of this API cannot be publicly disclosed
yet.

This commit effectively disables timeline syncobj ioctls for all
drivers. Each driver wishing to support this feature will need to
expose DRIVER_SYNCOBJ_TIMELINE.

v2: Add uAPI capability check (Christian)

Signed-off-by: Lionel Landwerlin &lt;lionel.g.landwerlin@intel.com&gt;
Reviewed-by: Christian König &lt;christian.koenig@amd.com&gt; (v1)
Cc: Dave Airlie &lt;airlied@redhat.com&gt;
Cc: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Cc: Christian König &lt;christian.koenig@amd.com&gt;
Cc: Chunming Zhou &lt;david1.zhou@amd.com&gt;
Reviewed-by: Dave Airlie &lt;airlied@redhat.com&gt;
Reviewed-by: Chunming Zhou &lt;david1.zhou@amd.com&gt;
Signed-off-by: Dave Airlie &lt;airlied@redhat.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20190416125750.31370-1-lionel.g.landwerlin@intel.com
</content>
</entry>
<entry>
<title>drm: allow removal of legacy codepaths (v4.1)</title>
<updated>2019-04-24T02:33:15+00:00</updated>
<author>
<name>Dave Airlie</name>
<email>airlied@redhat.com</email>
</author>
<published>2019-04-18T07:10:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=61ae227032e7f9278cc7d7224045e77e0dedb33e'/>
<id>urn:sha1:61ae227032e7f9278cc7d7224045e77e0dedb33e</id>
<content type='text'>
If you don't want the legacy drivers, then lets get rid of all the
legacy codepaths from the core module.

This drop the size of drm.ko for me by about 10%.
 380515    7422    4192  392129   5fbc1 ../../drm-next-build/drivers/gpu/drm/drm.ko
 351736	   7298	   4192	 363226	  58ada	../../drm-next-build/drivers/gpu/drm/drm.ko

v2: drop drm_lock as well, fix some DMA-&gt;DRM typos
v3: avoid ifdefs in mainline code
v4: rework ioctl defs
v4.1: fix nouveau Kconfig

Reviewed-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Signed-off-by: Dave Airlie &lt;airlied@redhat.com&gt;
</content>
</entry>
<entry>
<title>Revert "drm: allow render capable master with DRM_AUTH ioctls"</title>
<updated>2019-04-17T20:46:33+00:00</updated>
<author>
<name>Dave Airlie</name>
<email>airlied@redhat.com</email>
</author>
<published>2019-04-17T20:46:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=dbb92471674a48892f5e50779425e03388073ab9'/>
<id>urn:sha1:dbb92471674a48892f5e50779425e03388073ab9</id>
<content type='text'>
This reverts commit 8059add0478e29cb641936011a8fcc9ce9fd80be.

This commit while seemingly a good idea, breaks a radv check,
for a node being master because something succeeds where it failed
before now.

Apply the Linus rule, revert early and try again, we don't break
userspace.

Signed-off-by: Dave Airlie &lt;airlied@redhat.com&gt;
</content>
</entry>
<entry>
<title>drm/syncobj: add timeline signal ioctl for syncobj v5</title>
<updated>2019-04-01T10:09:00+00:00</updated>
<author>
<name>Chunming Zhou</name>
<email>david1.zhou@amd.com</email>
</author>
<published>2019-04-01T09:51:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=50d1ebef79ef6d09f4fb91f0b424e4f87db1d8a8'/>
<id>urn:sha1:50d1ebef79ef6d09f4fb91f0b424e4f87db1d8a8</id>
<content type='text'>
v2: individually allocate chain array, since chain node is free independently.
v3: all existing points must be already signaled before cpu perform signal operation,
    so add check condition for that.
v4: remove v3 change and add checking to prevent out-of-order
v5: unify binary and timeline

Signed-off-by: Chunming Zhou &lt;david1.zhou@amd.com&gt;
Signed-off-by: Christian König &lt;christian.koenig@amd.com&gt;
Cc: Tobias Hector &lt;Tobias.Hector@amd.com&gt;
Cc: Jason Ekstrand &lt;jason@jlekstrand.net&gt;
Cc: Dave Airlie &lt;airlied@redhat.com&gt;
Cc: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Reviewed-by: Lionel Landwerlin &lt;lionel.g.landwerlin@intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/295792/?series=58813&amp;rev=1
</content>
</entry>
<entry>
<title>drm/syncobj: add transition iotcls between binary and timeline v2</title>
<updated>2019-04-01T10:08:44+00:00</updated>
<author>
<name>Chunming Zhou</name>
<email>david1.zhou@amd.com</email>
</author>
<published>2019-04-01T09:51:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=ea569910cbab980abb42daa603ad4e8f5f9deaaa'/>
<id>urn:sha1:ea569910cbab980abb42daa603ad4e8f5f9deaaa</id>
<content type='text'>
we need to import/export timeline point.

v2: unify to one transfer ioctl

Signed-off-by: Chunming Zhou &lt;david1.zhou@amd.com&gt;
Signed-off-by: Christian König &lt;christian.koenig@amd.com&gt;
Reviewed-by: Lionel Landwerlin &lt;lionel.g.landwerlin@intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/295790/?series=58813&amp;rev=1
</content>
</entry>
<entry>
<title>drm/syncobj: add timeline payload query ioctl v6</title>
<updated>2019-04-01T10:06:38+00:00</updated>
<author>
<name>Chunming Zhou</name>
<email>david1.zhou@amd.com</email>
</author>
<published>2019-04-01T09:50:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=27b575a9aa2ff0358c5f4410a14f6413d5c792e4'/>
<id>urn:sha1:27b575a9aa2ff0358c5f4410a14f6413d5c792e4</id>
<content type='text'>
user mode can query timeline payload.
v2: check return value of copy_to_user
v3: handle querying entry by entry
v4: rebase on new chain container, simplify interface
v5: query last signaled timeline point, not last point.
v6: add unorder point check

Signed-off-by: Chunming Zhou &lt;david1.zhou@amd.com&gt;
Signed-off-by: Christian König &lt;christian.koenig@amd.com&gt;
Cc: Tobias Hector &lt;Tobias.Hector@amd.com&gt;
Cc: Jason Ekstrand &lt;jason@jlekstrand.net&gt;
Cc: Dave Airlie &lt;airlied@redhat.com&gt;
Cc: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Reviewed-by: Lionel Landwerlin &lt;lionel.g.landwerlin@intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/295784/?series=58813&amp;rev=1
</content>
</entry>
<entry>
<title>drm/syncobj: add support for timeline point wait v8</title>
<updated>2019-04-01T10:06:11+00:00</updated>
<author>
<name>Chunming Zhou</name>
<email>david1.zhou@amd.com</email>
</author>
<published>2019-04-01T09:50:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=01d6c357837918d8186b9f520e167d98e3d560cc'/>
<id>urn:sha1:01d6c357837918d8186b9f520e167d98e3d560cc</id>
<content type='text'>
points array is one-to-one match with syncobjs array.
v2:
add seperate ioctl for timeline point wait, otherwise break uapi.
v3:
userspace can specify two kinds waits::
a. Wait for time point to be completed.
b. and wait for time point to become available
v4:
rebase
v5:
add comment for xxx_WAIT_AVAILABLE
v6: rebase and rework on new container
v7: drop _WAIT_COMPLETED, it is the default anyway
v8: correctly handle garbage collected fences

Signed-off-by: Chunming Zhou &lt;david1.zhou@amd.com&gt;
Signed-off-by: Christian König &lt;christian.koenig@amd.com&gt;
Cc: Tobias Hector &lt;Tobias.Hector@amd.com&gt;
Cc: Jason Ekstrand &lt;jason@jlekstrand.net&gt;
Cc: Dave Airlie &lt;airlied@redhat.com&gt;
Cc: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Reviewed-by: Lionel Landwerlin &lt;lionel.g.landwerlin@intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/295782/?series=58813&amp;rev=1
</content>
</entry>
<entry>
<title>drm: allow render capable master with DRM_AUTH ioctls</title>
<updated>2019-02-13T17:42:36+00:00</updated>
<author>
<name>Emil Velikov</name>
<email>emil.velikov@collabora.com</email>
</author>
<published>2019-01-14T08:54:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=8059add0478e29cb641936011a8fcc9ce9fd80be'/>
<id>urn:sha1:8059add0478e29cb641936011a8fcc9ce9fd80be</id>
<content type='text'>
There are cases (in mesa and applications) where one would open the
primary node without properly authenticating the client.

Sometimes we don't check if the authentication succeeds, but there's
also cases we simply forget to do it.

The former was a case for Mesa where it did not not check the return
value of drmGetMagic() [1]. That was fixed recently although, there's
the question of older drivers or other apps that exbibit this behaviour.

While omitting the call results in issues as seen in [2] and [3].

In the libva case, libva itself doesn't authenticate the DRM client and
the vaGetDisplayDRM documentation doesn't mention if the app should
either.

As of today, the official vainfo utility doesn't authenticate.

To workaround issues like these, some users resort to running their apps
under sudo. Which admittedly isn't always a good idea.

Since any DRIVER_RENDER driver has sufficient isolation between clients,
we can use that, for unauthenticated [primary node] ioctls that require
DRM_AUTH. But only if the respective ioctl is tagged as DRM_RENDER_ALLOW.

v2:
- Rework/simplify if check (Daniel V)
- Add examples to commit messages, elaborate. (Daniel V)

v3:
- Use single unlikely (Daniel V)

[1] https://gitlab.freedesktop.org/mesa/mesa/blob/2bc1f5c2e70fe3b4d41f060af9859bc2a94c5b62/src/egl/drivers/dri2/platform_wayland.c#L1136
[2] https://lists.freedesktop.org/archives/libva/2016-July/004185.html
[3] https://gitlab.freedesktop.org/mesa/kmscube/issues/1
Testcase: igt/core_unauth_vs_render
Cc: intel-gfx@lists.freedesktop.org
Signed-off-by: Emil Velikov &lt;emil.velikov@collabora.com&gt;
Reviewed-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20190114085408.15933-2-emil.l.velikov@gmail.com
</content>
</entry>
<entry>
<title>drm: drop DRM_AUTH requirement from AUTH_MAGIC ioctl</title>
<updated>2019-02-13T17:37:45+00:00</updated>
<author>
<name>Emil Velikov</name>
<email>emil.velikov@collabora.com</email>
</author>
<published>2019-01-14T08:43:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=4933c9a494416a8edc3166ce3f3ce3836a6af01d'/>
<id>urn:sha1:4933c9a494416a8edc3166ce3f3ce3836a6af01d</id>
<content type='text'>
Currently only an authenticated master can authenticate another client.

In practise the client can only be master if CAP_SYS_ADMIN is present,
although having the CAP also sets the client as authenticated.

Thus DRM_AUTH in AUTH_MAGIC's "DRM_AUTH | DRM_MASTER" is superfluous.

Notices while working on IGT tests.

Signed-off-by: Emil Velikov &lt;emil.velikov@collabora.com&gt;
Reviewed-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20190114084305.15141-1-emil.l.velikov@gmail.com
</content>
</entry>
<entry>
<title>drm/ioctl: Fix Spectre v1 vulnerabilities</title>
<updated>2018-12-20T07:13:29+00:00</updated>
<author>
<name>Gustavo A. R. Silva</name>
<email>gustavo@embeddedor.com</email>
</author>
<published>2018-12-20T00:00:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=505b5240329b922f21f91d5b5d1e535c805eca6d'/>
<id>urn:sha1:505b5240329b922f21f91d5b5d1e535c805eca6d</id>
<content type='text'>
nr is indirectly controlled by user-space, hence leading to a
potential exploitation of the Spectre variant 1 vulnerability.

This issue was detected with the help of Smatch:

drivers/gpu/drm/drm_ioctl.c:805 drm_ioctl() warn: potential spectre issue 'dev-&gt;driver-&gt;ioctls' [r]
drivers/gpu/drm/drm_ioctl.c:810 drm_ioctl() warn: potential spectre issue 'drm_ioctls' [r] (local cap)
drivers/gpu/drm/drm_ioctl.c:892 drm_ioctl_flags() warn: potential spectre issue 'drm_ioctls' [r] (local cap)

Fix this by sanitizing nr before using it to index dev-&gt;driver-&gt;ioctls
and drm_ioctls.

Notice that given that speculation windows are large, the policy is
to kill the speculation on the first load and not worry if it can be
completed with a dependent load/store [1].

[1] https://marc.info/?l=linux-kernel&amp;m=152449131114778&amp;w=2

Cc: stable@vger.kernel.org
Signed-off-by: Gustavo A. R. Silva &lt;gustavo@embeddedor.com&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20181220000015.GA18973@embeddedor
</content>
</entry>
</feed>
