]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.12-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jul 2026 17:42:36 +0000 (19:42 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jul 2026 17:42:36 +0000 (19:42 +0200)
added patches:
acpi-cppc-suppress-ubsan-warning-caused-by-field-misuse.patch
acpi-nfit-core-fix-possible-null-pointer-dereference.patch
loongarch-add-pio-for-early-access-before-acpi-pci-root-register.patch
platform-x86-intel-hid-protect-acpi-notify-handler-against-recursion.patch
rust-kbuild-set-frame-pointer-llvm-module-flag-for-config_frame_pointer.patch

queue-6.12/acpi-cppc-suppress-ubsan-warning-caused-by-field-misuse.patch [new file with mode: 0644]
queue-6.12/acpi-nfit-core-fix-possible-null-pointer-dereference.patch [new file with mode: 0644]
queue-6.12/loongarch-add-pio-for-early-access-before-acpi-pci-root-register.patch [new file with mode: 0644]
queue-6.12/platform-x86-intel-hid-protect-acpi-notify-handler-against-recursion.patch [new file with mode: 0644]
queue-6.12/rust-kbuild-set-frame-pointer-llvm-module-flag-for-config_frame_pointer.patch [new file with mode: 0644]
queue-6.12/series

diff --git a/queue-6.12/acpi-cppc-suppress-ubsan-warning-caused-by-field-misuse.patch b/queue-6.12/acpi-cppc-suppress-ubsan-warning-caused-by-field-misuse.patch
new file mode 100644 (file)
index 0000000..5bb5b97
--- /dev/null
@@ -0,0 +1,81 @@
+From 1b1acf2dada0cc3931bb2cb9ff8832edfbee46a1 Mon Sep 17 00:00:00 2001
+From: Jeremy Linton <jeremy.linton@arm.com>
+Date: Mon, 1 Jun 2026 18:58:08 -0500
+Subject: ACPI: CPPC: Suppress UBSAN warning caused by field misuse
+
+From: Jeremy Linton <jeremy.linton@arm.com>
+
+commit 1b1acf2dada0cc3931bb2cb9ff8832edfbee46a1 upstream.
+
+The definition of reg->access_width changes depending on the
+reg->space_id type.  Type ACPI_ADR_SPACE_PLATFORM_COMM uses
+access_width to indicate the PCC region, which can result in a UBSAN
+if the value is greater than 4.
+
+For example:
+
+ UBSAN: shift-out-of-bounds in drivers/acpi/cppc_acpi.c:1090:9
+ shift exponent 32 is too large for 32-bit type 'int'
+ CPU: 61 UID: 0 PID: 1220 Comm: (udev-worker) Not tainted 7.0.10-201.fc44.aarch64 #1 PREEMPT(lazy)
+ Hardware name: To be filled by O.E.M.
+ Call trace:
+  ...(trimming)
+  ubsan_epilogue+0x10/0x48
+  __ubsan_handle_shift_out_of_bounds+0xdc/0x1e0
+  cpc_write+0x4d0/0x670
+  cppc_set_perf+0x18c/0x490
+  cppc_cpufreq_cpu_init+0x1c8/0x380 [cppc_cpufreq]
+  ... (trimming)
+
+Lets fix this by validating the region type, as well as whether
+access_width has a value. Then since we are returning bit_width
+directly for ACPI_ADR_SPACE_PLATFORM_COMM, drop the code correcting
+the size.
+
+Fixes: 2f4a4d63a193 ("ACPI: CPPC: Use access_width over bit_width for system memory accesses")
+Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
+Tested-by: Jarred White <jarredwhite@linux.microsoft.com>
+Reviewed-by: Jarred White <jarredwhite@linux.microsoft.com>
+Reviewed-by: Easwar Hariharan <easwar.hariharan@linux.microsoft.com>
+Cc: All applicable <stable@vger.kernel.org>
+Link: https://patch.msgid.link/20260601235808.1113137-1-jeremy.linton@arm.com
+Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/acpi/cppc_acpi.c |   11 +++++++----
+ 1 file changed, 7 insertions(+), 4 deletions(-)
+
+--- a/drivers/acpi/cppc_acpi.c
++++ b/drivers/acpi/cppc_acpi.c
+@@ -172,8 +172,13 @@ show_cppc_data(cppc_get_perf_caps, cppc_
+ show_cppc_data(cppc_get_perf_ctrs, cppc_perf_fb_ctrs, reference_perf);
+ show_cppc_data(cppc_get_perf_ctrs, cppc_perf_fb_ctrs, wraparound_time);
+-/* Check for valid access_width, otherwise, fallback to using bit_width */
+-#define GET_BIT_WIDTH(reg) ((reg)->access_width ? (8 << ((reg)->access_width - 1)) : (reg)->bit_width)
++/*
++ * PCC reuses the access_width field as the subspace id, so only decode access
++ * size for non-PCC registers. Otherwise, use the bit_width.
++ */
++#define GET_BIT_WIDTH(reg) (((reg)->access_width &&                           \
++                           (reg)->space_id != ACPI_ADR_SPACE_PLATFORM_COMM) ? \
++                          (8 << ((reg)->access_width - 1)) : (reg)->bit_width)
+ /* Shift and apply the mask for CPC reads/writes */
+ #define MASK_VAL_READ(reg, val) (((val) >> (reg)->bit_offset) &                               \
+@@ -1031,7 +1036,6 @@ static int cpc_read(int cpu, struct cpc_
+                * by the bit width field; the access size is used to indicate
+                * the PCC subspace id.
+                */
+-              size = reg->bit_width;
+               vaddr = GET_PCC_VADDR(reg->address, pcc_ss_id);
+       }
+       else if (reg->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY)
+@@ -1103,7 +1107,6 @@ static int cpc_write(int cpu, struct cpc
+                * by the bit width field; the access size is used to indicate
+                * the PCC subspace id.
+                */
+-              size = reg->bit_width;
+               vaddr = GET_PCC_VADDR(reg->address, pcc_ss_id);
+       }
+       else if (reg->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY)
diff --git a/queue-6.12/acpi-nfit-core-fix-possible-null-pointer-dereference.patch b/queue-6.12/acpi-nfit-core-fix-possible-null-pointer-dereference.patch
new file mode 100644 (file)
index 0000000..1ffa96d
--- /dev/null
@@ -0,0 +1,43 @@
+From 027e128abb82788189d6d45b68e3e8e7329b67be Mon Sep 17 00:00:00 2001
+From: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
+Date: Wed, 3 Jun 2026 19:56:21 +0200
+Subject: ACPI: NFIT: core: Fix possible NULL pointer dereference
+
+From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
+
+commit 027e128abb82788189d6d45b68e3e8e7329b67be upstream.
+
+After commit 9b311b7313d6 ("ACPI: NFIT: Install Notify() handler before
+getting NFIT table"), acpi_nfit_probe() installs an ACPI notify handler
+for the NFIT device before checking the presence of the NFIT table.  If
+that table is not there, 0 is returned without allocating the acpi_desc
+object and setting the driver data pointer of the NFIT device.  If the
+platform firmware triggers an NFIT_NOTIFY_UC_MEMORY_ERROR notification
+on the NFIT device at that point, acpi_nfit_uc_error_notify() will
+dereference a NULL pointer.
+
+Prevent that from occurring by adding an acpi_desc check against NULL
+to acpi_nfit_uc_error_notify().
+
+Fixes: 9b311b7313d6 ("ACPI: NFIT: Install Notify() handler before getting NFIT table")
+Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
+Cc: All applicable <stable@vger.kernel.org>
+Reviewed-by: Dave Jiang <dave.jiang@intel.com>
+Link: https://patch.msgid.link/2418508.ElGaqSPkdT@rafael.j.wysocki
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/acpi/nfit/core.c |    3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/drivers/acpi/nfit/core.c
++++ b/drivers/acpi/nfit/core.c
+@@ -3447,6 +3447,9 @@ static void acpi_nfit_uc_error_notify(st
+ {
+       struct acpi_nfit_desc *acpi_desc = dev_get_drvdata(dev);
++      if (!acpi_desc)
++              return;
++
+       if (acpi_desc->scrub_mode == HW_ERROR_SCRUB_ON)
+               acpi_nfit_ars_rescan(acpi_desc, ARS_REQ_LONG);
+       else
diff --git a/queue-6.12/loongarch-add-pio-for-early-access-before-acpi-pci-root-register.patch b/queue-6.12/loongarch-add-pio-for-early-access-before-acpi-pci-root-register.patch
new file mode 100644 (file)
index 0000000..828a0d1
--- /dev/null
@@ -0,0 +1,107 @@
+From 6061e65f95713b01f4313cda6637dfe3aa5412b4 Mon Sep 17 00:00:00 2001
+From: Huacai Chen <chenhuacai@loongson.cn>
+Date: Thu, 25 Jun 2026 13:03:47 +0800
+Subject: LoongArch: Add PIO for early access before ACPI PCI root register
+
+From: Huacai Chen <chenhuacai@loongson.cn>
+
+commit 6061e65f95713b01f4313cda6637dfe3aa5412b4 upstream.
+
+For ACPI system we suppose the ISA/LPC PIO range is registered together
+with PCI root bridge. But the fact is there may be some early access to
+the ISA/LPC PIO range before ACPI PCI root register (most of them are
+due to abnormal BIOS). Unconditionally register the ISA/LPC PIO range
+usually causes ACPI PCI root register fail because of the address range
+confliction. So we add a pair of helpers: acpi_add_early_pio() to add
+PIO for early access, and acpi_remove_early_pio() to remove PIO before
+PCI root register. Since acpi_remove_early_pio() may be called multiple
+times, we add an acpi_pio flag to ensure PIO be removed only once.
+
+Cc: <stable@vger.kernel.org>
+Tested-by: Yuanzhen Gan <elysia-best@simplelinux.cn.eu.org>
+Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/loongarch/include/asm/acpi.h |    2 ++
+ arch/loongarch/kernel/acpi.c      |   28 ++++++++++++++++++++++++++++
+ arch/loongarch/kernel/setup.c     |    2 ++
+ arch/loongarch/pci/acpi.c         |    2 ++
+ 4 files changed, 34 insertions(+)
+
+--- a/arch/loongarch/include/asm/acpi.h
++++ b/arch/loongarch/include/asm/acpi.h
+@@ -38,6 +38,8 @@ static inline bool acpi_has_cpu_in_madt(
+ extern struct list_head acpi_wakeup_device_list;
+ extern struct acpi_madt_core_pic acpi_core_pic[MAX_CORE_PIC];
++extern void acpi_add_early_pio(void);
++extern void acpi_remove_early_pio(void);
+ extern int __init parse_acpi_topology(void);
+ static inline u32 get_acpi_id_for_cpu(unsigned int cpu)
+--- a/arch/loongarch/kernel/acpi.c
++++ b/arch/loongarch/kernel/acpi.c
+@@ -15,6 +15,7 @@
+ #include <linux/memblock.h>
+ #include <linux/of_fdt.h>
+ #include <linux/serial_core.h>
++#include <linux/vmalloc.h>
+ #include <asm/io.h>
+ #include <asm/numa.h>
+ #include <asm/loongson.h>
+@@ -58,6 +59,33 @@ void __iomem *acpi_os_ioremap(acpi_physi
+               return ioremap_cache(phys, size);
+ }
++#define PIO_BASE (unsigned long)PCI_IOBASE
++#define PIO_SIZE ALIGN(ISA_IOSIZE, PAGE_SIZE)
++
++static bool acpi_pio;
++
++/* Add PIO for early access */
++void acpi_add_early_pio(void)
++{
++      if (!acpi_disabled) {
++              acpi_pio = true;
++              vmap_page_range(PIO_BASE, PIO_BASE + PIO_SIZE,
++                              LOONGSON_LIO_BASE, pgprot_device(PAGE_KERNEL));
++      }
++}
++
++/* Remove PIO for PCI register */
++void acpi_remove_early_pio(void)
++{
++      if (!acpi_pio)
++              return;
++
++      if (!acpi_disabled) {
++              acpi_pio = false;
++              vunmap_range(PIO_BASE, PIO_BASE + PIO_SIZE);
++      }
++}
++
+ #ifdef CONFIG_SMP
+ static int set_processor_mask(u32 id, u32 pass)
+ {
+--- a/arch/loongarch/kernel/setup.c
++++ b/arch/loongarch/kernel/setup.c
+@@ -510,6 +510,8 @@ static __init int arch_reserve_pio_range
+ {
+       struct device_node *np;
++      acpi_add_early_pio();
++
+       for_each_node_by_name(np, "isa") {
+               struct of_range range;
+               struct of_range_parser parser;
+--- a/arch/loongarch/pci/acpi.c
++++ b/arch/loongarch/pci/acpi.c
+@@ -65,6 +65,8 @@ static int acpi_prepare_root_resources(s
+       struct resource_entry *entry, *tmp;
+       struct acpi_device *device = ci->bridge;
++      acpi_remove_early_pio();
++
+       status = acpi_pci_probe_root_resources(ci);
+       if (status > 0) {
+               acpi_evaluate_integer(device->handle, "PCIH", NULL, &pci_h);
diff --git a/queue-6.12/platform-x86-intel-hid-protect-acpi-notify-handler-against-recursion.patch b/queue-6.12/platform-x86-intel-hid-protect-acpi-notify-handler-against-recursion.patch
new file mode 100644 (file)
index 0000000..3782e08
--- /dev/null
@@ -0,0 +1,86 @@
+From c085d82613d5618814b84406c8b2d64f1bc305e7 Mon Sep 17 00:00:00 2001
+From: HyeongJun An <sammiee5311@gmail.com>
+Date: Sat, 6 Jun 2026 02:49:05 +0900
+Subject: platform/x86: intel-hid: Protect ACPI notify handler against recursion
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: HyeongJun An <sammiee5311@gmail.com>
+
+commit c085d82613d5618814b84406c8b2d64f1bc305e7 upstream.
+
+Since commit e2ffcda16290 ("ACPI: OSL: Allow Notify () handlers to run on
+all CPUs") ACPI notify handlers like the intel-hid notify_handler() may
+run on multiple CPU cores racing with themselves.
+
+On convertibles and detachables (matched by DMI chassis-type 31 and 32 in
+dmi_auto_add_switch[]) the SW_TABLET_MODE input device is registered
+lazily from notify_handler() on the first tablet-mode event, via
+intel_hid_switches_setup(). When two such events race on different CPUs
+both can pass the !priv->switches check and register the priv->switches
+input device twice, resulting in a duplicate sysfs entry and a subsequent
+NULL pointer dereference.
+
+This is the same class of bug fixed by commit e075c3b13a0a ("platform/x86:
+intel-vbtn: Protect ACPI notify handler against recursion") for the
+sibling intel-vbtn driver.
+
+Protect intel-hid notify_handler() from racing with itself with a mutex
+to fix this.
+
+Fixes: e2ffcda16290 ("ACPI: OSL: Allow Notify () handlers to run on all CPUs")
+Cc: stable@vger.kernel.org
+Signed-off-by: HyeongJun An <sammiee5311@gmail.com>
+Link: https://patch.msgid.link/20260605174905.131095-1-sammiee5311@gmail.com
+Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
+Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/platform/x86/intel/hid.c |    9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+--- a/drivers/platform/x86/intel/hid.c
++++ b/drivers/platform/x86/intel/hid.c
+@@ -7,11 +7,13 @@
+  */
+ #include <linux/acpi.h>
++#include <linux/cleanup.h>
+ #include <linux/dmi.h>
+ #include <linux/input.h>
+ #include <linux/input/sparse-keymap.h>
+ #include <linux/kernel.h>
+ #include <linux/module.h>
++#include <linux/mutex.h>
+ #include <linux/platform_device.h>
+ #include <linux/string_choices.h>
+ #include <linux/suspend.h>
+@@ -215,6 +217,7 @@ static const struct dmi_system_id dmi_au
+ };
+ struct intel_hid_priv {
++      struct mutex mutex; /* Avoid notify_handler() racing with itself */
+       struct input_dev *input_dev;
+       struct input_dev *array;
+       struct input_dev *switches;
+@@ -550,6 +553,8 @@ static void notify_handler(acpi_handle h
+       struct key_entry *ke;
+       int err;
++      guard(mutex)(&priv->mutex);
++
+       /*
+        * Some convertible have unreliable VGBS return which could cause incorrect
+        * SW_TABLET_MODE report, in these cases we enable support when receiving
+@@ -705,6 +710,10 @@ static int intel_hid_probe(struct platfo
+               return -ENOMEM;
+       dev_set_drvdata(&device->dev, priv);
++      err = devm_mutex_init(&device->dev, &priv->mutex);
++      if (err)
++              return err;
++
+       /* See dual_accel_detect.h for more info on the dual_accel check. */
+       if (enable_sw_tablet_mode == TABLET_SW_AUTO) {
+               if (dmi_check_system(dmi_vgbs_allow_list))
diff --git a/queue-6.12/rust-kbuild-set-frame-pointer-llvm-module-flag-for-config_frame_pointer.patch b/queue-6.12/rust-kbuild-set-frame-pointer-llvm-module-flag-for-config_frame_pointer.patch
new file mode 100644 (file)
index 0000000..bd2f348
--- /dev/null
@@ -0,0 +1,54 @@
+From 191f49f1e38b1c10eb44b0f967c6175c884ef7db Mon Sep 17 00:00:00 2001
+From: Alice Ryhl <aliceryhl@google.com>
+Date: Tue, 16 Jun 2026 12:30:38 +0000
+Subject: rust: Kbuild: set frame-pointer llvm module flag for CONFIG_FRAME_POINTER
+
+From: Alice Ryhl <aliceryhl@google.com>
+
+commit 191f49f1e38b1c10eb44b0f967c6175c884ef7db upstream.
+
+Due to a rustc bug, the -Cforce-frame-pointers=y flag only emits the
+frame-pointer annotation for functions, but not for the module. This
+means that functions generated by the LLVM backend such as
+'asan.module_ctor' do not receive the frame-pointer annotation.
+
+This is likely to lead to broken backtraces and may also cause issues
+with ftrace if these features are used with functions generated by the
+LLVM backend.
+
+Thus, use -Zllvm_module_flag to work around this rustc bug if using a
+rustc without the fix.
+
+[ The fix [1] has landed for Rust 1.98.0 (expected release on
+  2026-08-20). - Miguel ]
+
+Cc: stable@vger.kernel.org # 6.12.y and later (flag not available in pinned Rust in older LTSs).
+Fixes: 2f7ab1267dc9 ("Kbuild: add Rust support")
+Link: https://github.com/rust-lang/rust/pull/156980 [1]
+Signed-off-by: Alice Ryhl <aliceryhl@google.com>
+Link: https://patch.msgid.link/20260616-frame-ptr-fix-v1-1-dc6b29a631d9@google.com
+[ - Adjusted Cc: stable@ as discussed.
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+  - Added comment with link to the PR, similar to what we did in commit
+    ac35b5580ace ("rust: arm64: set uwtable llvm module flag for
+    CONFIG_UNWIND_TABLES").
+
+    - Miguel ]
+Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
+---
+ Makefile |    3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/Makefile
++++ b/Makefile
+@@ -851,6 +851,9 @@ KBUILD_RUSTFLAGS += $(KBUILD_RUSTFLAGS-y
+ ifdef CONFIG_FRAME_POINTER
+ KBUILD_CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls
+ KBUILD_RUSTFLAGS += -Cforce-frame-pointers=y
++# Work around rustc bug on compilers without
++# https://github.com/rust-lang/rust/pull/156980.
++KBUILD_RUSTFLAGS += $(if $(call rustc-min-version,109800),,-Zllvm_module_flag=frame-pointer:u32:2:max)
+ else
+ # Some targets (ARM with Thumb2, for example), can't be built with frame
+ # pointers.  For those, we don't have FUNCTION_TRACER automatically
index 1a7f9d48aa0ca1291bdc3aa41867503fb323eed3..24bf8cec1505375dcfce3f22d513b4d8b8ed2c5a 100644 (file)
@@ -31,3 +31,8 @@ block-add-a-store_limit-operations-for-sysfs-entries.patch
 block-fix-queue-freeze-vs-limits-lock-order-in-sysfs.patch
 mm-khugepaged-write-all-dirty-file-folios-when-colla.patch
 perf-trace-beauty-fcntl-fix-build-with-older-kernel-headers.patch
+acpi-cppc-suppress-ubsan-warning-caused-by-field-misuse.patch
+acpi-nfit-core-fix-possible-null-pointer-dereference.patch
+platform-x86-intel-hid-protect-acpi-notify-handler-against-recursion.patch
+loongarch-add-pio-for-early-access-before-acpi-pci-root-register.patch
+rust-kbuild-set-frame-pointer-llvm-module-flag-for-config_frame_pointer.patch