Patch "Revert "x86/fpu: Use _Alignof to avoid undefined behavior in TYPE_ALIGN"" has been added to the 4.14-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    Revert "x86/fpu: Use _Alignof to avoid undefined behavior in TYPE_ALIGN"

to the 4.14-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     revert-x86-fpu-use-_alignof-to-avoid-undefined-behavior-in-type_align.patch
and it can be found in the queue-4.14 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From 9d98dfafc22f9651c0d6c4f99c4bab36417e3743 Mon Sep 17 00:00:00 2001
From: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 17 Feb 2023 15:34:25 +0100
Subject: Revert "x86/fpu: Use _Alignof to avoid undefined behavior in TYPE_ALIGN"

From: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

This reverts commit 67c6d79777cf5d3165d6d2e2d7c5e37333d1a76e which is
commit 55228db2697c09abddcb9487c3d9fa5854a932cd upstream.

_Alignof is not in the gcc version that the 4.14.y kernel still
supports (3.2), so this change needs to be reverted as it breaks the
build on those older compiler versions.

Reported-by: Michael Nies <michael.nies@xxxxxxxxxxxxxx>
Link: https://lore.kernel.org/r/HE1PR0902MB188277E37DED663AE440510BE1D99@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Link: https://bugzilla.kernel.org/show_bug.cgi?id=217013
Cc: YingChi Long <me@xxxxxxxxx>
Cc: Borislav Petkov <bp@xxxxxxx>
Cc: Nick Desaulniers <ndesaulniers@xxxxxxxxxx>
Cc: Nathan Chancellor <nathan@xxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 arch/x86/kernel/fpu/init.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

--- a/arch/x86/kernel/fpu/init.c
+++ b/arch/x86/kernel/fpu/init.c
@@ -138,6 +138,9 @@ static void __init fpu__init_system_gene
 unsigned int fpu_kernel_xstate_size;
 EXPORT_SYMBOL_GPL(fpu_kernel_xstate_size);
 
+/* Get alignment of the TYPE. */
+#define TYPE_ALIGN(TYPE) offsetof(struct { char x; TYPE test; }, test)
+
 /*
  * Enforce that 'MEMBER' is the last field of 'TYPE'.
  *
@@ -145,8 +148,8 @@ EXPORT_SYMBOL_GPL(fpu_kernel_xstate_size
  * because that's how C aligns structs.
  */
 #define CHECK_MEMBER_AT_END_OF(TYPE, MEMBER) \
-	BUILD_BUG_ON(sizeof(TYPE) !=         \
-		     ALIGN(offsetofend(TYPE, MEMBER), _Alignof(TYPE)))
+	BUILD_BUG_ON(sizeof(TYPE) != ALIGN(offsetofend(TYPE, MEMBER), \
+					   TYPE_ALIGN(TYPE)))
 
 /*
  * We append the 'struct fpu' to the task_struct:


Patches currently in stable-queue which might be from gregkh@xxxxxxxxxxxxxxxxxxx are

queue-4.14/usb-core-add-quirk-for-alcor-link-ak9563-smartcard-reader.patch
queue-4.14/migrate-hugetlb-check-for-hugetlb-shared-pmd-in-node-migration.patch
queue-4.14/fbcon-check-font-dimension-limits.patch
queue-4.14/revert-x86-fpu-use-_alignof-to-avoid-undefined-behavior-in-type_align.patch
queue-4.14/watchdog-diag288_wdt-do-not-use-stack-buffers-for-hardware-data.patch
queue-4.14/serial-8250_dma-fix-dma-rx-rearm-race.patch
queue-4.14/aio-fix-mremap-after-fork-null-deref.patch
queue-4.14/mm-swapfile-add-cond_resched-in-get_swap_pages.patch
queue-4.14/iio-adc-twl6030-enable-measurements-of-vusb-vbat-and-others.patch
queue-4.14/net-usb-fix-wrong-direction-warning-in-plusb.c.patch
queue-4.14/efi-accept-version-2-of-memory-attributes-table.patch
queue-4.14/firewire-fix-memory-leak-for-payload-of-request-subaction-to-iec-61883-1-fcp-region.patch
queue-4.14/serial-8250_dma-fix-dma-rx-completion-race.patch
queue-4.14/iio-adc-berlin2-adc-add-missing-of_node_put-in-error-path.patch
queue-4.14/btrfs-limit-device-extents-to-the-device-size.patch
queue-4.14/mm-hugetlb-proc-check-for-hugetlb-shared-pmd-in-proc-pid-smaps.patch
queue-4.14/iio-hid-fix-the-retval-in-accel_3d_capture_sample.patch
queue-4.14/alsa-emux-avoid-potential-array-out-of-bound-in-snd_emux_xg_control.patch
queue-4.14/watchdog-diag288_wdt-fix-__diag288-inline-assembly.patch
queue-4.14/parisc-wire-up-ptrace_getregs-ptrace_setregs-for-compat-case.patch
queue-4.14/parisc-fix-return-code-of-pdc_iodc_print.patch
queue-4.14/usb-gadget-f_fs-fix-unbalanced-spinlock-in-__ffs_ep0.patch
queue-4.14/squashfs-fix-handling-and-sanity-checking-of-xattr_ids-count.patch



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux