From: Greg Kroah-Hartman Date: Tue, 19 Feb 2019 09:34:13 +0000 (+0100) Subject: 4.14-stable patches X-Git-Tag: v3.18.135~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b1c8951252bb57db9b3efa3528db25a17a58445e;p=thirdparty%2Fkernel%2Fstable-queue.git 4.14-stable patches added patches: uapi-if_ether.h-move-__uapi_def_ethhdr-libc-define.patch --- diff --git a/queue-4.14/series b/queue-4.14/series index 5e3134cfb6d..06df1b792f8 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -60,3 +60,4 @@ drm-i915-prevent-a-race-during-i915_gem_mmap-ioctl-with-wc-set.patch sched-trace-fix-prev_state-output-in-sched_switch-tracepoint.patch futex-cure-exit-race.patch pinctrl-msm-fix-gpio-hog-related-boot-issues.patch +uapi-if_ether.h-move-__uapi_def_ethhdr-libc-define.patch diff --git a/queue-4.14/uapi-if_ether.h-move-__uapi_def_ethhdr-libc-define.patch b/queue-4.14/uapi-if_ether.h-move-__uapi_def_ethhdr-libc-define.patch new file mode 100644 index 00000000000..8700749c65d --- /dev/null +++ b/queue-4.14/uapi-if_ether.h-move-__uapi_def_ethhdr-libc-define.patch @@ -0,0 +1,87 @@ +From da360299b6734135a5f66d7db458dcc7801c826a Mon Sep 17 00:00:00 2001 +From: Hauke Mehrtens +Date: Mon, 12 Feb 2018 23:59:51 +0100 +Subject: uapi/if_ether.h: move __UAPI_DEF_ETHHDR libc define + +From: Hauke Mehrtens + +commit da360299b6734135a5f66d7db458dcc7801c826a upstream. + +This fixes a compile problem of some user space applications by not +including linux/libc-compat.h in uapi/if_ether.h. + +linux/libc-compat.h checks which "features" the header files, included +from the libc, provide to make the Linux kernel uapi header files only +provide no conflicting structures and enums. If a user application mixes +kernel headers and libc headers it could happen that linux/libc-compat.h +gets included too early where not all other libc headers are included +yet. Then the linux/libc-compat.h would not prevent all the +redefinitions and we run into compile problems. +This patch removes the include of linux/libc-compat.h from +uapi/if_ether.h to fix the recently introduced case, but not all as this +is more or less impossible. + +It is no problem to do the check directly in the if_ether.h file and not +in libc-compat.h as this does not need any fancy glibc header detection +as glibc never provided struct ethhdr and should define +__UAPI_DEF_ETHHDR by them self when they will provide this. + +The following test program did not compile correctly any more: + +#include +#include +#include + +int main(void) +{ + return 0; +} + +Fixes: 6926e041a892 ("uapi/if_ether.h: prevent redefinition of struct ethhdr") +Reported-by: Guillaume Nault +Cc: # 4.15 +Signed-off-by: Hauke Mehrtens +Signed-off-by: David S. Miller +Cc: Sudip Mukherjee +Signed-off-by: Greg Kroah-Hartman + +--- + include/uapi/linux/if_ether.h | 6 +++++- + include/uapi/linux/libc-compat.h | 6 ------ + 2 files changed, 5 insertions(+), 7 deletions(-) + +--- a/include/uapi/linux/if_ether.h ++++ b/include/uapi/linux/if_ether.h +@@ -23,7 +23,6 @@ + #define _UAPI_LINUX_IF_ETHER_H + + #include +-#include + + /* + * IEEE 802.3 Ethernet magic constants. The frame sizes omit the preamble +@@ -151,6 +150,11 @@ + * This is an Ethernet frame header. + */ + ++/* allow libcs like musl to deactivate this, glibc does not implement this. */ ++#ifndef __UAPI_DEF_ETHHDR ++#define __UAPI_DEF_ETHHDR 1 ++#endif ++ + #if __UAPI_DEF_ETHHDR + struct ethhdr { + unsigned char h_dest[ETH_ALEN]; /* destination eth addr */ +--- a/include/uapi/linux/libc-compat.h ++++ b/include/uapi/linux/libc-compat.h +@@ -264,10 +264,4 @@ + + #endif /* __GLIBC__ */ + +-/* Definitions for if_ether.h */ +-/* allow libcs like musl to deactivate this, glibc does not implement this. */ +-#ifndef __UAPI_DEF_ETHHDR +-#define __UAPI_DEF_ETHHDR 1 +-#endif +- + #endif /* _UAPI_LIBC_COMPAT_H */