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: <a6c2ddf8-422a-0b4d-2f83-ba43523d8acc@suse.com>
Date:   Mon, 21 Aug 2023 08:50:33 +0300
From:   Nikolay Borisov <nik.borisov@...e.com>
To:     Josh Poimboeuf <jpoimboe@...nel.org>, x86@...nel.org
Cc:     linux-kernel@...r.kernel.org, Borislav Petkov <bp@...en8.de>,
        Peter Zijlstra <peterz@...radead.org>,
        Babu Moger <babu.moger@....com>,
        Paolo Bonzini <pbonzini@...hat.com>,
        Sean Christopherson <seanjc@...gle.com>, David.Kaplan@....com,
        Andrew Cooper <andrew.cooper3@...rix.com>,
        gregkh@...uxfoundation.org, Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH 16/22] x86/srso: Unexport untraining functions



On 21.08.23 г. 4:19 ч., Josh Poimboeuf wrote:
> These functions aren't called outside of retpoline.S.
> 
> Signed-off-by: Josh Poimboeuf <jpoimboe@...nel.org>
> ---
>   arch/x86/include/asm/nospec-branch.h | 4 ----
>   arch/x86/lib/retpoline.S             | 7 ++-----
>   2 files changed, 2 insertions(+), 9 deletions(-)
> 
> diff --git a/arch/x86/include/asm/nospec-branch.h b/arch/x86/include/asm/nospec-branch.h
> index 197ff4f4d1ce..6c14fd1f5912 100644
> --- a/arch/x86/include/asm/nospec-branch.h
> +++ b/arch/x86/include/asm/nospec-branch.h
> @@ -352,10 +352,6 @@ extern void retbleed_return_thunk(void);
>   extern void srso_return_thunk(void);
>   extern void srso_alias_return_thunk(void);
>   
> -extern void retbleed_untrain_ret(void);
> -extern void srso_untrain_ret(void);
> -extern void srso_alias_untrain_ret(void);
> -
>   extern void entry_untrain_ret(void);
>   extern void entry_ibpb(void);
>   
> diff --git a/arch/x86/lib/retpoline.S b/arch/x86/lib/retpoline.S
> index cd86aeb5fdd3..5e3b016c6d3e 100644
> --- a/arch/x86/lib/retpoline.S
> +++ b/arch/x86/lib/retpoline.S
> @@ -157,7 +157,6 @@ SYM_START(srso_alias_untrain_ret, SYM_L_GLOBAL, SYM_A_NONE)
>   	lfence
>   	jmp srso_alias_return_thunk
>   SYM_FUNC_END(srso_alias_untrain_ret)
> -__EXPORT_THUNK(srso_alias_untrain_ret)
>   
>   	.section .text..__x86.rethunk_safe
>   #else
> @@ -216,7 +215,7 @@ SYM_CODE_END(srso_alias_return_thunk)
>    */
>   	.align 64
>   	.skip 64 - (retbleed_return_thunk - retbleed_untrain_ret), 0xcc
> -SYM_START(retbleed_untrain_ret, SYM_L_GLOBAL, SYM_A_NONE)
> +SYM_START(retbleed_untrain_ret, SYM_L_LOCAL, SYM_A_NONE)

nit: There's already SYM_FUNC_START_LOCAL_NOALIGN


>   	ANNOTATE_NOENDBR
>   	/*
>   	 * As executed from retbleed_untrain_ret, this is:
> @@ -264,7 +263,6 @@ SYM_CODE_END(retbleed_return_thunk)
>   	jmp retbleed_return_thunk
>   	int3
>   SYM_FUNC_END(retbleed_untrain_ret)
> -__EXPORT_THUNK(retbleed_untrain_ret)
>   
>   /*
>    * SRSO untraining sequence for Zen1/2, similar to retbleed_untrain_ret()
> @@ -278,7 +276,7 @@ __EXPORT_THUNK(retbleed_untrain_ret)
>    */
>   	.align 64
>   	.skip 64 - (srso_safe_ret - srso_untrain_ret), 0xcc
> -SYM_START(srso_untrain_ret, SYM_L_GLOBAL, SYM_A_NONE)
> +SYM_START(srso_untrain_ret, SYM_L_LOCAL, SYM_A_NONE)
>   	ANNOTATE_NOENDBR
>   	.byte 0x48, 0xb8
>   
> @@ -299,7 +297,6 @@ SYM_INNER_LABEL(srso_safe_ret, SYM_L_GLOBAL)
>   	ud2
>   SYM_CODE_END(srso_safe_ret)
>   SYM_FUNC_END(srso_untrain_ret)
> -__EXPORT_THUNK(srso_untrain_ret)
>   
>   SYM_CODE_START(srso_return_thunk)
>   	UNWIND_HINT_FUNC

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ