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: <f83a4f26-f6eb-2be6-0111-39ac066a45f8@redhat.com>
Date:   Tue, 1 Dec 2020 16:47:31 +0100
From:   Paolo Bonzini <pbonzini@...hat.com>
To:     Pavel Machek <pavel@...x.de>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:     linux-kernel@...r.kernel.org, stable@...r.kernel.org,
        David Woodhouse <dwmw@...zon.co.uk>,
        Nikos Tsironis <ntsironis@...ikto.com>
Subject: Re: [PATCH 4.19 08/57] KVM: x86: Fix split-irqchip vs interrupt
 injection window request

On 01/12/20 16:33, Pavel Machek wrote:
> Hi!
> 
>> - in order to tell userspace we will inject its interrupt ("IRQ
>>    window open" i.e. kvm_vcpu_ready_for_interrupt_injection), both
>>    KVM and the vCPU need to be ready to accept the interrupt.
>>
>> ... and this is what the patch implements.
>>
>> Reported-by: David Woodhouse <dwmw@...zon.co.uk>
>> Analyzed-by: David Woodhouse <dwmw@...zon.co.uk>
>> Cc: stable@...r.kernel.org
> 
> This makes no difference for -stable, but the patch is confused about
> types:
> 
>> +++ b/arch/x86/kvm/x86.c
>> @@ -3351,21 +3351,23 @@ static int kvm_vcpu_ioctl_set_lapic(stru
>>   
>>   static int kvm_cpu_accept_dm_intr(struct kvm_vcpu *vcpu)
>>   {
>> +	/*
>> +	 * We can accept userspace's request for interrupt injection
>> +	 * as long as we have a place to store the interrupt number.
>> +	 * The actual injection will happen when the CPU is able to
>> +	 * deliver the interrupt.
>> +	 */
>> +	if (kvm_cpu_has_extint(vcpu))
>> +		return false;
> 
> Since function is "static int" it should probably return 0.

Other way round, it should return static bool. :)  At least it's 
consistently returning a boolean expression, never e.g. negative errno.

Paolo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ