From: Greg Kroah-Hartman Date: Sun, 22 Jan 2023 12:59:11 +0000 (+0100) Subject: 4.19-stable patches X-Git-Tag: v4.14.304~39 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=71e1d682a302d028cb294b5900fc969efaaa26ed;p=thirdparty%2Fkernel%2Fstable-queue.git 4.19-stable patches added patches: cifs-do-not-include-page-data-when-checking-signature.patch mmc-sunxi-mmc-fix-clock-refcount-imbalance-during-unbind.patch --- 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 index 00000000000..eb0fd0b15c1 --- /dev/null +++ b/queue-4.19/cifs-do-not-include-page-data-when-checking-signature.patch @@ -0,0 +1,52 @@ +From 30b2b2196d6e4cc24cbec633535a2404f258ce69 Mon Sep 17 00:00:00 2001 +From: Enzo Matsumiya +Date: Wed, 18 Jan 2023 14:06:57 -0300 +Subject: cifs: do not include page data when checking signature + +From: Enzo Matsumiya + +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: +Signed-off-by: Enzo Matsumiya +Reviewed-by: Paulo Alcantara (SUSE) +Signed-off-by: Steve French +Signed-off-by: Greg Kroah-Hartman +--- + 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 index 00000000000..d5020849ffa --- /dev/null +++ b/queue-4.19/mmc-sunxi-mmc-fix-clock-refcount-imbalance-during-unbind.patch @@ -0,0 +1,41 @@ +From 8509419758f2cc28dd05370385af0d91573b76b4 Mon Sep 17 00:00:00 2001 +From: Samuel Holland +Date: Tue, 9 Aug 2022 21:25:09 -0500 +Subject: mmc: sunxi-mmc: Fix clock refcount imbalance during unbind + +From: Samuel Holland + +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 +Acked-by: Jernej Skrabec +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/r/20220810022509.43743-1-samuel@sholland.org +Signed-off-by: Ulf Hansson +Signed-off-by: Greg Kroah-Hartman +--- + 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); + diff --git a/queue-4.19/series b/queue-4.19/series index 7c18c2db9c6..8e38febada4 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -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