]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
fixes for 4.14
authorSasha Levin <sashal@kernel.org>
Thu, 6 Feb 2020 04:53:40 +0000 (23:53 -0500)
committerSasha Levin <sashal@kernel.org>
Thu, 6 Feb 2020 04:53:40 +0000 (23:53 -0500)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-4.14/iwlwifi-mvm-fix-nvm-check-for-3168-devices.patch [new file with mode: 0644]
queue-4.14/kernel-module-fix-memleak-in-module_add_modinfo_attr.patch [new file with mode: 0644]
queue-4.14/media-iguanair-fix-endpoint-sanity-check.patch [new file with mode: 0644]
queue-4.14/series [new file with mode: 0644]
queue-4.14/sparc32-fix-struct-ipc64_perm-type-definition.patch [new file with mode: 0644]
queue-4.14/x86-cpu-update-cached-hle-state-on-write-to-tsx_ctrl.patch [new file with mode: 0644]

diff --git a/queue-4.14/iwlwifi-mvm-fix-nvm-check-for-3168-devices.patch b/queue-4.14/iwlwifi-mvm-fix-nvm-check-for-3168-devices.patch
new file mode 100644 (file)
index 0000000..d3a617d
--- /dev/null
@@ -0,0 +1,39 @@
+From 511f4469d41035b50702d187f0167eb784abdf8a Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 25 Nov 2019 13:21:58 +0200
+Subject: iwlwifi: mvm: fix NVM check for 3168 devices
+
+From: Luca Coelho <luciano.coelho@intel.com>
+
+[ Upstream commit b3f20e098293892388d6a0491d6bbb2efb46fbff ]
+
+We had a check on !NVM_EXT and then a check for NVM_SDP in the else
+block of this if.  The else block, obviously, could only be reached if
+using NVM_EXT, so it would never be NVM_SDP.
+
+Fix that by checking whether the nvm_type is IWL_NVM instead of
+checking for !IWL_NVM_EXT to solve this issue.
+
+Reported-by: Stefan Sperling <stsp@stsp.name>
+Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/net/wireless/intel/iwlwifi/mvm/nvm.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c b/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c
+index ca2d66ce84247..8f3032b7174d3 100644
+--- a/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c
++++ b/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c
+@@ -298,7 +298,7 @@ iwl_parse_nvm_sections(struct iwl_mvm *mvm)
+       int regulatory_type;
+       /* Checking for required sections */
+-      if (mvm->trans->cfg->nvm_type != IWL_NVM_EXT) {
++      if (mvm->trans->cfg->nvm_type == IWL_NVM) {
+               if (!mvm->nvm_sections[NVM_SECTION_TYPE_SW].data ||
+                   !mvm->nvm_sections[mvm->cfg->nvm_hw_section_num].data) {
+                       IWL_ERR(mvm, "Can't parse empty OTP/NVM sections\n");
+-- 
+2.20.1
+
diff --git a/queue-4.14/kernel-module-fix-memleak-in-module_add_modinfo_attr.patch b/queue-4.14/kernel-module-fix-memleak-in-module_add_modinfo_attr.patch
new file mode 100644 (file)
index 0000000..06ee21e
--- /dev/null
@@ -0,0 +1,38 @@
+From 5135bf7d4633e41c4190dd5d74a6c923fe60dc8c Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sat, 28 Dec 2019 19:54:55 +0800
+Subject: kernel/module: Fix memleak in module_add_modinfo_attrs()
+
+From: YueHaibing <yuehaibing@huawei.com>
+
+[ Upstream commit f6d061d617124abbd55396a3bc37b9bf7d33233c ]
+
+In module_add_modinfo_attrs() if sysfs_create_file() fails
+on the first iteration of the loop (so i = 0), we forget to
+free the modinfo_attrs.
+
+Fixes: bc6f2a757d52 ("kernel/module: Fix mem leak in module_add_modinfo_attrs")
+Reviewed-by: Miroslav Benes <mbenes@suse.cz>
+Signed-off-by: YueHaibing <yuehaibing@huawei.com>
+Signed-off-by: Jessica Yu <jeyu@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ kernel/module.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/kernel/module.c b/kernel/module.c
+index feb1e0fbc3e85..2806c9b6577c1 100644
+--- a/kernel/module.c
++++ b/kernel/module.c
+@@ -1730,6 +1730,8 @@ static int module_add_modinfo_attrs(struct module *mod)
+ error_out:
+       if (i > 0)
+               module_remove_modinfo_attrs(mod, --i);
++      else
++              kfree(mod->modinfo_attrs);
+       return error;
+ }
+-- 
+2.20.1
+
diff --git a/queue-4.14/media-iguanair-fix-endpoint-sanity-check.patch b/queue-4.14/media-iguanair-fix-endpoint-sanity-check.patch
new file mode 100644 (file)
index 0000000..1cf344b
--- /dev/null
@@ -0,0 +1,44 @@
+From 0b041f30e0b9a0bf536cd3ebd32ee4b7f0f66315 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 3 Jan 2020 17:35:13 +0100
+Subject: media: iguanair: fix endpoint sanity check
+
+From: Johan Hovold <johan@kernel.org>
+
+[ Upstream commit 1b257870a78b0a9ce98fdfb052c58542022ffb5b ]
+
+Make sure to use the current alternate setting, which need not be the
+first one by index, when verifying the endpoint descriptors and
+initialising the URBs.
+
+Failing to do so could cause the driver to misbehave or trigger a WARN()
+in usb_submit_urb() that kernels with panic_on_warn set would choke on.
+
+Fixes: 26ff63137c45 ("[media] Add support for the IguanaWorks USB IR Transceiver")
+Fixes: ab1cbdf159be ("media: iguanair: add sanity checks")
+Cc: stable <stable@vger.kernel.org>     # 3.6
+Cc: Oliver Neukum <oneukum@suse.com>
+Signed-off-by: Johan Hovold <johan@kernel.org>
+Signed-off-by: Sean Young <sean@mess.org>
+Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/media/rc/iguanair.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/media/rc/iguanair.c b/drivers/media/rc/iguanair.c
+index 3c2e248ceca87..03dbbfba71fc6 100644
+--- a/drivers/media/rc/iguanair.c
++++ b/drivers/media/rc/iguanair.c
+@@ -427,7 +427,7 @@ static int iguanair_probe(struct usb_interface *intf,
+       int ret, pipein, pipeout;
+       struct usb_host_interface *idesc;
+-      idesc = intf->altsetting;
++      idesc = intf->cur_altsetting;
+       if (idesc->desc.bNumEndpoints < 2)
+               return -ENODEV;
+-- 
+2.20.1
+
diff --git a/queue-4.14/series b/queue-4.14/series
new file mode 100644 (file)
index 0000000..2de81b8
--- /dev/null
@@ -0,0 +1,5 @@
+kernel-module-fix-memleak-in-module_add_modinfo_attr.patch
+media-iguanair-fix-endpoint-sanity-check.patch
+x86-cpu-update-cached-hle-state-on-write-to-tsx_ctrl.patch
+iwlwifi-mvm-fix-nvm-check-for-3168-devices.patch
+sparc32-fix-struct-ipc64_perm-type-definition.patch
diff --git a/queue-4.14/sparc32-fix-struct-ipc64_perm-type-definition.patch b/queue-4.14/sparc32-fix-struct-ipc64_perm-type-definition.patch
new file mode 100644 (file)
index 0000000..c9ec80f
--- /dev/null
@@ -0,0 +1,74 @@
+From ee1953a6590f21980191b7b58622a84db1f2c510 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 14 Jan 2020 14:26:14 +0100
+Subject: sparc32: fix struct ipc64_perm type definition
+
+From: Arnd Bergmann <arnd@arndb.de>
+
+[ Upstream commit 34ca70ef7d3a9fa7e89151597db5e37ae1d429b4 ]
+
+As discussed in the strace issue tracker, it appears that the sparc32
+sysvipc support has been broken for the past 11 years. It was however
+working in compat mode, which is how it must have escaped most of the
+regular testing.
+
+The problem is that a cleanup patch inadvertently changed the uid/gid
+fields in struct ipc64_perm from 32-bit types to 16-bit types in uapi
+headers.
+
+Both glibc and uclibc-ng still use the original types, so they should
+work fine with compat mode, but not natively.  Change the definitions
+to use __kernel_uid32_t and __kernel_gid32_t again.
+
+Fixes: 83c86984bff2 ("sparc: unify ipcbuf.h")
+Link: https://github.com/strace/strace/issues/116
+Cc: <stable@vger.kernel.org> # v2.6.29
+Cc: Sam Ravnborg <sam@ravnborg.org>
+Cc: "Dmitry V . Levin" <ldv@altlinux.org>
+Cc: Rich Felker <dalias@libc.org>
+Cc: libc-alpha@sourceware.org
+Signed-off-by: Arnd Bergmann <arnd@arndb.de>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/sparc/include/uapi/asm/ipcbuf.h | 22 +++++++++++-----------
+ 1 file changed, 11 insertions(+), 11 deletions(-)
+
+diff --git a/arch/sparc/include/uapi/asm/ipcbuf.h b/arch/sparc/include/uapi/asm/ipcbuf.h
+index 9d0d125500e24..084b8949ddff6 100644
+--- a/arch/sparc/include/uapi/asm/ipcbuf.h
++++ b/arch/sparc/include/uapi/asm/ipcbuf.h
+@@ -15,19 +15,19 @@
+ struct ipc64_perm
+ {
+-      __kernel_key_t  key;
+-      __kernel_uid_t  uid;
+-      __kernel_gid_t  gid;
+-      __kernel_uid_t  cuid;
+-      __kernel_gid_t  cgid;
++      __kernel_key_t          key;
++      __kernel_uid32_t        uid;
++      __kernel_gid32_t        gid;
++      __kernel_uid32_t        cuid;
++      __kernel_gid32_t        cgid;
+ #ifndef __arch64__
+-      unsigned short  __pad0;
++      unsigned short          __pad0;
+ #endif
+-      __kernel_mode_t mode;
+-      unsigned short  __pad1;
+-      unsigned short  seq;
+-      unsigned long long __unused1;
+-      unsigned long long __unused2;
++      __kernel_mode_t         mode;
++      unsigned short          __pad1;
++      unsigned short          seq;
++      unsigned long long      __unused1;
++      unsigned long long      __unused2;
+ };
+ #endif /* __SPARC_IPCBUF_H */
+-- 
+2.20.1
+
diff --git a/queue-4.14/x86-cpu-update-cached-hle-state-on-write-to-tsx_ctrl.patch b/queue-4.14/x86-cpu-update-cached-hle-state-on-write-to-tsx_ctrl.patch
new file mode 100644 (file)
index 0000000..d7904d0
--- /dev/null
@@ -0,0 +1,67 @@
+From ef0fd73a93aa35c12a37950be75c449964d085f8 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 10 Jan 2020 14:50:54 -0800
+Subject: x86/cpu: Update cached HLE state on write to TSX_CTRL_CPUID_CLEAR
+
+From: Pawan Gupta <pawan.kumar.gupta@linux.intel.com>
+
+[ Upstream commit 5efc6fa9044c3356d6046c6e1da6d02572dbed6b ]
+
+/proc/cpuinfo currently reports Hardware Lock Elision (HLE) feature to
+be present on boot cpu even if it was disabled during the bootup. This
+is because cpuinfo_x86->x86_capability HLE bit is not updated after TSX
+state is changed via the new MSR IA32_TSX_CTRL.
+
+Update the cached HLE bit also since it is expected to change after an
+update to CPUID_CLEAR bit in MSR IA32_TSX_CTRL.
+
+Fixes: 95c5824f75f3 ("x86/cpu: Add a "tsx=" cmdline option with TSX disabled by default")
+Signed-off-by: Pawan Gupta <pawan.kumar.gupta@linux.intel.com>
+Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
+Tested-by: Neelima Krishnan <neelima.krishnan@intel.com>
+Reviewed-by: Dave Hansen <dave.hansen@linux.intel.com>
+Reviewed-by: Josh Poimboeuf <jpoimboe@redhat.com>
+Cc: stable@vger.kernel.org
+Link: https://lore.kernel.org/r/2529b99546294c893dfa1c89e2b3e46da3369a59.1578685425.git.pawan.kumar.gupta@linux.intel.com
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/x86/kernel/cpu/tsx.c | 13 +++++++------
+ 1 file changed, 7 insertions(+), 6 deletions(-)
+
+diff --git a/arch/x86/kernel/cpu/tsx.c b/arch/x86/kernel/cpu/tsx.c
+index 3e20d322bc98b..032509adf9de9 100644
+--- a/arch/x86/kernel/cpu/tsx.c
++++ b/arch/x86/kernel/cpu/tsx.c
+@@ -115,11 +115,12 @@ void __init tsx_init(void)
+               tsx_disable();
+               /*
+-               * tsx_disable() will change the state of the
+-               * RTM CPUID bit.  Clear it here since it is now
+-               * expected to be not set.
++               * tsx_disable() will change the state of the RTM and HLE CPUID
++               * bits. Clear them here since they are now expected to be not
++               * set.
+                */
+               setup_clear_cpu_cap(X86_FEATURE_RTM);
++              setup_clear_cpu_cap(X86_FEATURE_HLE);
+       } else if (tsx_ctrl_state == TSX_CTRL_ENABLE) {
+               /*
+@@ -131,10 +132,10 @@ void __init tsx_init(void)
+               tsx_enable();
+               /*
+-               * tsx_enable() will change the state of the
+-               * RTM CPUID bit.  Force it here since it is now
+-               * expected to be set.
++               * tsx_enable() will change the state of the RTM and HLE CPUID
++               * bits. Force them here since they are now expected to be set.
+                */
+               setup_force_cpu_cap(X86_FEATURE_RTM);
++              setup_force_cpu_cap(X86_FEATURE_HLE);
+       }
+ }
+-- 
+2.20.1
+