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: <20250109052237.pq4irr2iycitl5il@desk>
Date: Wed, 8 Jan 2025 21:22:37 -0800
From: Pawan Gupta <pawan.kumar.gupta@...ux.intel.com>
To: David Kaplan <david.kaplan@....com>
Cc: Thomas Gleixner <tglx@...utronix.de>, Borislav Petkov <bp@...en8.de>,
	Peter Zijlstra <peterz@...radead.org>,
	Josh Poimboeuf <jpoimboe@...nel.org>,
	Ingo Molnar <mingo@...hat.com>,
	Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
	"H . Peter Anvin" <hpa@...or.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 12/35] x86/bugs: Restructure retbleed mitigation

On Wed, Jan 08, 2025 at 02:24:52PM -0600, David Kaplan wrote:
[...]
> @@ -1064,6 +1063,7 @@ enum spectre_v2_mitigation spectre_v2_enabled __ro_after_init = SPECTRE_V2_NONE;
>  
>  enum retbleed_mitigation {
>  	RETBLEED_MITIGATION_NONE,
> +	RETBLEED_MITIGATION_AUTO,

This new enum ...

>  	RETBLEED_MITIGATION_UNRET,
>  	RETBLEED_MITIGATION_IBPB,
>  	RETBLEED_MITIGATION_IBRS,
> @@ -1071,14 +1071,6 @@ enum retbleed_mitigation {
>  	RETBLEED_MITIGATION_STUFF,
>  };
>  
> -enum retbleed_mitigation_cmd {
> -	RETBLEED_CMD_OFF,
> -	RETBLEED_CMD_AUTO,
> -	RETBLEED_CMD_UNRET,
> -	RETBLEED_CMD_IBPB,
> -	RETBLEED_CMD_STUFF,
> -};
> -
>  static const char * const retbleed_strings[] = {
>  	[RETBLEED_MITIGATION_NONE]	= "Vulnerable",
>  	[RETBLEED_MITIGATION_UNRET]	= "Mitigation: untrained return thunk",

... does not have a corresponding entry in the strings array. AUTO is the
default, and it is possible that mitigation mode can stay AUTO throughout
the retbleed mitigation selection depending on cmdline and CONFIGs. e.g.
retbleed=stuff and spectre_v2=off.

Other issue is below print in retbleed_update_mitigation() will dereference
a NULL pointer:

	pr_info("%s\n", retbleed_strings[retbleed_mitigation]);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ