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: <97a527916663b2f87c5ed2046637c2a8b27eb629.camel@amazon.com>
Date: Thu, 24 Oct 2024 10:19:22 +0000
From: "Gowans, James" <jgowans@...zon.com>
To: "kvm@...r.kernel.org" <kvm@...r.kernel.org>, "pbonzini@...hat.com"
	<pbonzini@...hat.com>, "shuah@...nel.org" <shuah@...nel.org>,
	"linux-kselftest@...r.kernel.org" <linux-kselftest@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>, "Roy, Patrick"
	<roypat@...zon.co.uk>
CC: "ackerleytng@...gle.com" <ackerleytng@...gle.com>, "Graf (AWS), Alexander"
	<graf@...zon.de>, "chao.p.peng@...ux.intel.com"
	<chao.p.peng@...ux.intel.com>, "seanjc@...gle.com" <seanjc@...gle.com>
Subject: Re: [PATCH] kvm: selftest: fix noop test in guest_memfd_test.c

On Thu, 2024-10-24 at 10:59 +0100, Patrick Roy wrote:
> The loop in test_create_guest_memfd_invalid that is supposed to test
> that nothing is accepted as a valid flag to KVM_CREATE_GUEST_MEMFD was
> initializing `flag` as 0 instead of BIT(0). This caused the loop to
> immediately exit instead of iterating over BIT(0), BIT(1), ... .
> 
> Fixes: 8a89efd43423 ("KVM: selftests: Add basic selftest for guest_memfd()")
> Signed-off-by: Patrick Roy <roypat@...zon.co.uk>
> ---
>  tools/testing/selftests/kvm/guest_memfd_test.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/kvm/guest_memfd_test.c b/tools/testing/selftests/kvm/guest_memfd_test.c
> index ba0c8e9960358..ce687f8d248fc 100644
> --- a/tools/testing/selftests/kvm/guest_memfd_test.c
> +++ b/tools/testing/selftests/kvm/guest_memfd_test.c
> @@ -134,7 +134,7 @@ static void test_create_guest_memfd_invalid(struct kvm_vm *vm)
>  			    size);
>  	}
>  
> -	for (flag = 0; flag; flag <<= 1) {
> +	for (flag = BIT(0); flag; flag <<= 1) {
>  		fd = __vm_create_guest_memfd(vm, page_size, flag);
>  		TEST_ASSERT(fd == -1 && errno == EINVAL,
>  			    "guest_memfd() with flag '0x%lx' should fail with EINVAL",

Reviewed-by: James Gowans <jgowans@...zon.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ