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: <9ff5551d-79e8-4358-bbdb-cbc7e5c7c36d@suse.com>
Date: Mon, 27 Oct 2025 14:29:59 +0200
From: Nikolay Borisov <nik.borisov@...e.com>
To: David Kaplan <david.kaplan@....com>, Thomas Gleixner
 <tglx@...utronix.de>, Borislav Petkov <bp@...en8.de>,
 Peter Zijlstra <peterz@...radead.org>, Josh Poimboeuf <jpoimboe@...nel.org>,
 Pawan Gupta <pawan.kumar.gupta@...ux.intel.com>,
 Ingo Molnar <mingo@...hat.com>, Dave Hansen <dave.hansen@...ux.intel.com>,
 x86@...nel.org, "H . Peter Anvin" <hpa@...or.com>
Cc: Alexander Graf <graf@...zon.com>,
 Boris Ostrovsky <boris.ostrovsky@...cle.com>, linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH 55/56] x86/debug: Show return thunk in debugfs



On 10/13/25 17:34, David Kaplan wrote:
> Make the value of x86_return_thunk visible in debugfs to support user-space
> testing.
> 
> Signed-off-by: David Kaplan <david.kaplan@....com>

Reviewed-by: Nikolay Borisov <nik.borisov@...e.com>

> ---
>   arch/x86/kernel/cpu/bugs.c | 44 ++++++++++++++++++++++++++++++++++++++
>   1 file changed, 44 insertions(+)
> 
> diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
> index 26ceb42e0cfb..8365448b3aef 100644
> --- a/arch/x86/kernel/cpu/bugs.c
> +++ b/arch/x86/kernel/cpu/bugs.c
> @@ -16,6 +16,7 @@
>   #include <linux/sched/smt.h>
>   #include <linux/pgtable.h>
>   #include <linux/bpf.h>
> +#include <linux/debugfs.h>
>   
>   #include <asm/spec-ctrl.h>
>   #include <asm/cmdline.h>
> @@ -4065,6 +4066,49 @@ void arch_cpu_reset_mitigations(void)
>   	tsa_reset_mitigation();
>   	vmscape_reset_mitigation();
>   }
> +
> +static int rethunk_debug_show(struct seq_file *m, void *p)
> +{
> +	if (x86_return_thunk == __x86_return_thunk)
> +		seq_puts(m, "__x86_return_thunk\n");
> +	else if (x86_return_thunk == retbleed_return_thunk)
> +		seq_puts(m, "retbleed_return_thunk\n");
> +	else if (x86_return_thunk == call_depth_return_thunk)
> +		seq_puts(m, "call_depth_return_thunk\n");
> +	else if (x86_return_thunk == its_return_thunk)
> +		seq_puts(m, "its_return_thunk\n");
> +	else if (x86_return_thunk == srso_alias_return_thunk)
> +		seq_puts(m, "srso_alias_return_thunk\n");
> +	else if (x86_return_thunk == srso_return_thunk)
> +		seq_puts(m, "srso_return_thunk\n");
> +	else
> +		seq_puts(m, "unknown\n");

nit: This might be better suited for a switch construct but it's fine 
either way.

<snip>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ