]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.19-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 22 Jan 2023 12:59:11 +0000 (13:59 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 22 Jan 2023 12:59:11 +0000 (13:59 +0100)
added patches:
cifs-do-not-include-page-data-when-checking-signature.patch
mmc-sunxi-mmc-fix-clock-refcount-imbalance-during-unbind.patch

queue-4.19/cifs-do-not-include-page-data-when-checking-signature.patch [new file with mode: 0644]
queue-4.19/mmc-sunxi-mmc-fix-clock-refcount-imbalance-during-unbind.patch [new file with mode: 0644]
queue-4.19/series

diff --git a/queue-4.19/cifs-do-not-include-page-data-when-checking-signature.patch b/queue-4.19/cifs-do-not-include-page-data-when-checking-signature.patch
new file mode 100644 (file)
index 0000000..eb0fd0b
--- /dev/null
@@ -0,0 +1,52 @@
+From 30b2b2196d6e4cc24cbec633535a2404f258ce69 Mon Sep 17 00:00:00 2001
+From: Enzo Matsumiya <ematsumiya@suse.de>
+Date: Wed, 18 Jan 2023 14:06:57 -0300
+Subject: cifs: do not include page data when checking signature
+
+From: Enzo Matsumiya <ematsumiya@suse.de>
+
+commit 30b2b2196d6e4cc24cbec633535a2404f258ce69 upstream.
+
+On async reads, page data is allocated before sending.  When the
+response is received but it has no data to fill (e.g.
+STATUS_END_OF_FILE), __calc_signature() will still include the pages in
+its computation, leading to an invalid signature check.
+
+This patch fixes this by not setting the async read smb_rqst page data
+(zeroed by default) if its got_bytes is 0.
+
+This can be reproduced/verified with xfstests generic/465.
+
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Enzo Matsumiya <ematsumiya@suse.de>
+Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
+Signed-off-by: Steve French <stfrench@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ fs/cifs/smb2pdu.c |   15 +++++++++------
+ 1 file changed, 9 insertions(+), 6 deletions(-)
+
+--- a/fs/cifs/smb2pdu.c
++++ b/fs/cifs/smb2pdu.c
+@@ -3152,12 +3152,15 @@ smb2_readv_callback(struct mid_q_entry *
+                               (struct smb2_sync_hdr *)rdata->iov[0].iov_base;
+       unsigned int credits_received = 0;
+       struct smb_rqst rqst = { .rq_iov = &rdata->iov[1],
+-                               .rq_nvec = 1,
+-                               .rq_pages = rdata->pages,
+-                               .rq_offset = rdata->page_offset,
+-                               .rq_npages = rdata->nr_pages,
+-                               .rq_pagesz = rdata->pagesz,
+-                               .rq_tailsz = rdata->tailsz };
++                               .rq_nvec = 1, };
++
++      if (rdata->got_bytes) {
++              rqst.rq_pages = rdata->pages;
++              rqst.rq_offset = rdata->page_offset;
++              rqst.rq_npages = rdata->nr_pages;
++              rqst.rq_pagesz = rdata->pagesz;
++              rqst.rq_tailsz = rdata->tailsz;
++      }
+       cifs_dbg(FYI, "%s: mid=%llu state=%d result=%d bytes=%u\n",
+                __func__, mid->mid, mid->mid_state, rdata->result,
diff --git a/queue-4.19/mmc-sunxi-mmc-fix-clock-refcount-imbalance-during-unbind.patch b/queue-4.19/mmc-sunxi-mmc-fix-clock-refcount-imbalance-during-unbind.patch
new file mode 100644 (file)
index 0000000..d502084
--- /dev/null
@@ -0,0 +1,41 @@
+From 8509419758f2cc28dd05370385af0d91573b76b4 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Tue, 9 Aug 2022 21:25:09 -0500
+Subject: mmc: sunxi-mmc: Fix clock refcount imbalance during unbind
+
+From: Samuel Holland <samuel@sholland.org>
+
+commit 8509419758f2cc28dd05370385af0d91573b76b4 upstream.
+
+If the controller is suspended by runtime PM, the clock is already
+disabled, so do not try to disable it again during removal. Use
+pm_runtime_disable() to flush any pending runtime PM transitions.
+
+Fixes: 9a8e1e8cc2c0 ("mmc: sunxi: Add runtime_pm support")
+Signed-off-by: Samuel Holland <samuel@sholland.org>
+Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
+Cc: stable@vger.kernel.org
+Link: https://lore.kernel.org/r/20220810022509.43743-1-samuel@sholland.org
+Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/mmc/host/sunxi-mmc.c |    8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+--- a/drivers/mmc/host/sunxi-mmc.c
++++ b/drivers/mmc/host/sunxi-mmc.c
+@@ -1441,9 +1441,11 @@ static int sunxi_mmc_remove(struct platf
+       struct sunxi_mmc_host *host = mmc_priv(mmc);
+       mmc_remove_host(mmc);
+-      pm_runtime_force_suspend(&pdev->dev);
+-      disable_irq(host->irq);
+-      sunxi_mmc_disable(host);
++      pm_runtime_disable(&pdev->dev);
++      if (!pm_runtime_status_suspended(&pdev->dev)) {
++              disable_irq(host->irq);
++              sunxi_mmc_disable(host);
++      }
+       dma_free_coherent(&pdev->dev, PAGE_SIZE, host->sg_cpu, host->sg_dma);
+       mmc_free_host(mmc);
index 7c18c2db9c60a1b86732983ff12de09115c9ac17..8e38febada454ea3303be9acb20b8a8c5208da4f 100644 (file)
@@ -18,3 +18,5 @@ usb-serial-option-add-quectel-em05cn-modem.patch
 usb-misc-iowarrior-fix-up-header-size-for-usb_device_id_codemercs_iow100.patch
 usb-core-hub-disable-autosuspend-for-ti-tusb8041.patch
 comedi-adv_pci1760-fix-pwm-instruction-handling.patch
+mmc-sunxi-mmc-fix-clock-refcount-imbalance-during-unbind.patch
+cifs-do-not-include-page-data-when-checking-signature.patch