Comment 29 for bug 1751252

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Unfortunately I can't tell what in shm_access is failing exactly because gdb skips straight from shm.c:314 back to the caller. So that suggests this code path, but I can't verify it:

static int
shm_access(ClientPtr client, SHMPERM_TYPE * perm, int readonly)
{
    int uid, gid;
    mode_t mask;
    int uidset = 0, gidset = 0;
    LocalClientCredRec *lcc;

    if (GetLocalClientCreds(client, &lcc) != -1) { // FALSE
    ...
    }
    /* Otherwise, check everyone else */
    mask = S_IROTH;
    if (!readonly) {
        mask |= S_IWOTH;
    }
    return (SHMPERM_MODE(perm) & mask) == mask ? 0 : -1;
}

So Xorg _should_ be returning an error, and it is. The problem seems to be that the client (python3 gtk_ui process) has a real uid=0 and effective uid=999. So that allows it to connect to Xorg (normally Xorg rejects root clients), but doesn't allow Xorg to check the client shm permissions. So Xorg rejects the client's attempt at XShmAttach.

How any of this relates to scale=200% and why it works at 100%, I'm not sure. We might need to review comment #15 in more detail.