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: <20241029113702.GUZyDI3u_6IxiCWOBJ@fat_crate.local>
Date: Tue, 29 Oct 2024 12:37:02 +0100
From: Borislav Petkov <bp@...en8.de>
To: Daniel Sneddon <daniel.sneddon@...ux.intel.com>
Cc: Jonathan Corbet <corbet@....net>, Thomas Gleixner <tglx@...utronix.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,
	hpa@...or.com, linux-doc@...r.kernel.org,
	linux-kernel@...r.kernel.org, pawan.kumar.gupta@...ux.intel.com
Subject: Re: [PATCH 2/2] x86/bugs: Clean-up verw mitigations

On Mon, Oct 28, 2024 at 04:50:35PM -0700, Daniel Sneddon wrote:
> @@ -599,20 +503,70 @@ static void __init verw_mitigations_check(void)
>  	}
>  }
>  
> -static void __init md_clear_select_mitigation(void)
> +static bool __init verw_mitigations_disabled(void)
>  {
>  	verw_mitigations_check();
> +	/*
> +	 * TODO: Create a single mitigation variable that will allow for setting

A patch which introduces a TODO is basically telling me, it is not ready to go
anywhere yet...

> +	 * the location of the mitigation, i.e.:
> +	 *
> +	 * kernel->user
> +	 * kvm->guest
> +	 * kvm->guest if device passthrough
> +	 * kernel->idle
> +	 */
> +	return (mds_mitigation == MDS_MITIGATION_OFF &&
> +		taa_mitigation == TAA_MITIGATION_OFF &&
> +		mmio_mitigation == MMIO_MITIGATION_OFF &&
> +		rfds_mitigation == RFDS_MITIGATION_OFF);

This should be used inside verw_mitigations_check() instead of repeated here,
no?

Also, pls call verw_mitigations_check() "check_verw_mitigations" - the name
should start with a verb.

Actually, you can merge verw_mitigations_check() and
verw_mitigations_disabled(). Please do a *minimal* patch when cleaning this up
- bugs.c is horrible. It should not get worse.

What could also help is splitting this patch - it is hard to review as it
is...

Thx.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ