]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 24 Sep 2021 09:04:58 +0000 (11:04 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 24 Sep 2021 09:04:58 +0000 (11:04 +0200)
added patches:
coredump-fix-memleak-in-dump_vma_snapshot.patch
dmaengine-acpi-avoid-comparison-gsi-with-linux-virq.patch
staging-rtl8192u-fix-bitwise-vs-logical-operator-in-translaterxsignalstuff819xusb.patch
um-virtio_uml-fix-memory-leak-on-init-failures.patch

queue-5.10/coredump-fix-memleak-in-dump_vma_snapshot.patch [new file with mode: 0644]
queue-5.10/dmaengine-acpi-avoid-comparison-gsi-with-linux-virq.patch [new file with mode: 0644]
queue-5.10/series
queue-5.10/staging-rtl8192u-fix-bitwise-vs-logical-operator-in-translaterxsignalstuff819xusb.patch [new file with mode: 0644]
queue-5.10/um-virtio_uml-fix-memory-leak-on-init-failures.patch [new file with mode: 0644]

diff --git a/queue-5.10/coredump-fix-memleak-in-dump_vma_snapshot.patch b/queue-5.10/coredump-fix-memleak-in-dump_vma_snapshot.patch
new file mode 100644 (file)
index 0000000..9263bdc
--- /dev/null
@@ -0,0 +1,39 @@
+From 6fcac87e1f9e5b27805a2a404f4849194bb51de8 Mon Sep 17 00:00:00 2001
+From: QiuXi <qiuxi1@huawei.com>
+Date: Tue, 7 Sep 2021 20:00:32 -0700
+Subject: coredump: fix memleak in dump_vma_snapshot()
+
+From: QiuXi <qiuxi1@huawei.com>
+
+commit 6fcac87e1f9e5b27805a2a404f4849194bb51de8 upstream.
+
+dump_vma_snapshot() allocs memory for *vma_meta, when dump_vma_snapshot()
+returns -EFAULT, the memory will be leaked, so we free it correctly.
+
+Link: https://lkml.kernel.org/r/20210810020441.62806-1-qiuxi1@huawei.com
+Fixes: a07279c9a8cd7 ("binfmt_elf, binfmt_elf_fdpic: use a VMA list snapshot")
+Signed-off-by: QiuXi <qiuxi1@huawei.com>
+Cc: Al Viro <viro@zeniv.linux.org.uk>
+Cc: Jann Horn <jannh@google.com>
+Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+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>
+---
+ fs/coredump.c |    4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/fs/coredump.c
++++ b/fs/coredump.c
+@@ -1111,8 +1111,10 @@ int dump_vma_snapshot(struct coredump_pa
+       mmap_write_unlock(mm);
+-      if (WARN_ON(i != *vma_count))
++      if (WARN_ON(i != *vma_count)) {
++              kvfree(*vma_meta);
+               return -EFAULT;
++      }
+       *vma_data_size_ptr = vma_data_size;
+       return 0;
diff --git a/queue-5.10/dmaengine-acpi-avoid-comparison-gsi-with-linux-virq.patch b/queue-5.10/dmaengine-acpi-avoid-comparison-gsi-with-linux-virq.patch
new file mode 100644 (file)
index 0000000..bebd222
--- /dev/null
@@ -0,0 +1,42 @@
+From 67db87dc8284070adb15b3c02c1c31d5cf51c5d6 Mon Sep 17 00:00:00 2001
+From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
+Date: Fri, 30 Jul 2021 23:27:15 +0300
+Subject: dmaengine: acpi: Avoid comparison GSI with Linux vIRQ
+
+From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
+
+commit 67db87dc8284070adb15b3c02c1c31d5cf51c5d6 upstream.
+
+Currently the CRST parsing relies on the fact that on most of x86 devices
+the IRQ mapping is 1:1 with Linux vIRQ. However, it may be not true for
+some. Fix this by converting GSI to Linux vIRQ before checking it.
+
+Fixes: ee8209fd026b ("dma: acpi-dma: parse CSRT to extract additional resources")
+Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
+Link: https://lore.kernel.org/r/20210730202715.24375-1-andriy.shevchenko@linux.intel.com
+Signed-off-by: Vinod Koul <vkoul@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/dma/acpi-dma.c |   10 +++++++---
+ 1 file changed, 7 insertions(+), 3 deletions(-)
+
+--- a/drivers/dma/acpi-dma.c
++++ b/drivers/dma/acpi-dma.c
+@@ -70,10 +70,14 @@ static int acpi_dma_parse_resource_group
+       si = (const struct acpi_csrt_shared_info *)&grp[1];
+-      /* Match device by MMIO and IRQ */
++      /* Match device by MMIO */
+       if (si->mmio_base_low != lower_32_bits(mem) ||
+-          si->mmio_base_high != upper_32_bits(mem) ||
+-          si->gsi_interrupt != irq)
++          si->mmio_base_high != upper_32_bits(mem))
++              return 0;
++
++      /* Match device by Linux vIRQ */
++      ret = acpi_register_gsi(NULL, si->gsi_interrupt, si->interrupt_mode, si->interrupt_polarity);
++      if (ret != irq)
+               return 0;
+       dev_dbg(&adev->dev, "matches with %.4s%04X (rev %u)\n",
index e04790bdb07f7cbeb709df437fe3f63b3e90fd2e..67f0f87123fac39b4cba7ae9e0377f929fb7eb66 100644 (file)
@@ -10,3 +10,7 @@ arm-9098-1-ftrace-module_plt-fix-build-problem-without-dynamic_ftrace.patch
 revert-net-mlx5-register-to-devlink-ingress-vlan-filter-trap.patch
 sctp-validate-chunk-size-in-__rcv_asconf_lookup.patch
 sctp-add-param-size-validation-for-sctp_param_set_primary.patch
+staging-rtl8192u-fix-bitwise-vs-logical-operator-in-translaterxsignalstuff819xusb.patch
+coredump-fix-memleak-in-dump_vma_snapshot.patch
+um-virtio_uml-fix-memory-leak-on-init-failures.patch
+dmaengine-acpi-avoid-comparison-gsi-with-linux-virq.patch
diff --git a/queue-5.10/staging-rtl8192u-fix-bitwise-vs-logical-operator-in-translaterxsignalstuff819xusb.patch b/queue-5.10/staging-rtl8192u-fix-bitwise-vs-logical-operator-in-translaterxsignalstuff819xusb.patch
new file mode 100644 (file)
index 0000000..95c3d96
--- /dev/null
@@ -0,0 +1,40 @@
+From 099ec97ac92911abfb102bb5c68ed270fc12e0dd Mon Sep 17 00:00:00 2001
+From: Nathan Chancellor <nathan@kernel.org>
+Date: Sat, 14 Aug 2021 16:56:26 -0700
+Subject: staging: rtl8192u: Fix bitwise vs logical operator in TranslateRxSignalStuff819xUsb()
+
+From: Nathan Chancellor <nathan@kernel.org>
+
+commit 099ec97ac92911abfb102bb5c68ed270fc12e0dd upstream.
+
+clang warns:
+
+drivers/staging/rtl8192u/r8192U_core.c:4268:20: warning: bitwise and of
+boolean expressions; did you mean logical and? [-Wbool-operation-and]
+        bpacket_toself =  bpacket_match_bssid &
+                          ^~~~~~~~~~~~~~~~~~~~~
+                                              &&
+1 warning generated.
+
+Replace the bitwise AND with a logical one to clear up the warning, as
+that is clearly what was intended.
+
+Fixes: 8fc8598e61f6 ("Staging: Added Realtek rtl8192u driver to staging")
+Signed-off-by: Nathan Chancellor <nathan@kernel.org>
+Link: https://lore.kernel.org/r/20210814235625.1780033-1-nathan@kernel.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/staging/rtl8192u/r8192U_core.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/staging/rtl8192u/r8192U_core.c
++++ b/drivers/staging/rtl8192u/r8192U_core.c
+@@ -4271,7 +4271,7 @@ static void TranslateRxSignalStuff819xUs
+       bpacket_match_bssid = (type != IEEE80211_FTYPE_CTL) &&
+                              (ether_addr_equal(priv->ieee80211->current_network.bssid,  (fc & IEEE80211_FCTL_TODS) ? hdr->addr1 : (fc & IEEE80211_FCTL_FROMDS) ? hdr->addr2 : hdr->addr3))
+                              && (!pstats->bHwError) && (!pstats->bCRC) && (!pstats->bICV);
+-      bpacket_toself =  bpacket_match_bssid &
++      bpacket_toself =  bpacket_match_bssid &&
+                         (ether_addr_equal(praddr, priv->ieee80211->dev->dev_addr));
+       if (WLAN_FC_GET_FRAMETYPE(fc) == IEEE80211_STYPE_BEACON)
diff --git a/queue-5.10/um-virtio_uml-fix-memory-leak-on-init-failures.patch b/queue-5.10/um-virtio_uml-fix-memory-leak-on-init-failures.patch
new file mode 100644 (file)
index 0000000..30018af
--- /dev/null
@@ -0,0 +1,41 @@
+From 7ad28e0df7ee9dbcb793bb88dd81d4d22bb9a10e Mon Sep 17 00:00:00 2001
+From: Johannes Berg <johannes.berg@intel.com>
+Date: Fri, 25 Jun 2021 10:34:37 +0200
+Subject: um: virtio_uml: fix memory leak on init failures
+
+From: Johannes Berg <johannes.berg@intel.com>
+
+commit 7ad28e0df7ee9dbcb793bb88dd81d4d22bb9a10e upstream.
+
+If initialization fails, e.g. because the connection failed,
+we leak the 'vu_dev'. Fix that. Reported by smatch.
+
+Fixes: 5d38f324993f ("um: drivers: Add virtio vhost-user driver")
+Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+Acked-By: Anton Ivanov <anton.ivanov@cambridgegreys.com>
+Signed-off-by: Richard Weinberger <richard@nod.at>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/um/drivers/virtio_uml.c |    4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/arch/um/drivers/virtio_uml.c
++++ b/arch/um/drivers/virtio_uml.c
+@@ -1113,7 +1113,7 @@ static int virtio_uml_probe(struct platf
+               rc = os_connect_socket(pdata->socket_path);
+       } while (rc == -EINTR);
+       if (rc < 0)
+-              return rc;
++              goto error_free;
+       vu_dev->sock = rc;
+       spin_lock_init(&vu_dev->sock_lock);
+@@ -1132,6 +1132,8 @@ static int virtio_uml_probe(struct platf
+ error_init:
+       os_close_file(vu_dev->sock);
++error_free:
++      kfree(vu_dev);
+       return rc;
+ }