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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210703152144.GB3004@amd>
Date:   Sat, 3 Jul 2021 17:21:45 +0200
From:   Pavel Machek <pavel@...x.de>
To:     Sasha Levin <sashal@...nel.org>
Cc:     linux-kernel@...r.kernel.org, stable@...r.kernel.org,
        Fuad Tabba <tabba@...gle.com>,
        Paolo Bonzini <pbonzini@...hat.com>
Subject: Re: [PATCH 5.10 049/101] KVM: selftests: Fix kvm_check_cap()
 assertion

Hi!

> From: Fuad Tabba <tabba@...gle.com>
> 
> [ Upstream commit d8ac05ea13d789d5491a5920d70a05659015441d ]
> 
> KVM_CHECK_EXTENSION ioctl can return any negative value on error,
> and not necessarily -1. Change the assertion to reflect that.
> 
> Signed-off-by: Fuad Tabba <tabba@...gle.com>

This is userland code, right?

> +++ b/tools/testing/selftests/kvm/lib/kvm_util.c
> @@ -55,7 +55,7 @@ int kvm_check_cap(long cap)
>  		exit(KSFT_SKIP);
>  
>  	ret = ioctl(kvm_fd, KVM_CHECK_EXTENSION, cap);
> -	TEST_ASSERT(ret != -1, "KVM_CHECK_EXTENSION IOCTL failed,\n"
> +	TEST_ASSERT(ret >= 0, "KVM_CHECK_EXTENSION IOCTL failed,\n"
>  		"  rc: %i errno: %i", ret, errno);

And syscalls return -1 on error in userland, not anything else. So
this should not be needed.

Best regards,
								Pavel
--
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ