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: <6bfe570e35364bd121b648fe8475f705666183d6.camel@intel.com>
Date: Wed, 29 Oct 2025 21:06:46 +0000
From: "Edgecombe, Rick P" <rick.p.edgecombe@...el.com>
To: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"dave.hansen@...ux.intel.com" <dave.hansen@...ux.intel.com>
CC: "seanjc@...gle.com" <seanjc@...gle.com>, "bp@...en8.de" <bp@...en8.de>,
	"kas@...nel.org" <kas@...nel.org>, "hpa@...or.com" <hpa@...or.com>,
	"mingo@...hat.com" <mingo@...hat.com>, "tglx@...utronix.de"
	<tglx@...utronix.de>, "x86@...nel.org" <x86@...nel.org>,
	"kvm@...r.kernel.org" <kvm@...r.kernel.org>, "pbonzini@...hat.com"
	<pbonzini@...hat.com>, "Li, Xiaoyao" <xiaoyao.li@...el.com>
Subject: Re: [PATCH 1/2] x86/virt/tdx: Remove __user annotation from kernel
 pointer

For the KVM side of tdx, the commits are getting prefixed with "KVM: TDX: ", and
"x86/virt/tdx" is being used arch/x86/virt/vmx/tdx/tdx.c. It's probably not too
late to adopt the one true naming scheme. I don't have a strong preference
except some consistency and that the maintainers agree :)


On Wed, 2025-10-29 at 12:48 -0700, Dave Hansen wrote:
> From: Dave Hansen <dave.hansen@...ux.intel.com>

Pretty much the only difference between tip style logs and kvm/x86 style logs is
to lead with a short "what is the change" blurb before launching into the
background. Like:

KVM: TDX: Remove __user annotation from kernel pointer

Fix sparse warning in tdx_vcpu_get_cpuid().

There are two 'kvm_cpuid2' pointers involved here...

> 
> There are two 'kvm_cpuid2' pointers involved here. There's an "input"
> side: 'td_cpuid' which is a normal kernel pointer and an 'output'
> side. The output here is userspace and there is an attempt at properly
> annotating the variable with __user:
> 
> 	struct kvm_cpuid2 __user *output, *td_cpuid;
> 
> But, alas, this is wrong. The __user in the definition applies to both
> 'output' and 'td_cpuid'.
> 
> Fix it up by completely separating the two definitions so that it is
> obviously correct without even having to know what the C syntax rules
> even are.

If we want it:
Fixes: 488808e682e7 ("KVM: x86: Introduce KVM_TDX_GET_CPUID")

TIL on the syntax association here.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ