From: Greg Kroah-Hartman Date: Mon, 4 Jan 2021 10:33:53 +0000 (+0100) Subject: 4.9-stable patches X-Git-Tag: v4.19.165~29 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=36c96a895a2eb088a9fffeb1e77c473412e0ac82;p=thirdparty%2Fkernel%2Fstable-queue.git 4.9-stable patches added patches: uapi-move-constants-from-linux-kernel.h-to-linux-const.h.patch --- diff --git a/queue-4.9/series b/queue-4.9/series index 2c8d9a647a1..ccd586ca1f7 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -12,3 +12,4 @@ s390-dasd-fix-hanging-device-offline-processing.patch usb-serial-digi_acceleport-fix-write-wakeup-deadlock.patch net-ipv6-keep-sk-status-consistent-after-datagram-connect-failure.patch l2tp-fix-races-with-ipv4-mapped-ipv6-addresses.patch +uapi-move-constants-from-linux-kernel.h-to-linux-const.h.patch diff --git a/queue-4.9/uapi-move-constants-from-linux-kernel.h-to-linux-const.h.patch b/queue-4.9/uapi-move-constants-from-linux-kernel.h-to-linux-const.h.patch new file mode 100644 index 00000000000..3b336dce7f2 --- /dev/null +++ b/queue-4.9/uapi-move-constants-from-linux-kernel.h-to-linux-const.h.patch @@ -0,0 +1,146 @@ +From a85cbe6159ffc973e5702f70a3bd5185f8f3c38d Mon Sep 17 00:00:00 2001 +From: Petr Vorel +Date: Mon, 14 Dec 2020 19:03:21 -0800 +Subject: uapi: move constants from to + +From: Petr Vorel + +commit a85cbe6159ffc973e5702f70a3bd5185f8f3c38d upstream. + +and include in UAPI headers instead of . + +The reason is to avoid indirect include when using +some network headers: or others -> +-> . + +This indirect include causes on MUSL redefinition of struct sysinfo when +included both and some of UAPI headers: + + In file included from x86_64-buildroot-linux-musl/sysroot/usr/include/linux/kernel.h:5, + from x86_64-buildroot-linux-musl/sysroot/usr/include/linux/netlink.h:5, + from ../include/tst_netlink.h:14, + from tst_crypto.c:13: + x86_64-buildroot-linux-musl/sysroot/usr/include/linux/sysinfo.h:8:8: error: redefinition of `struct sysinfo' + struct sysinfo { + ^~~~~~~ + In file included from ../include/tst_safe_macros.h:15, + from ../include/tst_test.h:93, + from tst_crypto.c:11: + x86_64-buildroot-linux-musl/sysroot/usr/include/sys/sysinfo.h:10:8: note: originally defined here + +Link: https://lkml.kernel.org/r/20201015190013.8901-1-petr.vorel@gmail.com +Signed-off-by: Petr Vorel +Suggested-by: Rich Felker +Acked-by: Rich Felker +Cc: Peter Korsgaard +Cc: Baruch Siach +Cc: Florian Weimer +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + include/uapi/linux/const.h | 5 +++++ + include/uapi/linux/ethtool.h | 2 +- + include/uapi/linux/kernel.h | 9 +-------- + include/uapi/linux/lightnvm.h | 2 +- + include/uapi/linux/mroute6.h | 2 +- + include/uapi/linux/netfilter/x_tables.h | 2 +- + include/uapi/linux/netlink.h | 2 +- + include/uapi/linux/sysctl.h | 2 +- + 8 files changed, 12 insertions(+), 14 deletions(-) + +--- a/include/uapi/linux/const.h ++++ b/include/uapi/linux/const.h +@@ -24,4 +24,9 @@ + #define _BITUL(x) (_AC(1,UL) << (x)) + #define _BITULL(x) (_AC(1,ULL) << (x)) + ++#define __ALIGN_KERNEL(x, a) __ALIGN_KERNEL_MASK(x, (typeof(x))(a) - 1) ++#define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask)) ++ ++#define __KERNEL_DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d)) ++ + #endif /* !(_LINUX_CONST_H) */ +--- a/include/uapi/linux/ethtool.h ++++ b/include/uapi/linux/ethtool.h +@@ -13,7 +13,7 @@ + #ifndef _UAPI_LINUX_ETHTOOL_H + #define _UAPI_LINUX_ETHTOOL_H + +-#include ++#include + #include + #include + +--- a/include/uapi/linux/kernel.h ++++ b/include/uapi/linux/kernel.h +@@ -2,13 +2,6 @@ + #define _UAPI_LINUX_KERNEL_H + + #include +- +-/* +- * 'kernel.h' contains some often-used function prototypes etc +- */ +-#define __ALIGN_KERNEL(x, a) __ALIGN_KERNEL_MASK(x, (typeof(x))(a) - 1) +-#define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask)) +- +-#define __KERNEL_DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d)) ++#include + + #endif /* _UAPI_LINUX_KERNEL_H */ +--- a/include/uapi/linux/lightnvm.h ++++ b/include/uapi/linux/lightnvm.h +@@ -20,7 +20,7 @@ + #define _UAPI_LINUX_LIGHTNVM_H + + #ifdef __KERNEL__ +-#include ++#include + #include + #else /* __KERNEL__ */ + #include +--- a/include/uapi/linux/mroute6.h ++++ b/include/uapi/linux/mroute6.h +@@ -1,7 +1,7 @@ + #ifndef _UAPI__LINUX_MROUTE6_H + #define _UAPI__LINUX_MROUTE6_H + +-#include ++#include + #include + #include + #include /* For struct sockaddr_in6. */ +--- a/include/uapi/linux/netfilter/x_tables.h ++++ b/include/uapi/linux/netfilter/x_tables.h +@@ -1,6 +1,6 @@ + #ifndef _UAPI_X_TABLES_H + #define _UAPI_X_TABLES_H +-#include ++#include + #include + + #define XT_FUNCTION_MAXNAMELEN 30 +--- a/include/uapi/linux/netlink.h ++++ b/include/uapi/linux/netlink.h +@@ -1,7 +1,7 @@ + #ifndef _UAPI__LINUX_NETLINK_H + #define _UAPI__LINUX_NETLINK_H + +-#include ++#include + #include /* for __kernel_sa_family_t */ + #include + +--- a/include/uapi/linux/sysctl.h ++++ b/include/uapi/linux/sysctl.h +@@ -22,7 +22,7 @@ + #ifndef _UAPI_LINUX_SYSCTL_H + #define _UAPI_LINUX_SYSCTL_H + +-#include ++#include + #include + #include + diff --git a/queue-4.9/usb-serial-digi_acceleport-fix-write-wakeup-deadlock.patch b/queue-4.9/usb-serial-digi_acceleport-fix-write-wakeup-deadlock.patch index 462901d320b..0cdfa7e3014 100644 --- a/queue-4.9/usb-serial-digi_acceleport-fix-write-wakeup-deadlock.patch +++ b/queue-4.9/usb-serial-digi_acceleport-fix-write-wakeup-deadlock.patch @@ -21,12 +21,11 @@ Cc: stable@vger.kernel.org Reviewed-by: Greg Kroah-Hartman Signed-off-by: Johan Hovold Signed-off-by: Sasha Levin +Signed-off-by: Greg Kroah-Hartman --- - drivers/usb/serial/digi_acceleport.c | 45 ++++++++-------------------- + drivers/usb/serial/digi_acceleport.c | 45 ++++++++++------------------------- 1 file changed, 13 insertions(+), 32 deletions(-) -diff --git a/drivers/usb/serial/digi_acceleport.c b/drivers/usb/serial/digi_acceleport.c -index 7ab3235febfc9..4aa6fe834091e 100644 --- a/drivers/usb/serial/digi_acceleport.c +++ b/drivers/usb/serial/digi_acceleport.c @@ -23,7 +23,6 @@ @@ -79,7 +78,7 @@ index 7ab3235febfc9..4aa6fe834091e 100644 /* * Digi Write OOB Command * -@@ -985,6 +962,7 @@ static void digi_write_bulk_callback(struct urb *urb) +@@ -985,6 +962,7 @@ static void digi_write_bulk_callback(str struct digi_serial *serial_priv; int ret = 0; int status = urb->status; @@ -87,7 +86,7 @@ index 7ab3235febfc9..4aa6fe834091e 100644 /* port and serial sanity check */ if (port == NULL || (priv = usb_get_serial_port_data(port)) == NULL) { -@@ -1011,6 +989,7 @@ static void digi_write_bulk_callback(struct urb *urb) +@@ -1011,6 +989,7 @@ static void digi_write_bulk_callback(str } /* try to send any buffered data on this port */ @@ -95,7 +94,7 @@ index 7ab3235febfc9..4aa6fe834091e 100644 spin_lock(&priv->dp_port_lock); priv->dp_write_urb_in_use = 0; if (priv->dp_out_buf_len > 0) { -@@ -1026,19 +1005,18 @@ static void digi_write_bulk_callback(struct urb *urb) +@@ -1026,19 +1005,18 @@ static void digi_write_bulk_callback(str if (ret == 0) { priv->dp_write_urb_in_use = 1; priv->dp_out_buf_len = 0; @@ -120,7 +119,7 @@ index 7ab3235febfc9..4aa6fe834091e 100644 } static int digi_write_room(struct tty_struct *tty) -@@ -1238,7 +1216,6 @@ static int digi_port_init(struct usb_serial_port *port, unsigned port_num) +@@ -1238,7 +1216,6 @@ static int digi_port_init(struct usb_ser init_waitqueue_head(&priv->dp_transmit_idle_wait); init_waitqueue_head(&priv->dp_flush_wait); init_waitqueue_head(&priv->dp_close_wait); @@ -128,7 +127,7 @@ index 7ab3235febfc9..4aa6fe834091e 100644 priv->dp_port = port; init_waitqueue_head(&port->write_wait); -@@ -1524,13 +1501,14 @@ static int digi_read_oob_callback(struct urb *urb) +@@ -1524,13 +1501,14 @@ static int digi_read_oob_callback(struct rts = C_CRTSCTS(tty); if (tty && opcode == DIGI_CMD_READ_INPUT_SIGNALS) { @@ -145,7 +144,7 @@ index 7ab3235febfc9..4aa6fe834091e 100644 } else { priv->dp_modem_signals &= ~TIOCM_CTS; /* port must be open to use tty struct */ -@@ -1549,6 +1527,9 @@ static int digi_read_oob_callback(struct urb *urb) +@@ -1549,6 +1527,9 @@ static int digi_read_oob_callback(struct priv->dp_modem_signals &= ~TIOCM_CD; spin_unlock(&priv->dp_port_lock); @@ -155,6 +154,3 @@ index 7ab3235febfc9..4aa6fe834091e 100644 } else if (opcode == DIGI_CMD_TRANSMIT_IDLE) { spin_lock(&priv->dp_port_lock); priv->dp_transmit_idle = 1; --- -2.27.0 -