<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/drivers/gpu/drm/drm_ioctl.c, branch linux-5.1.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-5.1.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-5.1.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2019-06-15T09:52:49Z</updated>
<entry>
<title>Revert "drm: allow render capable master with DRM_AUTH ioctls"</title>
<updated>2019-06-15T09:52:49Z</updated>
<author>
<name>Dave Airlie</name>
<email>airlied@redhat.com</email>
</author>
<published>2019-04-17T20:46:33Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=c2d2804b9939402f6ac9514d049e4469b6e1cb5d'/>
<id>urn:sha1:c2d2804b9939402f6ac9514d049e4469b6e1cb5d</id>
<content type='text'>
[ Upstream commit dbb92471674a48892f5e50779425e03388073ab9 ]

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;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>drm: allow render capable master with DRM_AUTH ioctls</title>
<updated>2019-02-13T17:42:36Z</updated>
<author>
<name>Emil Velikov</name>
<email>emil.velikov@collabora.com</email>
</author>
<published>2019-01-14T08:54:08Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/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:45Z</updated>
<author>
<name>Emil Velikov</name>
<email>emil.velikov@collabora.com</email>
</author>
<published>2019-01-14T08:43:05Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/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:29Z</updated>
<author>
<name>Gustavo A. R. Silva</name>
<email>gustavo@embeddedor.com</email>
</author>
<published>2018-12-20T00:00:15Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/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>
<entry>
<title>drm: Return -EOPNOTSUPP in drm_setclientcap() when driver do not support KMS</title>
<updated>2018-09-21T09:19:40Z</updated>
<author>
<name>José Roberto de Souza</name>
<email>jose.souza@intel.com</email>
</author>
<published>2018-09-18T17:48:09Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=adbc8208e6620ddfa10fd863cb0a4ec0c54d8625'/>
<id>urn:sha1:adbc8208e6620ddfa10fd863cb0a4ec0c54d8625</id>
<content type='text'>
All DRM_CLIENT capabilities are tied to KMS support, so returning
-EOPNOTSUPP when KMS is not supported.

v2: returning -EOPNOTSUPP(same value as posix ENOTSUP and available
in uapi) instead of -ENOTSUPP

v3: adding comments about the feature requirement about capabilities

Cc: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Signed-off-by: José Roberto de Souza &lt;jose.souza@intel.com&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20180918174809.17123-1-jose.souza@intel.com
</content>
</entry>
<entry>
<title>drm: Differentiate the lack of an interface from invalid parameter</title>
<updated>2018-09-14T16:29:47Z</updated>
<author>
<name>Chris Wilson</name>
<email>chris@chris-wilson.co.uk</email>
</author>
<published>2018-09-13T19:20:50Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=69fdf4206a8ba91a277b3d50a3a05b71247635b2'/>
<id>urn:sha1:69fdf4206a8ba91a277b3d50a3a05b71247635b2</id>
<content type='text'>
If the ioctl is not supported on a particular piece of HW/driver
combination, report ENOTSUP (aka EOPNOTSUPP) so that it can be easily
distinguished from both the lack of the ioctl and from a regular invalid
parameter.

v2: Across all the kms ioctls we had a mixture of reporting EINVAL,
ENODEV and a few ENOTSUPP (most where EINVAL) for a failed
drm_core_check_feature(). Update everybody to report ENOTSUPP.

v3: ENOTSUPP is an internal errno! It's value (524) does not correspond
to a POSIX errno, the one we want is ENOTSUP. However,
uapi/asm-generic/errno.h doesn't include ENOTSUP but man errno says

	"ENOTSUP and EOPNOTSUPP have the same value on Linux,
	but according to POSIX.1 these error values should be
	distinct."

so use EOPNOTSUPP as its equivalent.

Signed-off-by: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Cc: Daniel Vetter &lt;daniel@ffwll.ch&gt;
Cc: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Reviewed-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt; #v2
Link: https://patchwork.freedesktop.org/patch/msgid/20180913192050.24812-1-chris@chris-wilson.co.uk
</content>
</entry>
<entry>
<title>drm: refuse ADDFB2 ioctl for broken bigendian drivers</title>
<updated>2018-09-10T05:10:36Z</updated>
<author>
<name>Gerd Hoffmann</name>
<email>kraxel@redhat.com</email>
</author>
<published>2018-09-07T07:32:13Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=eae06120f1974e1a4cab0f80f4b07d27eb80ab32'/>
<id>urn:sha1:eae06120f1974e1a4cab0f80f4b07d27eb80ab32</id>
<content type='text'>
Drivers must set the quirk_addfb_prefer_host_byte_order quirk to make
the drm_mode_addfb() compat code work correctly on bigendian machines.

If they don't they interpret pixel_format values incorrectly for bug
compatibility, which in turn implies the ADDFB2 ioctl does not work
correctly then.  So block it to make userspace fallback to ADDFB.

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/20180907073213.20410-1-kraxel@redhat.com
</content>
</entry>
<entry>
<title>drm: drop _mode_ from remaining connector functions</title>
<updated>2018-07-13T16:40:27Z</updated>
<author>
<name>Daniel Vetter</name>
<email>daniel.vetter@ffwll.ch</email>
</author>
<published>2018-07-09T08:40:08Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=97e14fbeb53fe060c5f6a7a07e37fd24c087ed0c'/>
<id>urn:sha1:97e14fbeb53fe060c5f6a7a07e37fd24c087ed0c</id>
<content type='text'>
Since there's very few callers of these I've decided to do them all in
one patch. With this the unecessarily long drm_mode_connector_ prefix
is gone from the codebase! The only exception being struct
drm_mode_connector_set_property, which is part of the uapi so can't be
renamed.

Again done with sed+some manual fixups for indent issues.

Reviewed-by: Sean Paul &lt;seanpaul@chromium.org&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20180709084016.23750-8-daniel.vetter@ffwll.ch
</content>
</entry>
<entry>
<title>drm: Make ioctls available for in-kernel clients</title>
<updated>2018-06-25T14:20:14Z</updated>
<author>
<name>Noralf Trønnes</name>
<email>noralf@tronnes.org</email>
</author>
<published>2018-06-18T14:17:30Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=d30827ce0df4410648c3fbba48681d7aafb19f36'/>
<id>urn:sha1:d30827ce0df4410648c3fbba48681d7aafb19f36</id>
<content type='text'>
Make ioctl wrappers for functions that will be used by the in-kernel API.
The following functions are touched:
- drm_mode_create_dumb_ioctl()
- drm_mode_destroy_dumb_ioctl()
- drm_mode_addfb()
- drm_mode_rmfb()

Signed-off-by: Noralf Trønnes &lt;noralf@tronnes.org&gt;
Reviewed-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20180618141739.48151-4-noralf@tronnes.org
</content>
</entry>
<entry>
<title>drm: writeback: Add client capability for exposing writeback connectors</title>
<updated>2018-06-20T14:30:20Z</updated>
<author>
<name>Liviu Dudau</name>
<email>Liviu.Dudau@arm.com</email>
</author>
<published>2018-02-28T14:11:23Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=d67b6a2065076d763c7df626b8c54f16038ad862'/>
<id>urn:sha1:d67b6a2065076d763c7df626b8c54f16038ad862</id>
<content type='text'>
Due to the fact that writeback connectors behave in a special way
in DRM (they always report being disconnected) we might confuse some
userspace. Add a client capability for writeback connectors that will
filter them out for clients that don't understand the capability.

Changelog:
 - only accept the capability if the client has already set the
DRM_CLIENT_CAP_ATOMIC one.

Cc: Sean Paul &lt;seanpaul@chromium.org&gt;
Cc: Brian Starkey &lt;brian.starkey@arm.com&gt;
Signed-off-by: Liviu Dudau &lt;liviu.dudau@arm.com&gt;
Reviewed-by: Eric Anholt &lt;eric@anholt.net&gt;
Reviewed-by: Brian Starkey &lt;brian.starkey@arm.com&gt;
Link: https://patchwork.freedesktop.org/patch/229038/
</content>
</entry>
</feed>
