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:   Thu, 29 Aug 2019 14:27:09 +0200
From:   Thomas Huth <thuth@...hat.com>
To:     Janosch Frank <frankja@...ux.ibm.com>, kvm@...r.kernel.org,
        Christian Borntraeger <borntraeger@...ibm.com>
Cc:     linux-kernel@...r.kernel.org, linux-kselftest@...r.kernel.org,
        David Hildenbrand <david@...hat.com>,
        Cornelia Huck <cohuck@...hat.com>,
        Radim Krčmář <rkrcmar@...hat.com>
Subject: Re: [PATCH v2] KVM: selftests: Add a test for the KVM_S390_MEM_OP
 ioctl

On 29/08/2019 14.21, Janosch Frank wrote:
> On 8/29/19 2:14 PM, Thomas Huth wrote:
>> Check that we can write and read the guest memory with this s390x
>> ioctl, and that some error cases are handled correctly.
>>
>> Signed-off-by: Thomas Huth <thuth@...hat.com>
>> ---
>>  v2: Check the ioctl also with "size" set to 0
>>
> [...]
>> +
>> +	/* Zero size: */
>> +	ksmo.gaddr = (uintptr_t)mem1;
>> +	ksmo.flags = 0;
>> +	ksmo.size = 0;
>> +	ksmo.op = KVM_S390_MEMOP_LOGICAL_WRITE;
>> +	ksmo.buf = (uintptr_t)mem1;
>> +	ksmo.ar = 0;
>> +	rv = _vcpu_ioctl(vm, VCPU_ID, KVM_S390_MEM_OP, &ksmo);
>> +	TEST_ASSERT(rv == -1, "ioctl allows 0 as size");
> 
> Test for errno == -EINVAL?

Assuming that my "Test for bad access register and size at the start
 of S390_MEM_OP" goes in first, yes, I can add that check.

Otherwise, the current kernel still returns ENOMEM.

>> +
>> +	/* Bad flags: */
>> +	ksmo.gaddr = (uintptr_t)mem1;
>> +	ksmo.flags = -1;
>> +	ksmo.size = maxsize;
>> +	ksmo.op = KVM_S390_MEMOP_LOGICAL_WRITE;
>> +	ksmo.buf = (uintptr_t)mem1;
>> +	ksmo.ar = 0;
>> +	rv = _vcpu_ioctl(vm, VCPU_ID, KVM_S390_MEM_OP, &ksmo);
>> +	TEST_ASSERT(rv == -1 && errno == EINVAL, "ioctl allows all flags?");
>> +
>> +	/* Bad operation: */
>> +	ksmo.gaddr = (uintptr_t)mem1;
>> +	ksmo.flags = 0;
>> +	ksmo.size = maxsize;
>> +	ksmo.op = -1;
>> +	ksmo.buf = (uintptr_t)mem1;
>> +	ksmo.ar = 0;
>> +	rv = _vcpu_ioctl(vm, VCPU_ID, KVM_S390_MEM_OP, &ksmo);
>> +	TEST_ASSERT(rv == -1 && errno == EINVAL, "ioctl allows all flags?");
> 
> Wrong report string
Oops, stupid copy-n-paste bug ... I'll fix it in v3...

 Thanks,
  Thomas



Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ