xfixes: Fix out of bounds access in *ProcXFixesCreatePointerBarrier()
ZDI-CAN-14950, CVE-2021-4009
This vulnerability was discovered and the fix was suggested by:
Jan-Niklas Sohn working with Trend Micro Zero Day Initiative
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
(cherry picked from commit b519675009)
			
			
This commit is contained in:
		
							parent
							
								
									a82d523edb
								
							
						
					
					
						commit
						6f09e7d391
					
				|  | @ -1010,7 +1010,8 @@ ProcXFixesCreatePointerBarrier(ClientPtr client) | |||
| { | ||||
|     REQUEST(xXFixesCreatePointerBarrierReq); | ||||
| 
 | ||||
|     REQUEST_FIXED_SIZE(xXFixesCreatePointerBarrierReq, pad_to_int32(stuff->num_devices)); | ||||
|     REQUEST_FIXED_SIZE(xXFixesCreatePointerBarrierReq, | ||||
|                        pad_to_int32(stuff->num_devices * sizeof(CARD16))); | ||||
|     LEGAL_NEW_RESOURCE(stuff->barrier, client); | ||||
| 
 | ||||
|     return XICreatePointerBarrier(client, stuff); | ||||
|  | @ -1027,7 +1028,8 @@ SProcXFixesCreatePointerBarrier(ClientPtr client) | |||
| 
 | ||||
|     swaps(&stuff->length); | ||||
|     swaps(&stuff->num_devices); | ||||
|     REQUEST_FIXED_SIZE(xXFixesCreatePointerBarrierReq, pad_to_int32(stuff->num_devices)); | ||||
|     REQUEST_FIXED_SIZE(xXFixesCreatePointerBarrierReq, | ||||
|                        pad_to_int32(stuff->num_devices * sizeof(CARD16))); | ||||
| 
 | ||||
|     swapl(&stuff->barrier); | ||||
|     swapl(&stuff->window); | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue