mirror of
				git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
				synced 2025-11-01 09:13:37 +00:00 
			
		
		
		
	KVM: PPC: Keep index within boundaries in kvmppc_44x_emul_tlbwe()
An index of KVM44x_GUEST_TLB_SIZE is already one too large. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Acked-by: Hollis Blanchard <hollis@penguinppc.org> Acked-by: Alexander Graf <agraf@suse.de> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
This commit is contained in:
		
							parent
							
								
									f8c5fae166
								
							
						
					
					
						commit
						4f018c513a
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -440,7 +440,7 @@ int kvmppc_44x_emul_tlbwe(struct kvm_vcpu *vcpu, u8 ra, u8 rs, u8 ws)
 | 
			
		|||
	unsigned int gtlb_index;
 | 
			
		||||
 | 
			
		||||
	gtlb_index = kvmppc_get_gpr(vcpu, ra);
 | 
			
		||||
	if (gtlb_index > KVM44x_GUEST_TLB_SIZE) {
 | 
			
		||||
	if (gtlb_index >= KVM44x_GUEST_TLB_SIZE) {
 | 
			
		||||
		printk("%s: index %d\n", __func__, gtlb_index);
 | 
			
		||||
		kvmppc_dump_vcpu(vcpu);
 | 
			
		||||
		return EMULATE_FAIL;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue