]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 4 Jan 2021 10:31:04 +0000 (11:31 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 4 Jan 2021 10:31:04 +0000 (11:31 +0100)
added patches:
uapi-move-constants-from-linux-kernel.h-to-linux-const.h.patch

queue-4.4/series
queue-4.4/uapi-move-constants-from-linux-kernel.h-to-linux-const.h.patch [new file with mode: 0644]
queue-4.4/usb-serial-digi_acceleport-fix-write-wakeup-deadlock.patch

index d3c99afd7c79d91b5735715462e2baa7ef26f519..02c8d84d238aea7b6754008de90443823f646ef8 100644 (file)
@@ -8,3 +8,4 @@ s390-smp-use-smp_get_base_cpu-helper-function.patch
 s390-smp-perform-initial-cpu-reset-also-for-smt-sibl.patch
 s390-dasd-fix-hanging-device-offline-processing.patch
 usb-serial-digi_acceleport-fix-write-wakeup-deadlock.patch
+uapi-move-constants-from-linux-kernel.h-to-linux-const.h.patch
diff --git a/queue-4.4/uapi-move-constants-from-linux-kernel.h-to-linux-const.h.patch b/queue-4.4/uapi-move-constants-from-linux-kernel.h-to-linux-const.h.patch
new file mode 100644 (file)
index 0000000..06c1e50
--- /dev/null
@@ -0,0 +1,104 @@
+From a85cbe6159ffc973e5702f70a3bd5185f8f3c38d Mon Sep 17 00:00:00 2001
+From: Petr Vorel <petr.vorel@gmail.com>
+Date: Mon, 14 Dec 2020 19:03:21 -0800
+Subject: uapi: move constants from <linux/kernel.h> to <linux/const.h>
+
+From: Petr Vorel <petr.vorel@gmail.com>
+
+commit a85cbe6159ffc973e5702f70a3bd5185f8f3c38d upstream.
+
+and include <linux/const.h> in UAPI headers instead of <linux/kernel.h>.
+
+The reason is to avoid indirect <linux/sysinfo.h> include when using
+some network headers: <linux/netlink.h> or others -> <linux/kernel.h>
+-> <linux/sysinfo.h>.
+
+This indirect include causes on MUSL redefinition of struct sysinfo when
+included both <sys/sysinfo.h> 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 <petr.vorel@gmail.com>
+Suggested-by: Rich Felker <dalias@aerifal.cx>
+Acked-by: Rich Felker <dalias@libc.org>
+Cc: Peter Korsgaard <peter@korsgaard.com>
+Cc: Baruch Siach <baruch@tkos.co.il>
+Cc: Florian Weimer <fweimer@redhat.com>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ include/uapi/linux/const.h              |    5 +++++
+ include/uapi/linux/lightnvm.h           |    2 +-
+ include/uapi/linux/netfilter/x_tables.h |    2 +-
+ include/uapi/linux/netlink.h            |    2 +-
+ include/uapi/linux/sysctl.h             |    2 +-
+ 5 files changed, 9 insertions(+), 4 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/lightnvm.h
++++ b/include/uapi/linux/lightnvm.h
+@@ -20,7 +20,7 @@
+ #define _UAPI_LINUX_LIGHTNVM_H
+ #ifdef __KERNEL__
+-#include <linux/kernel.h>
++#include <linux/const.h>
+ #include <linux/ioctl.h>
+ #else /* __KERNEL__ */
+ #include <stdio.h>
+--- 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 <linux/kernel.h>
++#include <linux/const.h>
+ #include <linux/types.h>
+ #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 <linux/kernel.h>
++#include <linux/const.h>
+ #include <linux/socket.h> /* for __kernel_sa_family_t */
+ #include <linux/types.h>
+--- 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 <linux/kernel.h>
++#include <linux/const.h>
+ #include <linux/types.h>
+ #include <linux/compiler.h>
index 6ef9d03a9b566e413565f53cc8df4211d30e78b2..ea15dfb85611e4ff65b893e2bf7449a6fe7ce0ce 100644 (file)
@@ -21,12 +21,11 @@ Cc: stable@vger.kernel.org
 Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 Signed-off-by: Johan Hovold <johan@kernel.org>
 Signed-off-by: Sasha Levin <sashal@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 ---
- 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 be93b9ff2d989..b630048c49883 100644
 --- a/drivers/usb/serial/digi_acceleport.c
 +++ b/drivers/usb/serial/digi_acceleport.c
 @@ -23,7 +23,6 @@
@@ -79,7 +78,7 @@ index be93b9ff2d989..b630048c49883 100644
  /*
   *  Digi Write OOB Command
   *
-@@ -986,6 +963,7 @@ static void digi_write_bulk_callback(struct urb *urb)
+@@ -986,6 +963,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 be93b9ff2d989..b630048c49883 100644
  
        /* port and serial sanity check */
        if (port == NULL || (priv = usb_get_serial_port_data(port)) == NULL) {
-@@ -1012,6 +990,7 @@ static void digi_write_bulk_callback(struct urb *urb)
+@@ -1012,6 +990,7 @@ static void digi_write_bulk_callback(str
        }
  
        /* try to send any buffered data on this port */
@@ -95,7 +94,7 @@ index be93b9ff2d989..b630048c49883 100644
        spin_lock(&priv->dp_port_lock);
        priv->dp_write_urb_in_use = 0;
        if (priv->dp_out_buf_len > 0) {
-@@ -1027,19 +1006,18 @@ static void digi_write_bulk_callback(struct urb *urb)
+@@ -1027,19 +1006,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 be93b9ff2d989..b630048c49883 100644
  }
  
  static int digi_write_room(struct tty_struct *tty)
-@@ -1239,7 +1217,6 @@ static int digi_port_init(struct usb_serial_port *port, unsigned port_num)
+@@ -1239,7 +1217,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 be93b9ff2d989..b630048c49883 100644
        priv->dp_port = port;
  
        init_waitqueue_head(&port->write_wait);
-@@ -1525,13 +1502,14 @@ static int digi_read_oob_callback(struct urb *urb)
+@@ -1525,13 +1502,14 @@ static int digi_read_oob_callback(struct
                        rts = tty->termios.c_cflag & CRTSCTS;
                
                if (tty && opcode == DIGI_CMD_READ_INPUT_SIGNALS) {
@@ -145,7 +144,7 @@ index be93b9ff2d989..b630048c49883 100644
                        } else {
                                priv->dp_modem_signals &= ~TIOCM_CTS;
                                /* port must be open to use tty struct */
-@@ -1550,6 +1528,9 @@ static int digi_read_oob_callback(struct urb *urb)
+@@ -1550,6 +1528,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 be93b9ff2d989..b630048c49883 100644
                } else if (opcode == DIGI_CMD_TRANSMIT_IDLE) {
                        spin_lock(&priv->dp_port_lock);
                        priv->dp_transmit_idle = 1;
--- 
-2.27.0
-