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]
Date: Tue, 11 Jun 2024 13:53:07 +0200
From: Christian Borntraeger <borntraeger@...ux.ibm.com>
To: Sean Christopherson <seanjc@...gle.com>, Yi Wang <up2wing@...il.com>
Cc: pbonzini@...hat.com, tglx@...utronix.de, mingo@...hat.com, bp@...en8.de,
        dave.hansen@...ux.intel.com, x86@...nel.org, hpa@...or.com,
        kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
        wanpengli@...cent.com, foxywang@...cent.com, oliver.upton@...ux.dev,
        maz@...nel.org, anup@...infault.org, atishp@...shpatra.org,
        frankja@...ux.ibm.com, imbrenda@...ux.ibm.com, weijiang.yang@...el.com
Subject: Re: [v5 3/3] KVM: s390: don't setup dummy routing when
 KVM_CREATE_IRQCHIP



Am 10.06.24 um 18:19 schrieb Sean Christopherson:
> On Mon, May 06, 2024, Yi Wang wrote:
>> From: Yi Wang <foxywang@...cent.com>
>>
>> As we have setup empty irq routing in kvm_create_vm(), there's
>> no need to setup dummy routing when KVM_CREATE_IRQCHIP.
>>
>> Signed-off-by: Yi Wang <foxywang@...cent.com>
>> ---
>>   arch/s390/kvm/kvm-s390.c | 9 +--------
>>   1 file changed, 1 insertion(+), 8 deletions(-)
>>
>> diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
>> index 5147b943a864..ba7fd39bcbf4 100644
>> --- a/arch/s390/kvm/kvm-s390.c
>> +++ b/arch/s390/kvm/kvm-s390.c
>> @@ -2998,14 +2998,7 @@ int kvm_arch_vm_ioctl(struct file *filp, unsigned int ioctl, unsigned long arg)
>>   		break;
>>   	}
>>   	case KVM_CREATE_IRQCHIP: {
>> -		struct kvm_irq_routing_entry routing;
>> -
>> -		r = -EINVAL;
>> -		if (kvm->arch.use_irqchip) {
>> -			/* Set up dummy routing. */
>> -			memset(&routing, 0, sizeof(routing));
>> -			r = kvm_set_irq_routing(kvm, &routing, 0, 0);
>> -		}
>> +		r = 0;
> 
> This is wrong, KVM_CREATE_IRQCHIP should fail with -EINVAL if kvm->arch.use_irqchip
> is false.
> 
> There's also a functional change here, though I highly doubt it negatively affects
> userspace.  Nothing in s390 prevents invoking KVM_CREATE_IRQCHIP after
> KVM_SET_GSI_ROUTING, so userspace could very theoretically use KVM_CREATE_IRQCHIP
> to reset to empty IRQ routing.
> 
> Christian, if it works for you, I'll massage it to this when applying.

Oops. Yes please do so.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ