Mario Kleiner b33f487a7c xfree86: Avoid crash in xf86RandR12CrtcSetGamma() memcpy path.
If randrp->palette_size is zero, the memcpy() path can read past the
end of the randr_crtc's gammaRed/Green/Blue tables if the hw crtc's
gamma_size is greater than the randr_crtc's gammaSize.

Avoid this by clamping the to-be-copied size to the smaller of both
sizes.

Note that during regular server startup, the memcpy() path is only
taken initially twice, but then a suitable palette is created for
use during a session. Therefore during an actual running X-Session,
the xf86RandR12CrtcComputeGamma() will be used, which makes sure that
data is properly up- or down-sampled for mismatching source and
target crtc gamma sizes.

This should avoid reading past randr_crtc gamma memory for gpu's
with big crtc->gamma_size, e.g., AMD/MALI/KOMEDA 4096 slots, or
Intel Icelake and later with 262145 slots.

Tested against modesetting-ddx and amdgpu-ddx under screen color
depth 24 (8 bpc) and 30 (10 bpc) to make sure that clamping happens
properly.

This is an alternative fix for the one attempted in commit
617f591fc4.

Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
(cherry picked from commit 966f567432)
2021-10-08 21:37:53 +03:00
2021-08-06 11:29:29 +00:00
2021-09-15 21:49:17 +03:00
2016-05-29 19:20:51 -07:00
2021-09-07 09:34:31 +00:00
2021-05-30 13:26:42 +03:00
2021-09-15 21:49:17 +03:00
2021-07-29 08:09:00 +00:00
2017-10-10 23:33:34 +02:00
2021-04-16 14:40:49 +00:00
2021-09-15 21:49:17 +03:00
2021-08-17 16:02:44 -04:00
2021-08-17 16:04:40 -04:00
2021-09-07 09:34:31 +00:00
2021-08-06 11:29:29 +00:00
2021-09-21 23:37:48 +03:00
2021-09-15 21:49:17 +03:00
2018-05-08 12:15:30 -04:00
2021-09-15 21:49:17 +03:00
2021-09-21 23:37:48 +03:00
2020-07-05 13:07:33 -07:00

X Server

The X server accepts requests from client applications to create windows, which are (normally rectangular) "virtual screens" that the client program can draw into.

Windows are then composed on the actual screen by the X server (or by a separate composite manager) as directed by the window manager, which usually communicates with the user via graphical controls such as buttons and draggable titlebars and borders.

For a comprehensive overview of X Server and X Window System, consult the following article: https://en.wikipedia.org/wiki/X_server

All questions regarding this software should be directed at the Xorg mailing list:

https://lists.freedesktop.org/mailman/listinfo/xorg

The primary development code repository can be found at:

https://gitlab.freedesktop.org/xorg/xserver

For patch submission instructions, see:

https://www.x.org/wiki/Development/Documentation/SubmittingPatches

As with other projects hosted on freedesktop.org, X.Org follows its Code of Conduct, based on the Contributor Covenant. Please conduct yourself in a respectful and civilized manner when using the above mailing lists, bug trackers, etc:

https://www.freedesktop.org/wiki/CodeOfConduct

Description
Truly free fork of the XOrg project.
Readme 94 MiB
Languages
C 96.4%
Roff 1.1%
Objective-C 1%
Meson 0.9%
Shell 0.2%
Other 0.2%