lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <53F37221.5020508@redhat.com>
Date:	Tue, 19 Aug 2014 17:49:53 +0200
From:	Paolo Bonzini <pbonzini@...hat.com>
To:	Chen Gang <gang.chen.5i5j@...il.com>, gleb@...nel.org
CC:	kvm@...r.kernel.org,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] virt/kvm/assigned-dev.c: Set 'dev->irq_source_id' to
 '-1' after free it

Il 19/08/2014 17:44, Chen Gang ha scritto:
> Hello maintainers:
> 
> Please help check this patch, when you have time.

Hi, it's already on its way to 3.17-rc2, but I first have to run a bunch
of tests.

Paolo

> Thanks.
> 
> On 08/08/2014 11:37 PM, Chen Gang wrote:
>> As a generic function, deassign_guest_irq() assumes it can be called
>> even if assign_guest_irq() is not be called successfully (which can be
>> triggered by ioctl from user mode, indirectly).
>>
>> So for assign_guest_irq() failure process, need set 'dev->irq_source_id'
>> to -1 after free 'dev->irq_source_id', or deassign_guest_irq() may free
>> it again.
>>
>> Signed-off-by: Chen Gang <gang.chen.5i5j@...il.com>
>> ---
>>  virt/kvm/assigned-dev.c | 4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/virt/kvm/assigned-dev.c b/virt/kvm/assigned-dev.c
>> index bf06577..5819a27 100644
>> --- a/virt/kvm/assigned-dev.c
>> +++ b/virt/kvm/assigned-dev.c
>> @@ -526,8 +526,10 @@ static int assign_guest_irq(struct kvm *kvm,
>>  		dev->irq_requested_type |= guest_irq_type;
>>  		if (dev->ack_notifier.gsi != -1)
>>  			kvm_register_irq_ack_notifier(kvm, &dev->ack_notifier);
>> -	} else
>> +	} else {
>>  		kvm_free_irq_source_id(kvm, dev->irq_source_id);
>> +		dev->irq_source_id = -1;
>> +	}
>>  
>>  	return r;
>>  }
>>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ