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, 05 May 2022 13:04:07 +0100
From:   Marc Zyngier <maz@...nel.org>
To:     Oliver Upton <oupton@...gle.com>
Cc:     Raghavendra Rao Ananta <rananta@...gle.com>,
        Andrew Jones <drjones@...hat.com>,
        James Morse <james.morse@....com>,
        Alexandru Elisei <alexandru.elisei@....com>,
        Suzuki K Poulose <suzuki.poulose@....com>,
        Paolo Bonzini <pbonzini@...hat.com>,
        Catalin Marinas <catalin.marinas@....com>,
        Will Deacon <will@...nel.org>, Peter Shier <pshier@...gle.com>,
        Ricardo Koller <ricarkol@...gle.com>,
        Reiji Watanabe <reijiw@...gle.com>,
        Jing Zhang <jingzhangos@...gle.com>,
        linux-arm-kernel@...ts.infradead.org, kvmarm@...ts.cs.columbia.edu,
        linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
        linux-kselftest@...r.kernel.org
Subject: Re: [PATCH] selftests: KVM: aarch64: Let hypercalls use UAPI *_BIT_COUNT

On Wed, 04 May 2022 20:58:42 +0100,
Oliver Upton <oupton@...gle.com> wrote:
> 
> Hi Raghavendra,
> 
> On Wed, May 04, 2022 at 06:44:15PM +0000, Raghavendra Rao Ananta wrote:
> > The hypercalls test currently defines its own *_BMAP_BIT_MAX macros to
> > define the last valid feature bit for each bitmap firmware register.
> > However, since these definitions are already present in the uapi header,
> > kvm.h, as *_BMAP_BIT_COUNT, and would help to keep the test updated as
> > features grow, use these instead.
> 
> LOL, looks like I lost that one in the end! Still, the fact that you're
> patching the selftest highlights the fact that there is a nonzero chance
> of userspace using this value incorrectly expecting it to hold true
> across all kernels.
> 
> Since this is the route going forward can we please consider documenting
> the fact that _BIT_COUNT *will* change and is not stable between kernel
> versions. Bad UAPI expectations could throw a wrench into this entire
> plan we've hatched for preserving hypercall ABI.
> 
> Just a warning at the end of the register documentation would suffice.

Maybe something in the kvm.h file as well, as the includes are often
distributed without the kernel documentation. Something like:

diff --git a/arch/arm64/include/uapi/asm/kvm.h b/arch/arm64/include/uapi/asm/kvm.h
index e523bb6eac67..3cde9f958eee 100644
--- a/arch/arm64/include/uapi/asm/kvm.h
+++ b/arch/arm64/include/uapi/asm/kvm.h
@@ -342,6 +342,10 @@ struct kvm_arm_copy_mte_tags {
 
 enum {
 	KVM_REG_ARM_STD_BIT_TRNG_V1_0	= 0,
+	/*
+	 * KVM_REG_ARM_STD_BMAP_BIT_COUNT will vary as new services
+	 * are added, and is explicitely not part of the ABI.
+	 */
 	KVM_REG_ARM_STD_BMAP_BIT_COUNT,
 };
 
@@ -349,6 +353,10 @@ enum {
 
 enum {
 	KVM_REG_ARM_STD_HYP_BIT_PV_TIME	= 0,
+	/*
+	 * KVM_REG_ARM_STD_HYP_BMAP_BIT_COUNT will vary as new
+	 * services are added, and is explicitely not part of the ABI.
+	 */
 	KVM_REG_ARM_STD_HYP_BMAP_BIT_COUNT,
 };
 
@@ -357,6 +365,10 @@ enum {
 enum {
 	KVM_REG_ARM_VENDOR_HYP_BIT_FUNC_FEAT	= 0,
 	KVM_REG_ARM_VENDOR_HYP_BIT_PTP		= 1,
+	/*
+	 * KVM_REG_ARM_VENDOR_HYP_BMAP_BIT_COUNT will vary as new
+	 * services are added, and is explicitely not part of the ABI.
+	 */
 	KVM_REG_ARM_VENDOR_HYP_BMAP_BIT_COUNT,
 };

Thanks,

	M.

-- 
Without deviation from the norm, progress is not possible.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ