From: Greg Kroah-Hartman Date: Fri, 17 Feb 2023 14:37:38 +0000 (+0100) Subject: 4.14-stable patches X-Git-Tag: v4.14.306~52 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7831b64c2407a0097f6b858dc731229722680338;p=thirdparty%2Fkernel%2Fstable-queue.git 4.14-stable patches added patches: revert-x86-fpu-use-_alignof-to-avoid-undefined-behavior-in-type_align.patch --- diff --git a/queue-4.14/revert-x86-fpu-use-_alignof-to-avoid-undefined-behavior-in-type_align.patch b/queue-4.14/revert-x86-fpu-use-_alignof-to-avoid-undefined-behavior-in-type_align.patch new file mode 100644 index 00000000000..47cc964536c --- /dev/null +++ b/queue-4.14/revert-x86-fpu-use-_alignof-to-avoid-undefined-behavior-in-type_align.patch @@ -0,0 +1,49 @@ +From 9d98dfafc22f9651c0d6c4f99c4bab36417e3743 Mon Sep 17 00:00:00 2001 +From: Greg Kroah-Hartman +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 + +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 +Link: https://lore.kernel.org/r/HE1PR0902MB188277E37DED663AE440510BE1D99@HE1PR0902MB1882.eurprd09.prod.outlook.com +Link: https://bugzilla.kernel.org/show_bug.cgi?id=217013 +Cc: YingChi Long +Cc: Borislav Petkov +Cc: Nick Desaulniers +Cc: Nathan Chancellor +Signed-off-by: Greg Kroah-Hartman +--- + 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: diff --git a/queue-4.14/series b/queue-4.14/series index b0255cecb0a..2fbfd6a8f5b 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -35,3 +35,4 @@ tools-virtio-fix-the-vringh-test-for-virtio-ring-cha.patch net-rose-fix-to-not-accept-on-connected-socket.patch nvme-fc-fix-a-missing-queue-put-in-nvmet_fc_ls_creat.patch aio-fix-mremap-after-fork-null-deref.patch +revert-x86-fpu-use-_alignof-to-avoid-undefined-behavior-in-type_align.patch