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: <54B3CEB3.1010709@linaro.org>
Date:	Mon, 12 Jan 2015 14:40:03 +0100
From:	Eric Auger <eric.auger@...aro.org>
To:	Christoffer Dall <christoffer.dall@...aro.org>
CC:	eric.auger@...com, marc.zyngier@....com,
	linux-arm-kernel@...ts.infradead.org, kvmarm@...ts.cs.columbia.edu,
	kvm@...r.kernel.org, alex.williamson@...hat.com, agraf@...e.de,
	joel.schopp@....com, gleb@...nel.org, pbonzini@...hat.com,
	borntraeger@...ibm.com, cornelia.huck@...ibm.com,
	linux-kernel@...r.kernel.org, patches@...aro.org,
	a.motakis@...tualopensystems.com
Subject: Re: [PATCH v5 4/5] KVM: irqfd: use kvm_arch_is_virtual_intc_initialized

On 01/11/2015 10:17 PM, Christoffer Dall wrote:
> On Wed, Dec 03, 2014 at 05:07:11PM +0100, Eric Auger wrote:
>> On arm/arm64, the interrupt controller is dynamically instantiated.
>> There is a risk the user-space assigns an irqfd before this latter
>> is initialized and ready to accept virtual irq injection. On such
>> attempt, the IRQFD setup is rejected and -EAGAIN is returned.
>>
>> Signed-off-by: Eric Auger <eric.auger@...aro.org>
>> ---
>>  virt/kvm/eventfd.c | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c
>> index b0fb390..f837c83 100644
>> --- a/virt/kvm/eventfd.c
>> +++ b/virt/kvm/eventfd.c
>> @@ -314,6 +314,9 @@ kvm_irqfd_assign(struct kvm *kvm, struct kvm_irqfd *args)
>>  	unsigned int events;
>>  	int idx;
>>  
>> +	if (!kvm_arch_is_virtual_intc_initialized(kvm))
>> +		return -EAGAIN;
>> +
> 
> You can fold this into the patch that defines the static inline since
> nothing defines the KVM_HAVE_ARCH_... yet.
Not sure to understand what you mean:
__KVM_HAVE_ARCH_VIRTUAL_INTC_INITIALIZED was defined in previous patch
file (3/5). Nethertheless I can drop that patch file.

Thanks

Eric
> 
>>  	irqfd = kzalloc(sizeof(*irqfd), GFP_KERNEL);
>>  	if (!irqfd)
>>  		return -ENOMEM;
>> -- 
>> 1.9.1
>>

--
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