]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 13 Feb 2018 16:32:25 +0000 (17:32 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 13 Feb 2018 16:32:25 +0000 (17:32 +0100)
added patches:
cifs-fix-autonegotiate-security-settings-mismatch.patch
cifs-fix-missing-put_xid-in-cifs_file_strict_mmap.patch
cifs-zero-sensitive-data-when-freeing.patch
dccp-cve-2017-8824-use-after-free-in-dccp-code.patch
dmaengine-dmatest-fix-container_of-member-in-dmatest_callback.patch
kaiser-fix-compile-error-without-vsyscall.patch
media-dvb-usb-v2-lmedm04-improve-logic-checking-of-warm-start.patch
media-dvb-usb-v2-lmedm04-move-ts2020-attach-to-dm04_lme2510_tuner.patch
netfilter-nf_queue-make-the-queue_handler-pernet.patch
posix-timer-properly-check-sigevent-sigev_notify.patch
powerpc-pseries-include-linux-types.h-in-asm-hvcall.h.patch
sched-rt-up-the-root-domain-ref-count-when-passing-it-around-via-ipis.patch
sched-rt-use-container_of-to-get-root-domain-in-rto_push_irq_work_func.patch
usb-gadget-uvc-missing-files-for-configfs-interface.patch
x86-kaiser-fix-build-error-with-kasan-function_graph_tracer.patch

16 files changed:
queue-4.4/cifs-fix-autonegotiate-security-settings-mismatch.patch [new file with mode: 0644]
queue-4.4/cifs-fix-missing-put_xid-in-cifs_file_strict_mmap.patch [new file with mode: 0644]
queue-4.4/cifs-zero-sensitive-data-when-freeing.patch [new file with mode: 0644]
queue-4.4/dccp-cve-2017-8824-use-after-free-in-dccp-code.patch [new file with mode: 0644]
queue-4.4/dmaengine-dmatest-fix-container_of-member-in-dmatest_callback.patch [new file with mode: 0644]
queue-4.4/kaiser-fix-compile-error-without-vsyscall.patch [new file with mode: 0644]
queue-4.4/media-dvb-usb-v2-lmedm04-improve-logic-checking-of-warm-start.patch [new file with mode: 0644]
queue-4.4/media-dvb-usb-v2-lmedm04-move-ts2020-attach-to-dm04_lme2510_tuner.patch [new file with mode: 0644]
queue-4.4/netfilter-nf_queue-make-the-queue_handler-pernet.patch [new file with mode: 0644]
queue-4.4/posix-timer-properly-check-sigevent-sigev_notify.patch [new file with mode: 0644]
queue-4.4/powerpc-pseries-include-linux-types.h-in-asm-hvcall.h.patch [new file with mode: 0644]
queue-4.4/sched-rt-up-the-root-domain-ref-count-when-passing-it-around-via-ipis.patch [new file with mode: 0644]
queue-4.4/sched-rt-use-container_of-to-get-root-domain-in-rto_push_irq_work_func.patch [new file with mode: 0644]
queue-4.4/series
queue-4.4/usb-gadget-uvc-missing-files-for-configfs-interface.patch [new file with mode: 0644]
queue-4.4/x86-kaiser-fix-build-error-with-kasan-function_graph_tracer.patch [new file with mode: 0644]

diff --git a/queue-4.4/cifs-fix-autonegotiate-security-settings-mismatch.patch b/queue-4.4/cifs-fix-autonegotiate-security-settings-mismatch.patch
new file mode 100644 (file)
index 0000000..036d2ac
--- /dev/null
@@ -0,0 +1,47 @@
+From 9aca7e454415f7878b28524e76bebe1170911a88 Mon Sep 17 00:00:00 2001
+From: Daniel N Pettersson <danielnp@axis.com>
+Date: Thu, 11 Jan 2018 16:00:12 +0100
+Subject: cifs: Fix autonegotiate security settings mismatch
+
+From: Daniel N Pettersson <danielnp@axis.com>
+
+commit 9aca7e454415f7878b28524e76bebe1170911a88 upstream.
+
+Autonegotiation gives a security settings mismatch error if the SMB
+server selects an SMBv3 dialect that isn't SMB3.02. The exact error is
+"protocol revalidation - security settings mismatch".
+This can be tested using Samba v4.2 or by setting the global Samba
+setting max protocol = SMB3_00.
+
+The check that fails in smb3_validate_negotiate is the dialect
+verification of the negotiate info response. This is because it tries
+to verify against the protocol_id in the global smbdefault_values. The
+protocol_id in smbdefault_values is SMB3.02.
+In SMB2_negotiate the protocol_id in smbdefault_values isn't updated,
+it is global so it probably shouldn't be, but server->dialect is.
+
+This patch changes the check in smb3_validate_negotiate to use
+server->dialect instead of server->vals->protocol_id. The patch works
+with autonegotiate and when using a specific version in the vers mount
+option.
+
+Signed-off-by: Daniel N Pettersson <danielnp@axis.com>
+Signed-off-by: Steve French <smfrench@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/cifs/smb2pdu.c |    3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+--- a/fs/cifs/smb2pdu.c
++++ b/fs/cifs/smb2pdu.c
+@@ -580,8 +580,7 @@ int smb3_validate_negotiate(const unsign
+       }
+       /* check validate negotiate info response matches what we got earlier */
+-      if (pneg_rsp->Dialect !=
+-                      cpu_to_le16(tcon->ses->server->vals->protocol_id))
++      if (pneg_rsp->Dialect != cpu_to_le16(tcon->ses->server->dialect))
+               goto vneg_out;
+       if (pneg_rsp->SecurityMode != cpu_to_le16(tcon->ses->server->sec_mode))
diff --git a/queue-4.4/cifs-fix-missing-put_xid-in-cifs_file_strict_mmap.patch b/queue-4.4/cifs-fix-missing-put_xid-in-cifs_file_strict_mmap.patch
new file mode 100644 (file)
index 0000000..0c41477
--- /dev/null
@@ -0,0 +1,74 @@
+From f04a703c3d613845ae3141bfaf223489de8ab3eb Mon Sep 17 00:00:00 2001
+From: Matthew Wilcox <mawilcox@microsoft.com>
+Date: Fri, 15 Dec 2017 12:48:32 -0800
+Subject: cifs: Fix missing put_xid in cifs_file_strict_mmap
+
+From: Matthew Wilcox <mawilcox@microsoft.com>
+
+commit f04a703c3d613845ae3141bfaf223489de8ab3eb upstream.
+
+If cifs_zap_mapping() returned an error, we would return without putting
+the xid that we got earlier.  Restructure cifs_file_strict_mmap() and
+cifs_file_mmap() to be more similar to each other and have a single
+point of return that always puts the xid.
+
+Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com>
+Signed-off-by: Steve French <smfrench@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/cifs/file.c |   26 ++++++++++++--------------
+ 1 file changed, 12 insertions(+), 14 deletions(-)
+
+--- a/fs/cifs/file.c
++++ b/fs/cifs/file.c
+@@ -3241,20 +3241,18 @@ static const struct vm_operations_struct
+ int cifs_file_strict_mmap(struct file *file, struct vm_area_struct *vma)
+ {
+-      int rc, xid;
++      int xid, rc = 0;
+       struct inode *inode = file_inode(file);
+       xid = get_xid();
+-      if (!CIFS_CACHE_READ(CIFS_I(inode))) {
++      if (!CIFS_CACHE_READ(CIFS_I(inode)))
+               rc = cifs_zap_mapping(inode);
+-              if (rc)
+-                      return rc;
+-      }
+-
+-      rc = generic_file_mmap(file, vma);
+-      if (rc == 0)
++      if (!rc)
++              rc = generic_file_mmap(file, vma);
++      if (!rc)
+               vma->vm_ops = &cifs_file_vm_ops;
++
+       free_xid(xid);
+       return rc;
+ }
+@@ -3264,16 +3262,16 @@ int cifs_file_mmap(struct file *file, st
+       int rc, xid;
+       xid = get_xid();
++
+       rc = cifs_revalidate_file(file);
+-      if (rc) {
++      if (rc)
+               cifs_dbg(FYI, "Validation prior to mmap failed, error=%d\n",
+                        rc);
+-              free_xid(xid);
+-              return rc;
+-      }
+-      rc = generic_file_mmap(file, vma);
+-      if (rc == 0)
++      if (!rc)
++              rc = generic_file_mmap(file, vma);
++      if (!rc)
+               vma->vm_ops = &cifs_file_vm_ops;
++
+       free_xid(xid);
+       return rc;
+ }
diff --git a/queue-4.4/cifs-zero-sensitive-data-when-freeing.patch b/queue-4.4/cifs-zero-sensitive-data-when-freeing.patch
new file mode 100644 (file)
index 0000000..6124a31
--- /dev/null
@@ -0,0 +1,96 @@
+From 97f4b7276b829a8927ac903a119bef2f963ccc58 Mon Sep 17 00:00:00 2001
+From: Aurelien Aptel <aaptel@suse.com>
+Date: Thu, 25 Jan 2018 15:59:39 +0100
+Subject: CIFS: zero sensitive data when freeing
+
+From: Aurelien Aptel <aaptel@suse.com>
+
+commit 97f4b7276b829a8927ac903a119bef2f963ccc58 upstream.
+
+also replaces memset()+kfree() by kzfree().
+
+Signed-off-by: Aurelien Aptel <aaptel@suse.com>
+Signed-off-by: Steve French <smfrench@gmail.com>
+Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/cifs/cifsencrypt.c |    3 +--
+ fs/cifs/connect.c     |    6 +++---
+ fs/cifs/misc.c        |   14 ++++----------
+ 3 files changed, 8 insertions(+), 15 deletions(-)
+
+--- a/fs/cifs/cifsencrypt.c
++++ b/fs/cifs/cifsencrypt.c
+@@ -306,9 +306,8 @@ int calc_lanman_hash(const char *passwor
+ {
+       int i;
+       int rc;
+-      char password_with_pad[CIFS_ENCPWD_SIZE];
++      char password_with_pad[CIFS_ENCPWD_SIZE] = {0};
+-      memset(password_with_pad, 0, CIFS_ENCPWD_SIZE);
+       if (password)
+               strncpy(password_with_pad, password, CIFS_ENCPWD_SIZE);
+--- a/fs/cifs/connect.c
++++ b/fs/cifs/connect.c
+@@ -1695,7 +1695,7 @@ cifs_parse_mount_options(const char *mou
+                       tmp_end++;
+                       if (!(tmp_end < end && tmp_end[1] == delim)) {
+                               /* No it is not. Set the password to NULL */
+-                              kfree(vol->password);
++                              kzfree(vol->password);
+                               vol->password = NULL;
+                               break;
+                       }
+@@ -1733,7 +1733,7 @@ cifs_parse_mount_options(const char *mou
+                                       options = end;
+                       }
+-                      kfree(vol->password);
++                      kzfree(vol->password);
+                       /* Now build new password string */
+                       temp_len = strlen(value);
+                       vol->password = kzalloc(temp_len+1, GFP_KERNEL);
+@@ -4148,7 +4148,7 @@ cifs_construct_tcon(struct cifs_sb_info
+               reset_cifs_unix_caps(0, tcon, NULL, vol_info);
+ out:
+       kfree(vol_info->username);
+-      kfree(vol_info->password);
++      kzfree(vol_info->password);
+       kfree(vol_info);
+       return tcon;
+--- a/fs/cifs/misc.c
++++ b/fs/cifs/misc.c
+@@ -99,14 +99,11 @@ sesInfoFree(struct cifs_ses *buf_to_free
+       kfree(buf_to_free->serverOS);
+       kfree(buf_to_free->serverDomain);
+       kfree(buf_to_free->serverNOS);
+-      if (buf_to_free->password) {
+-              memset(buf_to_free->password, 0, strlen(buf_to_free->password));
+-              kfree(buf_to_free->password);
+-      }
++      kzfree(buf_to_free->password);
+       kfree(buf_to_free->user_name);
+       kfree(buf_to_free->domainName);
+-      kfree(buf_to_free->auth_key.response);
+-      kfree(buf_to_free);
++      kzfree(buf_to_free->auth_key.response);
++      kzfree(buf_to_free);
+ }
+ struct cifs_tcon *
+@@ -137,10 +134,7 @@ tconInfoFree(struct cifs_tcon *buf_to_fr
+       }
+       atomic_dec(&tconInfoAllocCount);
+       kfree(buf_to_free->nativeFileSystem);
+-      if (buf_to_free->password) {
+-              memset(buf_to_free->password, 0, strlen(buf_to_free->password));
+-              kfree(buf_to_free->password);
+-      }
++      kzfree(buf_to_free->password);
+       kfree(buf_to_free);
+ }
diff --git a/queue-4.4/dccp-cve-2017-8824-use-after-free-in-dccp-code.patch b/queue-4.4/dccp-cve-2017-8824-use-after-free-in-dccp-code.patch
new file mode 100644 (file)
index 0000000..9bf5883
--- /dev/null
@@ -0,0 +1,43 @@
+From 69c64866ce072dea1d1e59a0d61e0f66c0dffb76 Mon Sep 17 00:00:00 2001
+From: Mohamed Ghannam <simo.ghannam@gmail.com>
+Date: Tue, 5 Dec 2017 20:58:35 +0000
+Subject: dccp: CVE-2017-8824: use-after-free in DCCP code
+
+From: Mohamed Ghannam <simo.ghannam@gmail.com>
+
+commit 69c64866ce072dea1d1e59a0d61e0f66c0dffb76 upstream.
+
+Whenever the sock object is in DCCP_CLOSED state,
+dccp_disconnect() must free dccps_hc_tx_ccid and
+dccps_hc_rx_ccid and set to NULL.
+
+Signed-off-by: Mohamed Ghannam <simo.ghannam@gmail.com>
+Reviewed-by: Eric Dumazet <edumazet@google.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ net/dccp/proto.c |    5 +++++
+ 1 file changed, 5 insertions(+)
+
+--- a/net/dccp/proto.c
++++ b/net/dccp/proto.c
+@@ -259,6 +259,7 @@ int dccp_disconnect(struct sock *sk, int
+ {
+       struct inet_connection_sock *icsk = inet_csk(sk);
+       struct inet_sock *inet = inet_sk(sk);
++      struct dccp_sock *dp = dccp_sk(sk);
+       int err = 0;
+       const int old_state = sk->sk_state;
+@@ -278,6 +279,10 @@ int dccp_disconnect(struct sock *sk, int
+               sk->sk_err = ECONNRESET;
+       dccp_clear_xmit_timers(sk);
++      ccid_hc_rx_delete(dp->dccps_hc_rx_ccid, sk);
++      ccid_hc_tx_delete(dp->dccps_hc_tx_ccid, sk);
++      dp->dccps_hc_rx_ccid = NULL;
++      dp->dccps_hc_tx_ccid = NULL;
+       __skb_queue_purge(&sk->sk_receive_queue);
+       __skb_queue_purge(&sk->sk_write_queue);
diff --git a/queue-4.4/dmaengine-dmatest-fix-container_of-member-in-dmatest_callback.patch b/queue-4.4/dmaengine-dmatest-fix-container_of-member-in-dmatest_callback.patch
new file mode 100644 (file)
index 0000000..39347a0
--- /dev/null
@@ -0,0 +1,33 @@
+From 66b3bd2356e0a1531c71a3dcf96944621e25c17c Mon Sep 17 00:00:00 2001
+From: Yang Shunyong <shunyong.yang@hxt-semitech.com>
+Date: Mon, 29 Jan 2018 14:40:11 +0800
+Subject: dmaengine: dmatest: fix container_of member in dmatest_callback
+
+From: Yang Shunyong <shunyong.yang@hxt-semitech.com>
+
+commit 66b3bd2356e0a1531c71a3dcf96944621e25c17c upstream.
+
+The type of arg passed to dmatest_callback is struct dmatest_done.
+It refers to test_done in struct dmatest_thread, not done_wait.
+
+Fixes: 6f6a23a213be ("dmaengine: dmatest: move callback wait ...")
+Signed-off-by: Yang Shunyong <shunyong.yang@hxt-semitech.com>
+Acked-by: Adam Wallis <awallis@codeaurora.org>
+Signed-off-by: Vinod Koul <vinod.koul@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/dma/dmatest.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/dma/dmatest.c
++++ b/drivers/dma/dmatest.c
+@@ -329,7 +329,7 @@ static void dmatest_callback(void *arg)
+ {
+       struct dmatest_done *done = arg;
+       struct dmatest_thread *thread =
+-              container_of(arg, struct dmatest_thread, done_wait);
++              container_of(done, struct dmatest_thread, test_done);
+       if (!thread->done) {
+               done->done = true;
+               wake_up_all(done->wait);
diff --git a/queue-4.4/kaiser-fix-compile-error-without-vsyscall.patch b/queue-4.4/kaiser-fix-compile-error-without-vsyscall.patch
new file mode 100644 (file)
index 0000000..1c5369d
--- /dev/null
@@ -0,0 +1,46 @@
+From foo@baz Tue Feb 13 16:45:20 CET 2018
+Date: Tue, 13 Feb 2018 16:45:20 +0100
+To: Greg KH <gregkh@linuxfoundation.org>
+From: Hugh Dickins <hughd@google.com>
+Subject: kaiser: fix compile error without vsyscall
+
+From: Hugh Dickins <hughd@google.com>
+
+Tobias noticed a compile error on 4.4.115, and it's the same on 4.9.80:
+arch/x86/mm/kaiser.c: In function ‘kaiser_init’:
+arch/x86/mm/kaiser.c:348:8: error: ‘vsyscall_pgprot’ undeclared
+                                   (first use in this function)
+
+It seems like his combination of kernel options doesn't work for KAISER.
+X86_VSYSCALL_EMULATION is not set on his system, while LEGACY_VSYSCALL
+is set to NONE (LEGACY_VSYSCALL_NONE=y). He managed to get things
+compiling again, by moving the 'extern unsigned long vsyscall_pgprot'
+outside of the preprocessor statement. This works because the optimizer
+removes that code (vsyscall_enabled() is always false) - and that's how
+it was done in some older backports.
+
+Reported-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
+Signed-off-by: Hugh Dickins <hughd@google.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/x86/include/asm/vsyscall.h |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/arch/x86/include/asm/vsyscall.h
++++ b/arch/x86/include/asm/vsyscall.h
+@@ -13,7 +13,6 @@ extern void map_vsyscall(void);
+  */
+ extern bool emulate_vsyscall(struct pt_regs *regs, unsigned long address);
+ extern bool vsyscall_enabled(void);
+-extern unsigned long vsyscall_pgprot;
+ #else
+ static inline void map_vsyscall(void) {}
+ static inline bool emulate_vsyscall(struct pt_regs *regs, unsigned long address)
+@@ -22,5 +21,6 @@ static inline bool emulate_vsyscall(stru
+ }
+ static inline bool vsyscall_enabled(void) { return false; }
+ #endif
++extern unsigned long vsyscall_pgprot;
+ #endif /* _ASM_X86_VSYSCALL_H */
diff --git a/queue-4.4/media-dvb-usb-v2-lmedm04-improve-logic-checking-of-warm-start.patch b/queue-4.4/media-dvb-usb-v2-lmedm04-improve-logic-checking-of-warm-start.patch
new file mode 100644 (file)
index 0000000..ed9381b
--- /dev/null
@@ -0,0 +1,88 @@
+From 3d932ee27e852e4904647f15b64dedca51187ad7 Mon Sep 17 00:00:00 2001
+From: Malcolm Priestley <tvboxspy@gmail.com>
+Date: Tue, 26 Sep 2017 17:10:20 -0400
+Subject: media: dvb-usb-v2: lmedm04: Improve logic checking of warm start
+
+From: Malcolm Priestley <tvboxspy@gmail.com>
+
+commit 3d932ee27e852e4904647f15b64dedca51187ad7 upstream.
+
+Warm start has no check as whether a genuine device has
+connected and proceeds to next execution path.
+
+Check device should read 0x47 at offset of 2 on USB descriptor read
+and it is the amount requested of 6 bytes.
+
+Fix for
+kasan: CONFIG_KASAN_INLINE enabled
+kasan: GPF could be caused by NULL-ptr deref or user memory access as
+
+Reported-by: Andrey Konovalov <andreyknvl@google.com>
+Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
+Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
+Cc: Ben Hutchings <ben.hutchings@codethink.co.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/media/usb/dvb-usb-v2/lmedm04.c |   26 ++++++++++++++++++--------
+ 1 file changed, 18 insertions(+), 8 deletions(-)
+
+--- a/drivers/media/usb/dvb-usb-v2/lmedm04.c
++++ b/drivers/media/usb/dvb-usb-v2/lmedm04.c
+@@ -503,18 +503,23 @@ static int lme2510_pid_filter(struct dvb
+ static int lme2510_return_status(struct dvb_usb_device *d)
+ {
+-      int ret = 0;
++      int ret;
+       u8 *data;
+-      data = kzalloc(10, GFP_KERNEL);
++      data = kzalloc(6, GFP_KERNEL);
+       if (!data)
+               return -ENOMEM;
+-      ret |= usb_control_msg(d->udev, usb_rcvctrlpipe(d->udev, 0),
+-                      0x06, 0x80, 0x0302, 0x00, data, 0x0006, 200);
+-      info("Firmware Status: %x (%x)", ret , data[2]);
++      ret = usb_control_msg(d->udev, usb_rcvctrlpipe(d->udev, 0),
++                            0x06, 0x80, 0x0302, 0x00,
++                            data, 0x6, 200);
++      if (ret != 6)
++              ret = -EINVAL;
++      else
++              ret = data[2];
++
++      info("Firmware Status: %6ph", data);
+-      ret = (ret < 0) ? -ENODEV : data[2];
+       kfree(data);
+       return ret;
+ }
+@@ -1199,6 +1204,7 @@ static int lme2510_get_adapter_count(str
+ static int lme2510_identify_state(struct dvb_usb_device *d, const char **name)
+ {
+       struct lme2510_state *st = d->priv;
++      int status;
+       usb_reset_configuration(d->udev);
+@@ -1207,12 +1213,16 @@ static int lme2510_identify_state(struct
+       st->dvb_usb_lme2510_firmware = dvb_usb_lme2510_firmware;
+-      if (lme2510_return_status(d) == 0x44) {
++      status = lme2510_return_status(d);
++      if (status == 0x44) {
+               *name = lme_firmware_switch(d, 0);
+               return COLD;
+       }
+-      return 0;
++      if (status != 0x47)
++              return -EINVAL;
++
++      return WARM;
+ }
+ static int lme2510_get_stream_config(struct dvb_frontend *fe, u8 *ts_type,
diff --git a/queue-4.4/media-dvb-usb-v2-lmedm04-move-ts2020-attach-to-dm04_lme2510_tuner.patch b/queue-4.4/media-dvb-usb-v2-lmedm04-move-ts2020-attach-to-dm04_lme2510_tuner.patch
new file mode 100644 (file)
index 0000000..d77b6a0
--- /dev/null
@@ -0,0 +1,72 @@
+From 7bf7a7116ed313c601307f7e585419369926ab05 Mon Sep 17 00:00:00 2001
+From: Malcolm Priestley <tvboxspy@gmail.com>
+Date: Tue, 26 Sep 2017 17:10:21 -0400
+Subject: media: dvb-usb-v2: lmedm04: move ts2020 attach to dm04_lme2510_tuner
+
+From: Malcolm Priestley <tvboxspy@gmail.com>
+
+commit 7bf7a7116ed313c601307f7e585419369926ab05 upstream.
+
+When the tuner was split from m88rs2000 the attach function is in wrong
+place.
+
+Move to dm04_lme2510_tuner to trap errors on failure and removing
+a call to lme_coldreset.
+
+Prevents driver starting up without any tuner connected.
+
+Fixes to trap for ts2020 fail.
+LME2510(C): FE Found M88RS2000
+ts2020: probe of 0-0060 failed with error -11
+...
+LME2510(C): TUN Found RS2000 tuner
+kasan: CONFIG_KASAN_INLINE enabled
+kasan: GPF could be caused by NULL-ptr deref or user memory access
+general protection fault: 0000 [#1] PREEMPT SMP KASAN
+
+Reported-by: Andrey Konovalov <andreyknvl@google.com>
+Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
+Tested-by: Andrey Konovalov <andreyknvl@google.com>
+Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
+Cc: Ben Hutchings <ben.hutchings@codethink.co.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/media/usb/dvb-usb-v2/lmedm04.c |   13 ++++++-------
+ 1 file changed, 6 insertions(+), 7 deletions(-)
+
+--- a/drivers/media/usb/dvb-usb-v2/lmedm04.c
++++ b/drivers/media/usb/dvb-usb-v2/lmedm04.c
+@@ -1083,8 +1083,6 @@ static int dm04_lme2510_frontend_attach(
+               if (adap->fe[0]) {
+                       info("FE Found M88RS2000");
+-                      dvb_attach(ts2020_attach, adap->fe[0], &ts2020_config,
+-                                      &d->i2c_adap);
+                       st->i2c_tuner_gate_w = 5;
+                       st->i2c_tuner_gate_r = 5;
+                       st->i2c_tuner_addr = 0x60;
+@@ -1150,17 +1148,18 @@ static int dm04_lme2510_tuner(struct dvb
+                       ret = st->tuner_config;
+               break;
+       case TUNER_RS2000:
+-              ret = st->tuner_config;
++              if (dvb_attach(ts2020_attach, adap->fe[0],
++                             &ts2020_config, &d->i2c_adap))
++                      ret = st->tuner_config;
+               break;
+       default:
+               break;
+       }
+-      if (ret)
++      if (ret) {
+               info("TUN Found %s tuner", tun_msg[ret]);
+-      else {
+-              info("TUN No tuner found --- resetting device");
+-              lme_coldreset(d);
++      } else {
++              info("TUN No tuner found");
+               return -ENODEV;
+       }
diff --git a/queue-4.4/netfilter-nf_queue-make-the-queue_handler-pernet.patch b/queue-4.4/netfilter-nf_queue-make-the-queue_handler-pernet.patch
new file mode 100644 (file)
index 0000000..184fccd
--- /dev/null
@@ -0,0 +1,196 @@
+From dc3ee32e96d74dd6c80eed63af5065cb75899299 Mon Sep 17 00:00:00 2001
+From: "Eric W. Biederman" <ebiederm@xmission.com>
+Date: Fri, 13 May 2016 21:18:52 -0500
+Subject: netfilter: nf_queue: Make the queue_handler pernet
+
+From: Eric W. Biederman <ebiederm@xmission.com>
+
+commit dc3ee32e96d74dd6c80eed63af5065cb75899299 upstream.
+
+Florian Weber reported:
+> Under full load (unshare() in loop -> OOM conditions) we can
+> get kernel panic:
+>
+> BUG: unable to handle kernel NULL pointer dereference at 0000000000000008
+> IP: [<ffffffff81476c85>] nfqnl_nf_hook_drop+0x35/0x70
+> [..]
+> task: ffff88012dfa3840 ti: ffff88012dffc000 task.ti: ffff88012dffc000
+> RIP: 0010:[<ffffffff81476c85>]  [<ffffffff81476c85>] nfqnl_nf_hook_drop+0x35/0x70
+> RSP: 0000:ffff88012dfffd80  EFLAGS: 00010206
+> RAX: 0000000000000008 RBX: ffffffff81add0c0 RCX: ffff88013fd80000
+> [..]
+> Call Trace:
+>  [<ffffffff81474d98>] nf_queue_nf_hook_drop+0x18/0x20
+>  [<ffffffff814738eb>] nf_unregister_net_hook+0xdb/0x150
+>  [<ffffffff8147398f>] netfilter_net_exit+0x2f/0x60
+>  [<ffffffff8141b088>] ops_exit_list.isra.4+0x38/0x60
+>  [<ffffffff8141b652>] setup_net+0xc2/0x120
+>  [<ffffffff8141bd09>] copy_net_ns+0x79/0x120
+>  [<ffffffff8106965b>] create_new_namespaces+0x11b/0x1e0
+>  [<ffffffff810698a7>] unshare_nsproxy_namespaces+0x57/0xa0
+>  [<ffffffff8104baa2>] SyS_unshare+0x1b2/0x340
+>  [<ffffffff81608276>] entry_SYSCALL_64_fastpath+0x1e/0xa8
+> Code: 65 00 48 89 e5 41 56 41 55 41 54 53 83 e8 01 48 8b 97 70 12 00 00 48 98 49 89 f4 4c 8b 74 c2 18 4d 8d 6e 08 49 81 c6 88 00 00 00 <49> 8b 5d 00 48 85 db 74 1a 48 89 df 4c 89 e2 48 c7 c6 90 68 47
+>
+
+The simple fix for this requires a new pernet variable for struct
+nf_queue that indicates when it is safe to use the dynamically
+allocated nf_queue state.
+
+As we need a variable anyway make nf_register_queue_handler and
+nf_unregister_queue_handler pernet.  This allows the existing logic of
+when it is safe to use the state from the nfnetlink_queue module to be
+reused with no changes except for making it per net.
+
+The syncrhonize_rcu from nf_unregister_queue_handler is moved to a new
+function nfnl_queue_net_exit_batch so that the worst case of having a
+syncrhonize_rcu in the pernet exit path is not experienced in batch
+mode.
+
+Reported-by: Florian Westphal <fw@strlen.de>
+Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
+Acked-by: Florian Westphal <fw@strlen.de>
+Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
+Cc: Eric Biggers <ebiggers3@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ include/net/netfilter/nf_queue.h |    4 ++--
+ include/net/netns/netfilter.h    |    2 ++
+ net/netfilter/nf_queue.c         |   17 ++++++++---------
+ net/netfilter/nfnetlink_queue.c  |   18 ++++++++++++------
+ 4 files changed, 24 insertions(+), 17 deletions(-)
+
+--- a/include/net/netfilter/nf_queue.h
++++ b/include/net/netfilter/nf_queue.h
+@@ -28,8 +28,8 @@ struct nf_queue_handler {
+                                               struct nf_hook_ops *ops);
+ };
+-void nf_register_queue_handler(const struct nf_queue_handler *qh);
+-void nf_unregister_queue_handler(void);
++void nf_register_queue_handler(struct net *net, const struct nf_queue_handler *qh);
++void nf_unregister_queue_handler(struct net *net);
+ void nf_reinject(struct nf_queue_entry *entry, unsigned int verdict);
+ void nf_queue_entry_get_refs(struct nf_queue_entry *entry);
+--- a/include/net/netns/netfilter.h
++++ b/include/net/netns/netfilter.h
+@@ -5,11 +5,13 @@
+ struct proc_dir_entry;
+ struct nf_logger;
++struct nf_queue_handler;
+ struct netns_nf {
+ #if defined CONFIG_PROC_FS
+       struct proc_dir_entry *proc_netfilter;
+ #endif
++      const struct nf_queue_handler __rcu *queue_handler;
+       const struct nf_logger __rcu *nf_loggers[NFPROTO_NUMPROTO];
+ #ifdef CONFIG_SYSCTL
+       struct ctl_table_header *nf_log_dir_header;
+--- a/net/netfilter/nf_queue.c
++++ b/net/netfilter/nf_queue.c
+@@ -26,23 +26,21 @@
+  * Once the queue is registered it must reinject all packets it
+  * receives, no matter what.
+  */
+-static const struct nf_queue_handler __rcu *queue_handler __read_mostly;
+ /* return EBUSY when somebody else is registered, return EEXIST if the
+  * same handler is registered, return 0 in case of success. */
+-void nf_register_queue_handler(const struct nf_queue_handler *qh)
++void nf_register_queue_handler(struct net *net, const struct nf_queue_handler *qh)
+ {
+       /* should never happen, we only have one queueing backend in kernel */
+-      WARN_ON(rcu_access_pointer(queue_handler));
+-      rcu_assign_pointer(queue_handler, qh);
++      WARN_ON(rcu_access_pointer(net->nf.queue_handler));
++      rcu_assign_pointer(net->nf.queue_handler, qh);
+ }
+ EXPORT_SYMBOL(nf_register_queue_handler);
+ /* The caller must flush their queue before this */
+-void nf_unregister_queue_handler(void)
++void nf_unregister_queue_handler(struct net *net)
+ {
+-      RCU_INIT_POINTER(queue_handler, NULL);
+-      synchronize_rcu();
++      RCU_INIT_POINTER(net->nf.queue_handler, NULL);
+ }
+ EXPORT_SYMBOL(nf_unregister_queue_handler);
+@@ -103,7 +101,7 @@ void nf_queue_nf_hook_drop(struct net *n
+       const struct nf_queue_handler *qh;
+       rcu_read_lock();
+-      qh = rcu_dereference(queue_handler);
++      qh = rcu_dereference(net->nf.queue_handler);
+       if (qh)
+               qh->nf_hook_drop(net, ops);
+       rcu_read_unlock();
+@@ -122,9 +120,10 @@ int nf_queue(struct sk_buff *skb,
+       struct nf_queue_entry *entry = NULL;
+       const struct nf_afinfo *afinfo;
+       const struct nf_queue_handler *qh;
++      struct net *net = state->net;
+       /* QUEUE == DROP if no one is waiting, to be safe. */
+-      qh = rcu_dereference(queue_handler);
++      qh = rcu_dereference(net->nf.queue_handler);
+       if (!qh) {
+               status = -ESRCH;
+               goto err;
+--- a/net/netfilter/nfnetlink_queue.c
++++ b/net/netfilter/nfnetlink_queue.c
+@@ -1382,21 +1382,29 @@ static int __net_init nfnl_queue_net_ini
+                        net->nf.proc_netfilter, &nfqnl_file_ops))
+               return -ENOMEM;
+ #endif
++      nf_register_queue_handler(net, &nfqh);
+       return 0;
+ }
+ static void __net_exit nfnl_queue_net_exit(struct net *net)
+ {
++      nf_unregister_queue_handler(net);
+ #ifdef CONFIG_PROC_FS
+       remove_proc_entry("nfnetlink_queue", net->nf.proc_netfilter);
+ #endif
+ }
++static void nfnl_queue_net_exit_batch(struct list_head *net_exit_list)
++{
++      synchronize_rcu();
++}
++
+ static struct pernet_operations nfnl_queue_net_ops = {
+-      .init   = nfnl_queue_net_init,
+-      .exit   = nfnl_queue_net_exit,
+-      .id     = &nfnl_queue_net_id,
+-      .size   = sizeof(struct nfnl_queue_net),
++      .init           = nfnl_queue_net_init,
++      .exit           = nfnl_queue_net_exit,
++      .exit_batch     = nfnl_queue_net_exit_batch,
++      .id             = &nfnl_queue_net_id,
++      .size           = sizeof(struct nfnl_queue_net),
+ };
+ static int __init nfnetlink_queue_init(void)
+@@ -1417,7 +1425,6 @@ static int __init nfnetlink_queue_init(v
+       }
+       register_netdevice_notifier(&nfqnl_dev_notifier);
+-      nf_register_queue_handler(&nfqh);
+       return status;
+ cleanup_netlink_notifier:
+@@ -1429,7 +1436,6 @@ out:
+ static void __exit nfnetlink_queue_fini(void)
+ {
+-      nf_unregister_queue_handler();
+       unregister_netdevice_notifier(&nfqnl_dev_notifier);
+       nfnetlink_subsys_unregister(&nfqnl_subsys);
+       netlink_unregister_notifier(&nfqnl_rtnl_notifier);
diff --git a/queue-4.4/posix-timer-properly-check-sigevent-sigev_notify.patch b/queue-4.4/posix-timer-properly-check-sigevent-sigev_notify.patch
new file mode 100644 (file)
index 0000000..c5000c5
--- /dev/null
@@ -0,0 +1,110 @@
+From cef31d9af908243421258f1df35a4a644604efbe Mon Sep 17 00:00:00 2001
+From: Thomas Gleixner <tglx@linutronix.de>
+Date: Fri, 15 Dec 2017 10:32:03 +0100
+Subject: posix-timer: Properly check sigevent->sigev_notify
+
+From: Thomas Gleixner <tglx@linutronix.de>
+
+commit cef31d9af908243421258f1df35a4a644604efbe upstream.
+
+timer_create() specifies via sigevent->sigev_notify the signal delivery for
+the new timer. The valid modes are SIGEV_NONE, SIGEV_SIGNAL, SIGEV_THREAD
+and (SIGEV_SIGNAL | SIGEV_THREAD_ID).
+
+The sanity check in good_sigevent() is only checking the valid combination
+for the SIGEV_THREAD_ID bit, i.e. SIGEV_SIGNAL, but if SIGEV_THREAD_ID is
+not set it accepts any random value.
+
+This has no real effects on the posix timer and signal delivery code, but
+it affects show_timer() which handles the output of /proc/$PID/timers. That
+function uses a string array to pretty print sigev_notify. The access to
+that array has no bound checks, so random sigev_notify cause access beyond
+the array bounds.
+
+Add proper checks for the valid notify modes and remove the SIGEV_THREAD_ID
+masking from various code pathes as SIGEV_NONE can never be set in
+combination with SIGEV_THREAD_ID.
+
+Reported-by: Eric Biggers <ebiggers3@gmail.com>
+Reported-by: Dmitry Vyukov <dvyukov@google.com>
+Reported-by: Alexey Dobriyan <adobriyan@gmail.com>
+Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
+Cc: John Stultz <john.stultz@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ kernel/time/posix-timers.c |   34 +++++++++++++++++++---------------
+ 1 file changed, 19 insertions(+), 15 deletions(-)
+
+--- a/kernel/time/posix-timers.c
++++ b/kernel/time/posix-timers.c
+@@ -507,17 +507,22 @@ static struct pid *good_sigevent(sigeven
+ {
+       struct task_struct *rtn = current->group_leader;
+-      if ((event->sigev_notify & SIGEV_THREAD_ID ) &&
+-              (!(rtn = find_task_by_vpid(event->sigev_notify_thread_id)) ||
+-               !same_thread_group(rtn, current) ||
+-               (event->sigev_notify & ~SIGEV_THREAD_ID) != SIGEV_SIGNAL))
++      switch (event->sigev_notify) {
++      case SIGEV_SIGNAL | SIGEV_THREAD_ID:
++              rtn = find_task_by_vpid(event->sigev_notify_thread_id);
++              if (!rtn || !same_thread_group(rtn, current))
++                      return NULL;
++              /* FALLTHRU */
++      case SIGEV_SIGNAL:
++      case SIGEV_THREAD:
++              if (event->sigev_signo <= 0 || event->sigev_signo > SIGRTMAX)
++                      return NULL;
++              /* FALLTHRU */
++      case SIGEV_NONE:
++              return task_pid(rtn);
++      default:
+               return NULL;
+-
+-      if (((event->sigev_notify & ~SIGEV_THREAD_ID) != SIGEV_NONE) &&
+-          ((event->sigev_signo <= 0) || (event->sigev_signo > SIGRTMAX)))
+-              return NULL;
+-
+-      return task_pid(rtn);
++      }
+ }
+ void posix_timers_register_clock(const clockid_t clock_id,
+@@ -745,8 +750,7 @@ common_timer_get(struct k_itimer *timr,
+       /* interval timer ? */
+       if (iv.tv64)
+               cur_setting->it_interval = ktime_to_timespec(iv);
+-      else if (!hrtimer_active(timer) &&
+-               (timr->it_sigev_notify & ~SIGEV_THREAD_ID) != SIGEV_NONE)
++      else if (!hrtimer_active(timer) && timr->it_sigev_notify != SIGEV_NONE)
+               return;
+       now = timer->base->get_time();
+@@ -757,7 +761,7 @@ common_timer_get(struct k_itimer *timr,
+        * expiry is > now.
+        */
+       if (iv.tv64 && (timr->it_requeue_pending & REQUEUE_PENDING ||
+-          (timr->it_sigev_notify & ~SIGEV_THREAD_ID) == SIGEV_NONE))
++                      timr->it_sigev_notify == SIGEV_NONE))
+               timr->it_overrun += (unsigned int) hrtimer_forward(timer, now, iv);
+       remaining = __hrtimer_expires_remaining_adjusted(timer, now);
+@@ -767,7 +771,7 @@ common_timer_get(struct k_itimer *timr,
+                * A single shot SIGEV_NONE timer must return 0, when
+                * it is expired !
+                */
+-              if ((timr->it_sigev_notify & ~SIGEV_THREAD_ID) != SIGEV_NONE)
++              if (timr->it_sigev_notify != SIGEV_NONE)
+                       cur_setting->it_value.tv_nsec = 1;
+       } else
+               cur_setting->it_value = ktime_to_timespec(remaining);
+@@ -865,7 +869,7 @@ common_timer_set(struct k_itimer *timr,
+       timr->it.real.interval = timespec_to_ktime(new_setting->it_interval);
+       /* SIGEV_NONE timers are not queued ! See common_timer_get */
+-      if (((timr->it_sigev_notify & ~SIGEV_THREAD_ID) == SIGEV_NONE)) {
++      if (timr->it_sigev_notify == SIGEV_NONE) {
+               /* Setup correct expiry time for relative timers */
+               if (mode == HRTIMER_MODE_REL) {
+                       hrtimer_add_expires(timer, timer->base->get_time());
diff --git a/queue-4.4/powerpc-pseries-include-linux-types.h-in-asm-hvcall.h.patch b/queue-4.4/powerpc-pseries-include-linux-types.h-in-asm-hvcall.h.patch
new file mode 100644 (file)
index 0000000..5a9db69
--- /dev/null
@@ -0,0 +1,33 @@
+From 1b689a95ce7427075f9ac9fb4aea1af530742b7f Mon Sep 17 00:00:00 2001
+From: Michal Suchanek <msuchanek@suse.de>
+Date: Mon, 15 Jan 2018 14:30:03 +0100
+Subject: powerpc/pseries: include linux/types.h in asm/hvcall.h
+
+From: Michal Suchanek <msuchanek@suse.de>
+
+commit 1b689a95ce7427075f9ac9fb4aea1af530742b7f upstream.
+
+Commit 6e032b350cd1 ("powerpc/powernv: Check device-tree for RFI flush
+settings") uses u64 in asm/hvcall.h without including linux/types.h
+
+This breaks hvcall.h users that do not include the header themselves.
+
+Fixes: 6e032b350cd1 ("powerpc/powernv: Check device-tree for RFI flush settings")
+Signed-off-by: Michal Suchanek <msuchanek@suse.de>
+Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/powerpc/include/asm/hvcall.h |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/arch/powerpc/include/asm/hvcall.h
++++ b/arch/powerpc/include/asm/hvcall.h
+@@ -298,6 +298,7 @@
+ #define H_CPU_BEHAV_BNDS_CHK_SPEC_BAR (1ull << 61) // IBM bit 2
+ #ifndef __ASSEMBLY__
++#include <linux/types.h>
+ /**
+  * plpar_hcall_norets: - Make a pseries hypervisor call with no return arguments
diff --git a/queue-4.4/sched-rt-up-the-root-domain-ref-count-when-passing-it-around-via-ipis.patch b/queue-4.4/sched-rt-up-the-root-domain-ref-count-when-passing-it-around-via-ipis.patch
new file mode 100644 (file)
index 0000000..b16aeaa
--- /dev/null
@@ -0,0 +1,101 @@
+From 364f56653708ba8bcdefd4f0da2a42904baa8eeb Mon Sep 17 00:00:00 2001
+From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
+Date: Tue, 23 Jan 2018 20:45:38 -0500
+Subject: sched/rt: Up the root domain ref count when passing it around via IPIs
+
+From: Steven Rostedt (VMware) <rostedt@goodmis.org>
+
+commit 364f56653708ba8bcdefd4f0da2a42904baa8eeb upstream.
+
+When issuing an IPI RT push, where an IPI is sent to each CPU that has more
+than one RT task scheduled on it, it references the root domain's rto_mask,
+that contains all the CPUs within the root domain that has more than one RT
+task in the runable state. The problem is, after the IPIs are initiated, the
+rq->lock is released. This means that the root domain that is associated to
+the run queue could be freed while the IPIs are going around.
+
+Add a sched_get_rd() and a sched_put_rd() that will increment and decrement
+the root domain's ref count respectively. This way when initiating the IPIs,
+the scheduler will up the root domain's ref count before releasing the
+rq->lock, ensuring that the root domain does not go away until the IPI round
+is complete.
+
+Reported-by: Pavan Kondeti <pkondeti@codeaurora.org>
+Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
+Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
+Cc: Andrew Morton <akpm@linux-foundation.org>
+Cc: Linus Torvalds <torvalds@linux-foundation.org>
+Cc: Mike Galbraith <efault@gmx.de>
+Cc: Peter Zijlstra <peterz@infradead.org>
+Cc: Thomas Gleixner <tglx@linutronix.de>
+Fixes: 4bdced5c9a292 ("sched/rt: Simplify the IPI based RT balancing logic")
+Link: http://lkml.kernel.org/r/CAEU1=PkiHO35Dzna8EQqNSKW1fr1y1zRQ5y66X117MG06sQtNA@mail.gmail.com
+Signed-off-by: Ingo Molnar <mingo@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ kernel/sched/core.c  |   13 +++++++++++++
+ kernel/sched/rt.c    |    9 +++++++--
+ kernel/sched/sched.h |    2 ++
+ 3 files changed, 22 insertions(+), 2 deletions(-)
+
+--- a/kernel/sched/core.c
++++ b/kernel/sched/core.c
+@@ -5896,6 +5896,19 @@ static void rq_attach_root(struct rq *rq
+               call_rcu_sched(&old_rd->rcu, free_rootdomain);
+ }
++void sched_get_rd(struct root_domain *rd)
++{
++      atomic_inc(&rd->refcount);
++}
++
++void sched_put_rd(struct root_domain *rd)
++{
++      if (!atomic_dec_and_test(&rd->refcount))
++              return;
++
++      call_rcu_sched(&rd->rcu, free_rootdomain);
++}
++
+ static int init_rootdomain(struct root_domain *rd)
+ {
+       memset(rd, 0, sizeof(*rd));
+--- a/kernel/sched/rt.c
++++ b/kernel/sched/rt.c
+@@ -1916,8 +1916,11 @@ static void tell_cpu_to_push(struct rq *
+       rto_start_unlock(&rq->rd->rto_loop_start);
+-      if (cpu >= 0)
++      if (cpu >= 0) {
++              /* Make sure the rd does not get freed while pushing */
++              sched_get_rd(rq->rd);
+               irq_work_queue_on(&rq->rd->rto_push_work, cpu);
++      }
+ }
+ /* Called from hardirq context */
+@@ -1947,8 +1950,10 @@ void rto_push_irq_work_func(struct irq_w
+       raw_spin_unlock(&rd->rto_lock);
+-      if (cpu < 0)
++      if (cpu < 0) {
++              sched_put_rd(rd);
+               return;
++      }
+       /* Try the next RT overloaded CPU */
+       irq_work_queue_on(&rd->rto_push_work, cpu);
+--- a/kernel/sched/sched.h
++++ b/kernel/sched/sched.h
+@@ -553,6 +553,8 @@ struct root_domain {
+ };
+ extern struct root_domain def_root_domain;
++extern void sched_get_rd(struct root_domain *rd);
++extern void sched_put_rd(struct root_domain *rd);
+ #ifdef HAVE_RT_PUSH_IPI
+ extern void rto_push_irq_work_func(struct irq_work *work);
diff --git a/queue-4.4/sched-rt-use-container_of-to-get-root-domain-in-rto_push_irq_work_func.patch b/queue-4.4/sched-rt-use-container_of-to-get-root-domain-in-rto_push_irq_work_func.patch
new file mode 100644 (file)
index 0000000..447599f
--- /dev/null
@@ -0,0 +1,94 @@
+From ad0f1d9d65938aec72a698116cd73a980916895e Mon Sep 17 00:00:00 2001
+From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
+Date: Tue, 23 Jan 2018 20:45:37 -0500
+Subject: sched/rt: Use container_of() to get root domain in rto_push_irq_work_func()
+
+From: Steven Rostedt (VMware) <rostedt@goodmis.org>
+
+commit ad0f1d9d65938aec72a698116cd73a980916895e upstream.
+
+When the rto_push_irq_work_func() is called, it looks at the RT overloaded
+bitmask in the root domain via the runqueue (rq->rd). The problem is that
+during CPU up and down, nothing here stops rq->rd from changing between
+taking the rq->rd->rto_lock and releasing it. That means the lock that is
+released is not the same lock that was taken.
+
+Instead of using this_rq()->rd to get the root domain, as the irq work is
+part of the root domain, we can simply get the root domain from the irq work
+that is passed to the routine:
+
+ container_of(work, struct root_domain, rto_push_work)
+
+This keeps the root domain consistent.
+
+Reported-by: Pavan Kondeti <pkondeti@codeaurora.org>
+Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
+Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
+Cc: Andrew Morton <akpm@linux-foundation.org>
+Cc: Linus Torvalds <torvalds@linux-foundation.org>
+Cc: Mike Galbraith <efault@gmx.de>
+Cc: Peter Zijlstra <peterz@infradead.org>
+Cc: Thomas Gleixner <tglx@linutronix.de>
+Fixes: 4bdced5c9a292 ("sched/rt: Simplify the IPI based RT balancing logic")
+Link: http://lkml.kernel.org/r/CAEU1=PkiHO35Dzna8EQqNSKW1fr1y1zRQ5y66X117MG06sQtNA@mail.gmail.com
+Signed-off-by: Ingo Molnar <mingo@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ kernel/sched/rt.c |   15 ++++++++-------
+ 1 file changed, 8 insertions(+), 7 deletions(-)
+
+--- a/kernel/sched/rt.c
++++ b/kernel/sched/rt.c
+@@ -1833,9 +1833,8 @@ static void push_rt_tasks(struct rq *rq)
+  * the rt_loop_next will cause the iterator to perform another scan.
+  *
+  */
+-static int rto_next_cpu(struct rq *rq)
++static int rto_next_cpu(struct root_domain *rd)
+ {
+-      struct root_domain *rd = rq->rd;
+       int next;
+       int cpu;
+@@ -1911,7 +1910,7 @@ static void tell_cpu_to_push(struct rq *
+        * Otherwise it is finishing up and an ipi needs to be sent.
+        */
+       if (rq->rd->rto_cpu < 0)
+-              cpu = rto_next_cpu(rq);
++              cpu = rto_next_cpu(rq->rd);
+       raw_spin_unlock(&rq->rd->rto_lock);
+@@ -1924,6 +1923,8 @@ static void tell_cpu_to_push(struct rq *
+ /* Called from hardirq context */
+ void rto_push_irq_work_func(struct irq_work *work)
+ {
++      struct root_domain *rd =
++              container_of(work, struct root_domain, rto_push_work);
+       struct rq *rq;
+       int cpu;
+@@ -1939,18 +1940,18 @@ void rto_push_irq_work_func(struct irq_w
+               raw_spin_unlock(&rq->lock);
+       }
+-      raw_spin_lock(&rq->rd->rto_lock);
++      raw_spin_lock(&rd->rto_lock);
+       /* Pass the IPI to the next rt overloaded queue */
+-      cpu = rto_next_cpu(rq);
++      cpu = rto_next_cpu(rd);
+-      raw_spin_unlock(&rq->rd->rto_lock);
++      raw_spin_unlock(&rd->rto_lock);
+       if (cpu < 0)
+               return;
+       /* Try the next RT overloaded CPU */
+-      irq_work_queue_on(&rq->rd->rto_push_work, cpu);
++      irq_work_queue_on(&rd->rto_push_work, cpu);
+ }
+ #endif /* HAVE_RT_PUSH_IPI */
index 9bda97cc5c363678f1a7e56e05518b42c4381429..5a0fef8184e8c11688e17da82d7768bd44291ed2 100644 (file)
@@ -36,3 +36,18 @@ don-t-put-symlink-bodies-in-pagecache-into-highmem.patch
 crypto-tcrypt-fix-s-g-table-for-test_aead_speed.patch
 x86-microcode-amd-do-not-load-when-running-on-a-hypervisor.patch
 x86-microcode-do-the-family-check-first.patch
+powerpc-pseries-include-linux-types.h-in-asm-hvcall.h.patch
+cifs-fix-missing-put_xid-in-cifs_file_strict_mmap.patch
+cifs-fix-autonegotiate-security-settings-mismatch.patch
+cifs-zero-sensitive-data-when-freeing.patch
+dmaengine-dmatest-fix-container_of-member-in-dmatest_callback.patch
+x86-kaiser-fix-build-error-with-kasan-function_graph_tracer.patch
+kaiser-fix-compile-error-without-vsyscall.patch
+netfilter-nf_queue-make-the-queue_handler-pernet.patch
+posix-timer-properly-check-sigevent-sigev_notify.patch
+usb-gadget-uvc-missing-files-for-configfs-interface.patch
+sched-rt-use-container_of-to-get-root-domain-in-rto_push_irq_work_func.patch
+sched-rt-up-the-root-domain-ref-count-when-passing-it-around-via-ipis.patch
+dccp-cve-2017-8824-use-after-free-in-dccp-code.patch
+media-dvb-usb-v2-lmedm04-improve-logic-checking-of-warm-start.patch
+media-dvb-usb-v2-lmedm04-move-ts2020-attach-to-dm04_lme2510_tuner.patch
diff --git a/queue-4.4/usb-gadget-uvc-missing-files-for-configfs-interface.patch b/queue-4.4/usb-gadget-uvc-missing-files-for-configfs-interface.patch
new file mode 100644 (file)
index 0000000..0e8fd80
--- /dev/null
@@ -0,0 +1,60 @@
+From c8cd751060b149997b9de53a494fb1490ded72c5 Mon Sep 17 00:00:00 2001
+From: Petr Cvek <petr.cvek@tul.cz>
+Date: Tue, 7 Mar 2017 00:57:20 +0100
+Subject: usb: gadget: uvc: Missing files for configfs interface
+
+From: Petr Cvek <petr.cvek@tul.cz>
+
+commit c8cd751060b149997b9de53a494fb1490ded72c5 upstream.
+
+Commit 76e0da34c7ce ("usb-gadget/uvc: use per-attribute show and store
+methods") caused a stringification of an undefined macro argument "aname",
+so three UVC parameters (streaming_interval, streaming_maxpacket and
+streaming_maxburst) were named "aname".
+
+Add the definition of "aname" to the main macro and name the filenames as
+originaly intended.
+
+Signed-off-by: Petr Cvek <petr.cvek@tul.cz>
+Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/usb/gadget/function/uvc_configfs.c |   16 ++++++++--------
+ 1 file changed, 8 insertions(+), 8 deletions(-)
+
+--- a/drivers/usb/gadget/function/uvc_configfs.c
++++ b/drivers/usb/gadget/function/uvc_configfs.c
+@@ -2202,7 +2202,7 @@ static struct configfs_item_operations u
+       .release                = uvc_attr_release,
+ };
+-#define UVCG_OPTS_ATTR(cname, conv, str2u, uxx, vnoc, limit)          \
++#define UVCG_OPTS_ATTR(cname, aname, conv, str2u, uxx, vnoc, limit)   \
+ static ssize_t f_uvc_opts_##cname##_show(                             \
+       struct config_item *item, char *page)                           \
+ {                                                                     \
+@@ -2245,16 +2245,16 @@ end:                                                                   \
+       return ret;                                                     \
+ }                                                                     \
+                                                                       \
+-UVC_ATTR(f_uvc_opts_, cname, aname)
++UVC_ATTR(f_uvc_opts_, cname, cname)
+ #define identity_conv(x) (x)
+-UVCG_OPTS_ATTR(streaming_interval, identity_conv, kstrtou8, u8, identity_conv,
+-             16);
+-UVCG_OPTS_ATTR(streaming_maxpacket, le16_to_cpu, kstrtou16, u16, le16_to_cpu,
+-             3072);
+-UVCG_OPTS_ATTR(streaming_maxburst, identity_conv, kstrtou8, u8, identity_conv,
+-             15);
++UVCG_OPTS_ATTR(streaming_interval, streaming_interval, identity_conv,
++             kstrtou8, u8, identity_conv, 16);
++UVCG_OPTS_ATTR(streaming_maxpacket, streaming_maxpacket, le16_to_cpu,
++             kstrtou16, u16, le16_to_cpu, 3072);
++UVCG_OPTS_ATTR(streaming_maxburst, streaming_maxburst, identity_conv,
++             kstrtou8, u8, identity_conv, 15);
+ #undef identity_conv
diff --git a/queue-4.4/x86-kaiser-fix-build-error-with-kasan-function_graph_tracer.patch b/queue-4.4/x86-kaiser-fix-build-error-with-kasan-function_graph_tracer.patch
new file mode 100644 (file)
index 0000000..bf0470d
--- /dev/null
@@ -0,0 +1,42 @@
+From ebiggers@google.com  Tue Feb 13 16:43:57 2018
+From: Eric Biggers <ebiggers@google.com>
+Date: Fri,  9 Feb 2018 15:21:31 -0800
+Subject: x86/kaiser: fix build error with KASAN && !FUNCTION_GRAPH_TRACER
+To: stable@vger.kernel.org, Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Cc: Alexander Potapenko <glider@google.com>, Dave Hansen <dave.hansen@linux.intel.com>, Hugh Dickins <hughd@google.com>, x86@kernel.org, Eric Biggers <ebiggers@google.com>
+Message-ID: <20180209232131.60555-1-ebiggers@google.com>
+
+From: Eric Biggers <ebiggers@google.com>
+
+This is a build fix for the 4.4 PTI backport.  4.4 kernels do not have
+commit be7635e7287e ("arch, ftrace: for KASAN put hard/soft IRQ entries
+into separate sections") which went into 4.6.  Consequently, the
+irqentry sections are only created when CONFIG_FUNCTION_GRAPH_TRACER is
+enabled, not also when CONFIG_KASAN is enabled.  Therefore, fix the
+condition for trying to add a user mapping for this section.
+
+This fixes the following build error:
+
+    arch/x86/mm/kaiser.c: In function ‘kaiser_init’:
+    arch/x86/mm/kaiser.c:367:33: error: ‘__irqentry_text_start’ undeclared (first use in this function)
+      kaiser_add_user_map_ptrs_early(__irqentry_text_start,
+    [...]
+
+Signed-off-by: Eric Biggers <ebiggers@google.com>
+Acked-by: Hugh Dickins <hughd@google.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/x86/mm/kaiser.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/arch/x86/mm/kaiser.c
++++ b/arch/x86/mm/kaiser.c
+@@ -363,7 +363,7 @@ void __init kaiser_init(void)
+       kaiser_add_user_map_ptrs_early(__entry_text_start, __entry_text_end,
+                                      __PAGE_KERNEL_RX);
+-#if defined(CONFIG_FUNCTION_GRAPH_TRACER) || defined(CONFIG_KASAN)
++#ifdef CONFIG_FUNCTION_GRAPH_TRACER
+       kaiser_add_user_map_ptrs_early(__irqentry_text_start,
+                                      __irqentry_text_end,
+                                      __PAGE_KERNEL_RX);