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.19-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.19 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 a00d020f18dbe0666e221d929846f1b591b27c20 which is commit 55228db2697c09abddcb9487c3d9fa5854a932cd upstream. _Alignof is not in the gcc version that the 4.19.y kernel still supports (4.6), 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.19/riscv-disable-generation-of-unwind-tables.patch queue-4.19/usb-core-add-quirk-for-alcor-link-ak9563-smartcard-reader.patch queue-4.19/migrate-hugetlb-check-for-hugetlb-shared-pmd-in-node-migration.patch queue-4.19/usb-dwc3-qcom-enable-vbus-override-when-in-otg-dr-mo.patch queue-4.19/fbcon-check-font-dimension-limits.patch queue-4.19/netfilter-nft_tproxy-restrict-to-prerouting-hook.patch queue-4.19/revert-x86-fpu-use-_alignof-to-avoid-undefined-behavior-in-type_align.patch queue-4.19/vc_screen-move-load-of-struct-vc_data-pointer-in-vcs.patch queue-4.19/riscv-fixup-race-condition-on-pg_dcache_clean-in-flush_icache_pte.patch queue-4.19/watchdog-diag288_wdt-do-not-use-stack-buffers-for-hardware-data.patch queue-4.19/serial-8250_dma-fix-dma-rx-rearm-race.patch queue-4.19/aio-fix-mremap-after-fork-null-deref.patch queue-4.19/mm-swapfile-add-cond_resched-in-get_swap_pages.patch queue-4.19/iio-adc-twl6030-enable-measurements-of-vusb-vbat-and-others.patch queue-4.19/bpf-always-return-target-ifindex-in-bpf_fib_lookup.patch queue-4.19/net-usb-fix-wrong-direction-warning-in-plusb.c.patch queue-4.19/efi-accept-version-2-of-memory-attributes-table.patch queue-4.19/firewire-fix-memory-leak-for-payload-of-request-subaction-to-iec-61883-1-fcp-region.patch queue-4.19/arm64-dts-meson-gx-make-mmc-host-controller-interrupts-level-sensitive.patch queue-4.19/serial-8250_dma-fix-dma-rx-completion-race.patch queue-4.19/thermal-intel-int340x-add-locking-to-int340x_thermal_get_trip_type.patch queue-4.19/usb-typec-altmodes-displayport-fix-probe-pin-assign-check.patch queue-4.19/iio-adc-berlin2-adc-add-missing-of_node_put-in-error-path.patch queue-4.19/arm64-dts-meson-axg-make-mmc-host-controller-interrupts-level-sensitive.patch queue-4.19/btrfs-limit-device-extents-to-the-device-size.patch queue-4.19/mm-hugetlb-proc-check-for-hugetlb-shared-pmd-in-proc-pid-smaps.patch queue-4.19/iio-hid-fix-the-retval-in-accel_3d_capture_sample.patch queue-4.19/alsa-emux-avoid-potential-array-out-of-bound-in-snd_emux_xg_control.patch queue-4.19/watchdog-diag288_wdt-fix-__diag288-inline-assembly.patch queue-4.19/parisc-wire-up-ptrace_getregs-ptrace_setregs-for-compat-case.patch queue-4.19/parisc-fix-return-code-of-pdc_iodc_print.patch queue-4.19/usb-gadget-f_fs-fix-unbalanced-spinlock-in-__ffs_ep0.patch queue-4.19/usb-dwc3-dwc3-qcom-fix-typo-in-the-dwc3-vbus-overrid.patch queue-4.19/squashfs-fix-handling-and-sanity-checking-of-xattr_ids-count.patch