shm: Fix xselinux resource initialization for xinerama pixmaps

This is necessary to avoid a NULL pointer deference when the pixmap is
used later.

[ajax: massaged commit message, fixed it to compile]

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89748
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Brent Collins <bcollins@trustedcs.com>
(cherry picked from commit 7470578520)
This commit is contained in:
Brent Collins 2015-05-07 15:10:19 -04:00 committed by Adam Jackson
parent 4f3df05728
commit 1a87dbc2ce

View File

@ -971,6 +971,12 @@ ProcPanoramiXShmCreatePixmap(ClientPtr client)
stuff->offset);
if (pMap) {
result = XaceHook(XACE_RESOURCE_ACCESS, client, stuff->pid,
RT_PIXMAP, pMap, RT_NONE, NULL, DixCreateAccess);
if (result != Success) {
pDraw->pScreen->DestroyPixmap(pMap);
return result;
}
dixSetPrivate(&pMap->devPrivates, shmPixmapPrivateKey, shmdesc);
shmdesc->refcnt++;
pMap->drawable.serialNumber = NEXT_SERIAL_NUMBER;