Need to use unswapped length to send reply in ProcXIGetSelectedEvents() (CVE-2024-31080) and ProcXiPassiveGrabDevice() (CVE-2024-31081)
This commit is contained in:
parent
5cf6ab0cf4
commit
f29b6fb075
2 changed files with 26 additions and 6 deletions
|
@ -247,9 +247,18 @@ ProcXIPassiveGrabDevice(ClientPtr client)
|
|||
}
|
||||
}
|
||||
|
||||
if (client->swapped) {
|
||||
/* save the value before SRepXIPassiveGrabDevice swaps it */
|
||||
uint32_t length = rep.length;
|
||||
WriteReplyToClient(client, sizeof(rep), &rep);
|
||||
if (length)
|
||||
WriteToClient(client, length * 4, modifiers_failed);
|
||||
}
|
||||
else {
|
||||
WriteReplyToClient(client, sizeof(rep), &rep);
|
||||
if (rep.num_modifiers)
|
||||
WriteToClient(client, rep.length * 4, modifiers_failed);
|
||||
}
|
||||
|
||||
out:
|
||||
free(modifiers_failed);
|
||||
|
|
|
@ -418,10 +418,21 @@ ProcXIGetSelectedEvents(ClientPtr client)
|
|||
}
|
||||
}
|
||||
|
||||
if (client->swapped) {
|
||||
/* save the value before SRepXIGetSelectedEvents swaps it */
|
||||
uint32_t length = reply.length;
|
||||
|
||||
WriteReplyToClient(client, sizeof(xXIGetSelectedEventsReply), &reply);
|
||||
|
||||
if (length)
|
||||
WriteToClient(client, length * 4, buffer);
|
||||
}
|
||||
else {
|
||||
WriteReplyToClient(client, sizeof(xXIGetSelectedEventsReply), &reply);
|
||||
|
||||
if (reply.num_masks)
|
||||
WriteToClient(client, reply.length * 4, buffer);
|
||||
}
|
||||
|
||||
free(buffer);
|
||||
return Success;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue