]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.15-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Nov 2024 08:38:30 +0000 (09:38 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Nov 2024 08:38:30 +0000 (09:38 +0100)
added patches:
acpi-prm-clean-up-guid-type-in-struct-prm_handler_info.patch

queue-5.15/acpi-prm-clean-up-guid-type-in-struct-prm_handler_info.patch [new file with mode: 0644]
queue-5.15/series

diff --git a/queue-5.15/acpi-prm-clean-up-guid-type-in-struct-prm_handler_info.patch b/queue-5.15/acpi-prm-clean-up-guid-type-in-struct-prm_handler_info.patch
new file mode 100644 (file)
index 0000000..a97f185
--- /dev/null
@@ -0,0 +1,57 @@
+From 3d1c651272cf1df8aac7d9b6d92d836d27bed50f Mon Sep 17 00:00:00 2001
+From: Dan Carpenter <dan.carpenter@linaro.org>
+Date: Thu, 24 Oct 2024 11:07:15 +0300
+Subject: ACPI: PRM: Clean up guid type in struct prm_handler_info
+
+From: Dan Carpenter <dan.carpenter@linaro.org>
+
+commit 3d1c651272cf1df8aac7d9b6d92d836d27bed50f upstream.
+
+Clang 19 prints a warning when we pass &th->guid to efi_pa_va_lookup():
+
+drivers/acpi/prmt.c:156:29: error: passing 1-byte aligned argument to
+4-byte aligned parameter 1 of 'efi_pa_va_lookup' may result in an
+unaligned pointer access [-Werror,-Walign-mismatch]
+  156 |                         (void *)efi_pa_va_lookup(&th->guid, handler_info->handler_address);
+      |                                                  ^
+
+The problem is that efi_pa_va_lookup() takes a efi_guid_t and &th->guid
+is a regular guid_t.  The difference between the two types is the
+alignment.  efi_guid_t is a typedef.
+
+       typedef guid_t efi_guid_t __aligned(__alignof__(u32));
+
+It's possible that this a bug in Clang 19.  Even though the alignment of
+&th->guid is not explicitly specified, it will still end up being aligned
+at 4 or 8 bytes.
+
+Anyway, as Ard points out, it's cleaner to change guid to efi_guid_t type
+and that also makes the warning go away.
+
+Fixes: 088984c8d54c ("ACPI: PRM: Find EFI_MEMORY_RUNTIME block for PRM handler and context")
+Reported-by: Linux Kernel Functional Testing <lkft@linaro.org>
+Suggested-by: Ard Biesheuvel <ardb@kernel.org>
+Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
+Tested-by: Paul E. McKenney <paulmck@kernel.org>
+Acked-by: Ard Biesheuvel <ardb@kernel.org>
+Link: https://patch.msgid.link/3777d71b-9e19-45f4-be4e-17bf4fa7a834@stanley.mountain
+[ rjw: Subject edit ]
+Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
+[nathan: Fix conflicts due to lack of e38abdab441c]
+Signed-off-by: Nathan Chancellor <nathan@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/acpi/prmt.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/acpi/prmt.c
++++ b/drivers/acpi/prmt.c
+@@ -52,7 +52,7 @@ struct prm_context_buffer {
+ static LIST_HEAD(prm_module_list);
+ struct prm_handler_info {
+-      guid_t guid;
++      efi_guid_t guid;
+       void *handler_addr;
+       u64 static_data_buffer_addr;
+       u64 acpi_param_buffer_addr;
index e596278d94389d2e309a9177d06b7e6263ad5a42..99acc3e8207900b91a1012a55d95dcb9f49a5656 100644 (file)
@@ -70,3 +70,4 @@ ocfs2-remove-entry-once-instead-of-null-ptr-dereference-in-ocfs2_xa_remove.patch
 ucounts-fix-counter-leak-in-inc_rlimit_get_ucounts.patch
 alsa-usb-audio-support-jack-detection-on-dell-dock.patch
 alsa-usb-audio-add-quirks-for-dell-wd19-dock.patch
+acpi-prm-clean-up-guid-type-in-struct-prm_handler_info.patch