Gerd Hoffmann 
		b946434f26 
		
	 
	
	
	usb: fix setup_len init (CVE-2020-14364) ... 
			Store calculated setup_len in a local variable, verify it, and only
write it to the struct (USBDevice->setup_len) in case it passed the
sanity checks.
This prevents other code (do_token_{in,out} functions specifically)
from working with invalid USBDevice->setup_len values and overrunning
the USBDevice->setup_buf[] buffer.
Fixes: CVE-2020-14364
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Tested-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Li Qiang <liq3ea@gmail.com>
Message-id: 20200825053636.29648-1-kraxel@redhat.com  
		
	 
		2020-08-31 08:23:39 +02:00 
	 
	
	
		 
	
	
		
			
			
			
			
			
			2020-08-24 16:39:53 +01:00 
		 
	
		
			
			
			
			
			
			2020-08-27 08:29:08 -04:00 
		 
	
		
			
			
			
			
			
			2020-08-21 06:30:32 -04:00 
		 
	
		
			
			
			
			
			
			2020-08-21 06:30:33 -04:00 
		 
	
		
			
			
			
			
			
			2020-08-28 15:14:40 +01:00 
		 
	
		
			
			
			
			
			
			2020-08-21 06:30:32 -04:00 
		 
	
		
			
			
			
			
			
			2020-08-21 06:30:33 -04:00 
		 
	
		
			
			
			
			
			
			2020-08-28 11:05:08 +01:00 
		 
	
		
			
			
			
			
			
			2020-08-27 14:21:48 -04:00 
		 
	
		
			
			
			
			
			
			2020-08-28 15:14:40 +01:00 
		 
	
		
			
			
			
			
			
			2020-08-24 10:01:40 +01:00 
		 
	
		
			
			
			
			
			
			2020-08-21 06:30:33 -04:00 
		 
	
		
			
			
			
			
			
			2020-08-27 14:04:55 -04:00 
		 
	
		
			
			
			
			
			
			2020-08-27 14:04:54 -04:00 
		 
	
		
			
			
			
			
			
			2020-08-21 06:30:31 -04:00 
		 
	
		
			
			
			
			
			
			2020-08-26 22:23:53 +01:00 
		 
	
		
			
			
			
			
			
			2020-08-27 14:04:54 -04:00 
		 
	
		
			
			
			
			
			
			2020-08-21 06:30:30 -04:00 
		 
	
		
			
			
			
			
			
			2020-08-28 11:05:08 +01:00 
		 
	
		
			
			
			
			
			
			2020-08-27 14:04:54 -04:00 
		 
	
		
			
			
			
			
			
			2020-08-27 14:04:54 -04:00 
		 
	
		
			
			
			
			
			
			2020-08-27 14:21:48 -04:00 
		 
	
		
			
			
			
			
			
			2020-08-21 06:30:30 -04:00 
		 
	
		
			
			
			
			
			
			2020-08-21 06:30:29 -04:00 
		 
	
		
			
			
			
			
			
			2020-08-27 14:04:55 -04:00 
		 
	
		
			
			
			
			
			
			2020-08-21 16:22:43 +02:00 
		 
	
		
			
			
			
			
			
			2020-08-21 06:30:33 -04:00 
		 
	
		
			
			
			
			
			
			2020-08-21 06:30:26 -04:00 
		 
	
		
			
			
			
			
			
			2020-08-21 06:30:33 -04:00 
		 
	
		
			
			
			
			
			
			2020-08-21 06:30:33 -04:00 
		 
	
		
			
			
			
			
			
			2020-08-28 15:14:40 +01:00 
		 
	
		
			
			
			
			
			
			2020-08-21 06:30:33 -04:00 
		 
	
		
			
			
			
			
			
			2020-08-28 15:14:40 +01:00 
		 
	
		
			
			
			
			
			
			2020-08-21 06:30:33 -04:00 
		 
	
		
			
			
			
			
			
			2020-08-21 06:30:25 -04:00 
		 
	
		
			
			
			
			
			
			2020-08-24 09:35:21 +01:00 
		 
	
		
			
			
			
			
			
			2020-08-21 06:30:33 -04:00 
		 
	
		
			
			
			
			
			
			2020-08-21 06:30:28 -04:00 
		 
	
		
			
			
			
			
			
			2020-08-21 06:30:28 -04:00 
		 
	
		
			
			
			
			
			
			2020-08-27 14:21:48 -04:00 
		 
	
		
			
			
			
			
			
			2020-08-27 14:04:55 -04:00 
		 
	
		
			
			
			
			
			
			2020-08-24 09:35:21 +01:00 
		 
	
		
			
			
			
			
			
			2020-08-21 06:30:29 -04:00 
		 
	
		
			
			
			
			
			
			2020-08-27 14:04:54 -04:00 
		 
	
		
			
			
			
			
			
			2020-08-21 06:30:27 -04:00 
		 
	
		
			
			
			
			
			
			2020-08-21 06:30:33 -04:00 
		 
	
		
			
			
			
			
			
			2020-08-27 14:04:55 -04:00 
		 
	
		
			
			
			
			
			
			2020-08-28 11:05:08 +01:00 
		 
	
		
			
			
			
			
			
			2020-08-28 15:14:40 +01:00 
		 
	
		
			
			
			
			
			
			2020-08-21 06:30:25 -04:00 
		 
	
		
			
			
			
			
			
			2020-08-21 06:30:33 -04:00 
		 
	
		
			
			
			
			
			
			2020-08-27 08:29:13 -04:00 
		 
	
		
			
			
			
			
			
			2020-08-24 09:35:21 +01:00 
		 
	
		
			
			
			
			
			
			2020-08-24 09:35:21 +01:00 
		 
	
		
			
			
			
			
			
			2020-08-21 06:30:27 -04:00 
		 
	
		
			
			
			
			
			
			2020-08-21 06:30:27 -04:00 
		 
	
		
			
			
			
			
			
			2020-08-21 06:30:27 -04:00 
		 
	
		
			
			
			
			
			
			2020-08-21 06:30:33 -04:00 
		 
	
		
			
			
			
			
			
			2020-08-21 06:30:33 -04:00 
		 
	
		
			
			
			
			
			
			2020-08-31 08:23:39 +02:00 
		 
	
		
			
			
			
			
			
			2020-08-27 14:04:55 -04:00 
		 
	
		
			
			
			
			
			
			2020-08-27 08:29:13 -04:00 
		 
	
		
			
			
			
			
			
			2020-08-21 06:30:26 -04:00 
		 
	
		
			
			
			
			
			
			2020-08-21 06:30:24 -04:00 
		 
	
		
			
			
			
			
			
			2020-08-21 06:30:33 -04:00 
		 
	
		
			
			
			
			
			
			2020-08-21 12:48:14 -07:00 
		 
	
		
			
			
			
			
			
			2020-07-11 11:02:05 +02:00 
		 
	
		
			
			
			
			
			
			2020-08-21 06:30:33 -04:00