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 Feb 2024 11:49:13 +1300
From: "Huang, Kai" <kai.huang@...el.com>
To: <isaku.yamahata@...el.com>, <kvm@...r.kernel.org>,
	<linux-kernel@...r.kernel.org>
CC: <isaku.yamahata@...il.com>, Paolo Bonzini <pbonzini@...hat.com>,
	<erdemaktas@...gle.com>, Sean Christopherson <seanjc@...gle.com>, Sagi Shahar
	<sagis@...gle.com>, <chen.bo@...el.com>, <hang.yuan@...el.com>,
	<tina.zhang@...el.com>, "Kirill A. Shutemov"
	<kirill.shutemov@...ux.intel.com>
Subject: Re: [PATCH v19 008/130] x86/tdx: Warning with 32bit build
 shift-count-overflow



On 26/02/2024 9:25 pm, isaku.yamahata@...el.com wrote:
> From: Isaku Yamahata <isaku.yamahata@...el.com>
> 
> This patch fixes the following warnings.
> 
>     In file included from arch/x86/kernel/asm-offsets.c:22:
>     arch/x86/include/asm/tdx.h:92:87: warning: shift count >= width of type [-Wshift-count-overflow]
>     arch/x86/include/asm/tdx.h:20:21: note: expanded from macro 'TDX_ERROR'
>     #define TDX_ERROR                       _BITUL(63)
> 
>                                             ^~~~~~~~~~
> 
> Also consistently use ULL for TDX_SEAMCALL_VMFAILINVALID.
> 
> Fixes: 527a534c7326 ("x86/tdx: Provide common base for SEAMCALL and TDCALL C wrappers")

+Kirill.

This kinda fix should be sent out as a separate patch.

> Signed-off-by: Isaku Yamahata <isaku.yamahata@...el.com>
> ---
>   arch/x86/include/asm/tdx.h | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/x86/include/asm/tdx.h b/arch/x86/include/asm/tdx.h
> index 16be3a1e4916..1e9dcdf9912b 100644
> --- a/arch/x86/include/asm/tdx.h
> +++ b/arch/x86/include/asm/tdx.h
> @@ -17,9 +17,9 @@
>    * Bits 47:40 == 0xFF indicate Reserved status code class that never used by
>    * TDX module.
>    */
> -#define TDX_ERROR			_BITUL(63)
> +#define TDX_ERROR			_BITULL(63)
>   #define TDX_SW_ERROR			(TDX_ERROR | GENMASK_ULL(47, 40))
> -#define TDX_SEAMCALL_VMFAILINVALID	(TDX_SW_ERROR | _UL(0xFFFF0000))
> +#define TDX_SEAMCALL_VMFAILINVALID	(TDX_SW_ERROR | _ULL(0xFFFF0000))
>   
>   #define TDX_SEAMCALL_GP			(TDX_SW_ERROR | X86_TRAP_GP)
>   #define TDX_SEAMCALL_UD			(TDX_SW_ERROR | X86_TRAP_UD)

Both TDX guest and TDX host code depends on X86_64 in the Kconfig.  This 
issue seems due to asm-offsets.c includes <asm/tdx.h> unconditionally.

It doesn't make sense to generate any TDX related code in asm-offsets.h 
so I am wondering whether it is better to just make the inclusion of 
<asm/tdx.h> conditionally or move it the asm-offsets_64.c?


Kirill what's your opinion?

Btw after quick try seems I cannot reproduce this (w/o this KVM TDX 
patchset).  Isaku, could you share your .config?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ