Skip to content

Commit

Permalink
SecurityResource should not segfault when client owning resource has …
Browse files Browse the repository at this point in the history
…exited

Fixes OpenSolaris bug 6949754:
  Xorg crashes when the magnifier is enabled at gdm login greeter window.
  http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6949754

Signed-off-by: Alan Coopersmith <[email protected]>
Reviewed-by: Eamon Walsh <[email protected]>
  • Loading branch information
Sam Lau authored and alanc committed Jun 11, 2010
1 parent 07a093a commit 1c08a37
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Xext/security.c
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,6 @@ SecurityResource(CallbackListPtr *pcbl, pointer unused, pointer calldata)
Mask allowed = SecurityResourceMask;

subj = dixLookupPrivate(&rec->client->devPrivates, stateKey);
obj = dixLookupPrivate(&clients[cid]->devPrivates, stateKey);

/* disable background None for untrusted windows */
if ((requested & DixCreateAccess) && (rec->rtype == RT_WINDOW))
Expand All @@ -831,8 +830,11 @@ SecurityResource(CallbackListPtr *pcbl, pointer unused, pointer calldata)
allowed |= DixReadAccess;
}

if (SecurityDoCheck(subj, obj, requested, allowed) == Success)
return;
if (clients[cid] != NULL) {
obj = dixLookupPrivate(&clients[cid]->devPrivates, stateKey);
if (SecurityDoCheck(subj, obj, requested, allowed) == Success)
return;
}

SecurityAudit("Security: denied client %d access %x to resource 0x%x "
"of client %d on request %s\n", rec->client->index,
Expand Down

0 comments on commit 1c08a37

Please sign in to comment.