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]
Date: Tue, 21 May 2024 09:49:47 +0200
From: Borislav Petkov <bp@...en8.de>
To: Tony Luck <tony.luck@...el.com>
Cc: Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>,
	Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
	"H. Peter Anvin" <hpa@...or.com>,
	"Peter Zijlstra (Intel)" <peterz@...radead.org>,
	Uros Bizjak <ubizjak@...il.com>,
	Rick Edgecombe <rick.p.edgecombe@...el.com>,
	Arnd Bergmann <arnd@...db.de>, Mateusz Guzik <mjguzik@...il.com>,
	Thomas Renninger <trenn@...e.de>, Andi Kleen <ak@...ux.intel.com>,
	linux-kernel@...r.kernel.org, patches@...ts.linux.dev
Subject: Re: [PATCH v6 02/49] x86/cpu: Fix x86_match_cpu() to match just
 X86_VENDOR_INTEL

On Mon, May 20, 2024 at 03:45:33PM -0700, Tony Luck wrote:
> Fixes: 644e9cbbe3fc ("Add driver auto probing for x86 features v4")

Do you really want to backport this to everything since 2012, as that
patch is from then?

> @@ -690,6 +690,7 @@ struct x86_cpu_id {
>  	__u16 model;
>  	__u16 steppings;
>  	__u16 feature;	/* bit index */
> +	__u16 flags;
>  	kernel_ulong_t driver_data;
>  };
>  
> @@ -700,6 +701,9 @@ struct x86_cpu_id {
>  #define X86_STEPPING_ANY 0
>  #define X86_FEATURE_ANY 0	/* Same as FPU, you can't test for that */
>  
> +/* x86_cpu_id::flags */
> +#define X86_CPU_ID_FLAG_ENTRY_VALID	BIT(0)

I would definitely not want to have those visible in userspace.

IOW, something like this:

diff --git a/arch/x86/include/asm/cpu_device_id.h b/arch/x86/include/asm/cpu_device_id.h
index 54a71c669ce9..b6325ee30871 100644
--- a/arch/x86/include/asm/cpu_device_id.h
+++ b/arch/x86/include/asm/cpu_device_id.h
@@ -53,6 +53,9 @@
 #define X86_CENTAUR_FAM6_C7_D		0xd
 #define X86_CENTAUR_FAM6_NANO		0xf
 
+/* x86_cpu_id::flags */
+#define X86_CPU_ID_FLAG_ENTRY_VALID	BIT(0)
+
 #define X86_STEPPINGS(mins, maxs)    GENMASK(maxs, mins)
 /**
  * X86_MATCH_VENDOR_FAM_MODEL_STEPPINGS_FEATURE - Base macro for CPU matching
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index ca3468ad06ff..4338b1b4ac44 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -690,6 +690,7 @@ struct x86_cpu_id {
 	__u16 model;
 	__u16 steppings;
 	__u16 feature;	/* bit index */
+	/* Solely for kernel-internal use: DO NOT EXPORT to userspace! */
 	__u16 flags;
 	kernel_ulong_t driver_data;
 };
@@ -701,9 +702,6 @@ struct x86_cpu_id {
 #define X86_STEPPING_ANY 0
 #define X86_FEATURE_ANY 0	/* Same as FPU, you can't test for that */
 
-/* x86_cpu_id::flags */
-#define X86_CPU_ID_FLAG_ENTRY_VALID	BIT(0)
-
 /*
  * Generic table type for matching CPU features.
  * @feature:	the bit number of the feature (0 - 65535)

-- 
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