From: Mario Kleiner <mario.kleiner.de-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Cc: mario.kleiner.de-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Subject: [PATCH 1/3] Fix xf86HandleColormaps() crash at color depth 30.
Date: Mon, 18 Dec 2017 23:36:43 +0100 [thread overview]
Message-ID: <20171218223645.25142-2-mario.kleiner.de@gmail.com> (raw)
In-Reply-To: <20171218223645.25142-1-mario.kleiner.de-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
The size of the X-Server pScreenPriv->PreAllocIndices
array allocated within xf86HandleColormaps() is given
by the given maxColors argument, but the range of
indices by which the PreAllocIndices array is indexed
in routines like CMapReinstallMap() seems to be up to
1023 on a 10 bpc / depth 30 screen, leading to an
out-of-bounds access and server crash.
Raising maxColors to 1024 fixes the crash at server
startup with X-Screen color depth 30.
Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
---
src/drmmode_display.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 7ad3235..67db86e 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -2730,8 +2730,9 @@ Bool drmmode_setup_colormap(ScreenPtr pScreen, ScrnInfoPtr pScrn)
"Initializing kms color map\n");
if (!miCreateDefColormap(pScreen))
return FALSE;
+
/* all radeons support 10 bit CLUTs */
- if (!xf86HandleColormaps(pScreen, 256, 10,
+ if (!xf86HandleColormaps(pScreen, 1024, 10,
NULL, NULL,
CMAP_PALETTED_TRUECOLOR
#if 0 /* This option messes up text mode! (eich@suse.de) */
--
2.7.4
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
next prev parent reply other threads:[~2017-12-18 22:36 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-18 22:36 Depth 30 enablement for ati-ddx + exa Mario Kleiner
[not found] ` <20171218223645.25142-1-mario.kleiner.de-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-12-18 22:36 ` Mario Kleiner [this message]
[not found] ` <20171218223645.25142-2-mario.kleiner.de-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-12-19 8:58 ` [PATCH 1/3] Fix xf86HandleColormaps() crash at color depth 30 Michel Dänzer
[not found] ` <3e792109-b517-4f4c-26eb-033b903bfba8-otUistvHUpPR7s880joybQ@public.gmane.org>
2017-12-22 1:49 ` Mario Kleiner
[not found] ` <bd1746c1-63ed-eed4-5dae-c79e6a88c9e3-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-12-22 8:57 ` Michel Dänzer
2017-12-18 22:36 ` [PATCH 2/3] exa: Accelerate ARGB2101010 pictures Mario Kleiner
[not found] ` <20171218223645.25142-3-mario.kleiner.de-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-12-22 1:56 ` Fredrik Höglund
2017-12-18 22:36 ` [PATCH 3/3] Support exa screen color depth 30 on Linux 3.16 and later Mario Kleiner
[not found] ` <20171218223645.25142-4-mario.kleiner.de-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-12-19 9:05 ` Michel Dänzer
2017-12-19 9:09 ` Depth 30 enablement for ati-ddx + exa Michel Dänzer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171218223645.25142-2-mario.kleiner.de@gmail.com \
--to=mario.kleiner.de-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox