mirror-linux/drivers
Dave Hansen 4e2c719782 x86/cpu: Help users notice when running old Intel microcode
Old microcode is bad for users and for kernel developers.

For users, it exposes them to known fixed security and/or functional
issues. These obviously rarely result in instant dumpster fires in
every environment. But it is as important to keep your microcode up
to date as it is to keep your kernel up to date.

Old microcode also makes kernels harder to debug. A developer looking
at an oops need to consider kernel bugs, known CPU issues and unknown
CPU issues as possible causes. If they know the microcode is up to
date, they can mostly eliminate known CPU issues as the cause.

Make it easier to tell if CPU microcode is out of date. Add a list
of released microcode. If the loaded microcode is older than the
release, tell users in a place that folks can find it:

	/sys/devices/system/cpu/vulnerabilities/old_microcode

Tell kernel kernel developers about it with the existing taint
flag:

	TAINT_CPU_OUT_OF_SPEC

== Discussion ==

When a user reports a potential kernel issue, it is very common
to ask them to reproduce the issue on mainline. Running mainline,
they will (independently from the distro) acquire a more up-to-date
microcode version list. If their microcode is old, they will
get a warning about the taint and kernel developers can take that
into consideration when debugging.

Just like any other entry in "vulnerabilities/", users are free to
make their own assessment of their exposure.

== Microcode Revision Discussion ==

The microcode versions in the table were generated from the Intel
microcode git repo:

	8ac9378a8487 ("microcode-20241112 Release")

which as of this writing lags behind the latest microcode-20250211.

It can be argued that the versions that the kernel picks to call "old"
should be a revision or two old. Which specific version is picked is
less important to me than picking *a* version and enforcing it.

This repository contains only microcode versions that Intel has deemed
to be OS-loadable. It is quite possible that the BIOS has loaded a
newer microcode than the latest in this repo. If this happens, the
system is considered to have new microcode, not old.

Specifically, the sysfs file and taint flag answer the question:

	Is the CPU running on the latest OS-loadable microcode,
	or something even later that the BIOS loaded?

In other words, Intel never publishes an authoritative list of CPUs
and latest microcode revisions. Until it does, this is the best that
Linux can do.

Also note that the "intel-ucode-defs.h" file is simple, ugly and
has lots of magic numbers. That's on purpose and should allow a
single file to be shared across lots of stable kernel regardless of if
they have the new "VFM" infrastructure or not. It was generated with
a dumb script.

== FAQ ==

Q: Does this tell me if my system is secure or insecure?
A: No. It only tells you if your microcode was old when the
   system booted.

Q: Should the kernel warn if the microcode list itself is too old?
A: No. New kernels will get new microcode lists, both mainline
   and stable. The only way to have an old list is to be running
   an old kernel in which case you have bigger problems.

Q: Is this for security or functional issues?
A: Both.

Q: If a given microcode update only has functional problems but
   no security issues, will it be considered old?
A: Yes. All microcode image versions within a microcode release
   are treated identically. Intel appears to make security
   updates without disclosing them in the release notes.  Thus,
   all updates are considered to be security-relevant.

Q: Who runs old microcode?
A: Anybody with an old distro. This happens all the time inside
   of Intel where there are lots of weird systems in labs that
   might not be getting regular distro updates and might also
   be running rather exotic microcode images.

Q: If I update my microcode after booting will it stop saying
   "Vulnerable"?
A: No. Just like all the other vulnerabilies, you need to
   reboot before the kernel will reassess your vulnerability.

Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: "Ahmed S. Darwish" <darwi@linutronix.de>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: John Ogness <john.ogness@linutronix.de>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Juergen Gross <jgross@suse.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://lore.kernel.org/all/20250421195659.CF426C07%40davehans-spike.ostc.intel.com
(cherry picked from commit 9127865b15eb0a1bd05ad7efe29489c44394bdc1)
2025-04-22 08:33:52 +02:00
..
accel Merge drm/drm-fixes into drm-misc-fixes 2025-04-08 10:15:47 +02:00
accessibility treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
acpi Merge branches 'acpi-ec' and 'acpi-button' 2025-04-11 15:50:15 +02:00
amba
android
ata ata: sata_sx4: Add error handling in pdc20621_i2c_read() 2025-04-09 15:24:49 +09:00
atm treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
auxdisplay treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
base x86/cpu: Help users notice when running old Intel microcode 2025-04-22 08:33:52 +02:00
bcma
block block-6.15-20250411 2025-04-11 08:29:35 -07:00
bluetooth treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
bus treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
cache
cdrom
cdx
char x86/platform/amd: Move the <asm/amd_nb.h> header to <asm/amd/nb.h> 2025-04-14 09:34:14 +02:00
clk ARM and clkdev updates for 6.15-rc1 2025-04-03 12:21:44 -07:00
clocksource RISC-V Patches for the 6.15 Merge Window, Part 1 2025-04-04 09:49:17 -07:00
comedi treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
connector
counter Char/Misc fixes for 6.15-rc1 2025-04-02 18:03:34 -07:00
cpufreq treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
cpuidle pmdomain core: 2025-03-25 20:40:51 -07:00
crypto treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
cxl cxl for v6.15 2025-04-02 20:04:43 -07:00
dax
dca
devfreq
dio
dma treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
dma-buf Merge drm/drm-fixes into drm-misc-fixes 2025-04-08 10:15:47 +02:00
dpll
edac x86/platform/amd: Move the <asm/amd_node.h> header to <asm/amd/node.h> 2025-04-14 09:34:17 +02:00
eisa
extcon
firewire treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
firmware ARM: 2025-04-08 13:47:55 -07:00
fpga
fsi
fwctl pds_fwctl: add rpc and query support 2025-03-21 20:57:55 -03:00
gnss
gpio gpiolib: of: Move Atmel HSMCI quirk up out of the regulator comment 2025-04-08 11:06:45 +02:00
gpu Driver Changes: 2025-04-11 09:11:08 +10:00
greybus treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
hid treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
hsi treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
hte treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
hv - The 6 patch series "Enable strict percpu address space checks" from 2025-04-01 09:29:18 -07:00
hwmon x86/platform/amd: Move the <asm/amd_node.h> header to <asm/amd/node.h> 2025-04-14 09:34:17 +02:00
hwspinlock hwspinlock: Remove unused hwspin_lock_get_id() 2025-03-21 17:12:04 -05:00
hwtracing Char/Misc/IIO driver updates for 6.15-rc1 2025-04-01 11:26:08 -07:00
i2c treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
i3c i3c: Add NULL pointer check in i3c_master_queue_ibi() 2025-03-31 11:44:00 +02:00
idle Power management updates for 6.15-rc1 2025-03-25 15:00:18 -07:00
iio treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
infiniband RDMA/bnxt_re: Remove unusable nq variable 2025-04-10 14:47:55 -03:00
input A set of final cleanups for the timer subsystem: 2025-04-06 08:35:37 -07:00
interconnect
iommu iommu/tegra241-cmdqv: Fix warnings due to dmam_free_coherent() 2025-04-11 12:44:27 +02:00
ipack
irqchip irqchip/irq-bcm2712-mip: Set EOI/ACK flags in msi_parent_ops 2025-04-07 16:27:48 +02:00
isdn treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
leds treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
macintosh treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
mailbox treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
mcb
md CRC cleanups for 6.15 2025-04-08 12:09:28 -07:00
media treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
memory treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
memstick treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
message SCSI misc on 20250326 2025-03-26 19:57:34 -07:00
mfd * Maxim MAX77705: 2025-03-29 14:33:13 -07:00
misc treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
mmc treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
most treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
mtd mtd: rawnand: Add status chack in r852_ready() 2025-04-07 09:02:49 +02:00
mux
net Including fixes from netfilter. 2025-04-10 08:52:18 -07:00
nfc treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
ntb Bug fixes for NTB Switchtec driver mw negative shift, Intel NTB link 2025-04-04 14:23:07 -07:00
nubus
nvdimm libnvdimm additions for 6.15 2025-04-02 20:27:18 -07:00
nvme block-6.15-20250411 2025-04-11 08:29:35 -07:00
nvmem
of Devicetree for v6.15: 2025-03-29 11:23:16 -07:00
opp
parisc
parport treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
pci PCI: Run quirk_huawei_pcie_sva() before arm_smmu_probe_device() 2025-04-11 12:53:21 -05:00
pcmcia treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
peci
perf pci-v6.15-changes 2025-03-28 19:36:53 -07:00
phy phy-for-6.15 2025-04-01 12:47:11 -07:00
pinctrl Pin control changes for the v6.15 kernel cycle: 2025-03-29 16:59:16 -07:00
platform x86/platform/amd: Move the <asm/amd_node.h> header to <asm/amd/node.h> 2025-04-14 09:34:17 +02:00
pmdomain
pnp x86/platform/amd: Move the <asm/amd_nb.h> header to <asm/amd/nb.h> 2025-04-14 09:34:14 +02:00
power i2c-for-6.15-rc1 2025-04-01 14:21:02 -07:00
powercap Power management updates for 6.15-rc1 2025-03-25 15:00:18 -07:00
pps treewide: Convert new and leftover hrtimer_init() users 2025-04-05 10:30:17 +02:00
ps3
ptp treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
pwm pwm: A set of fixes for pwm core and various drivers 2025-04-12 08:11:19 -07:00
rapidio
ras Merge branch 'linus' into x86/cpu, to resolve conflicts 2025-04-16 07:03:58 +02:00
regulator These are objtool fixes and updates by Josh Poimboeuf, centered 2025-04-02 10:30:10 -07:00
remoteproc remoteproc: qcom_q6v5_pas: Make single-PD handling more robust 2025-03-22 08:42:39 -05:00
reset remoteproc updates for v6.15 2025-03-29 17:18:50 -07:00
rpmsg
rtc treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
s390 s390/virtio_ccw: Don't allocate/assign airqs for non-existing queues 2025-04-09 12:12:41 +02:00
sbus
scsi treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
sh
siox
slimbus
soc soc: drivers for 6.15, part 2 2025-04-04 09:06:32 -07:00
soundwire soundwire updates for 6.15 2025-04-01 12:43:13 -07:00
spi spi: fsl-spi: Remove redundant probe error message 2025-04-10 12:25:21 +01:00
spmi
ssb
staging treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
target treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
tc
tee
thermal More thermal control updates for 6.15-rc1 2025-04-01 16:51:44 -07:00
thunderbolt USB/Thunderbolt update for 6.15-rc1 2025-04-02 18:23:31 -07:00
tty treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
ufs Revert "Merge tag 'irq-msi-2025-03-23' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip" 2025-03-28 11:22:54 -07:00
uio
usb treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
vdpa
vfio VFIO updates for v6.15-rc1 2025-04-01 19:35:19 -07:00
vhost virtio: features, fixes, cleanups 2025-04-01 18:52:54 -07:00
video treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
virt treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
virtio virtio: features, fixes, cleanups 2025-04-01 18:52:54 -07:00
w1
watchdog treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
xen x86/xen: fix balloon target initialization for PVH dom0 2025-04-07 11:24:12 +02:00
zorro
Kconfig
Makefile