From: Greg Kroah-Hartman Date: Sun, 3 Mar 2019 08:18:42 +0000 (+0100) Subject: 4.20-stable patches X-Git-Tag: v4.9.162~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fe782632be666877b4a19876263b8afc6d7e87be;p=thirdparty%2Fkernel%2Fstable-queue.git 4.20-stable patches added patches: arm64-dts-qcom-msm8998-extend-tz-reserved-memory-area.patch mips-ebpf-fix-icache-flush-end-address.patch scsi-3w-9xxx-fix-calls-to-dma_set_mask_and_coherent.patch scsi-3w-sas-fix-calls-to-dma_set_mask_and_coherent.patch scsi-aic94xx-fix-calls-to-dma_set_mask_and_coherent.patch scsi-csiostor-fix-calls-to-dma_set_mask_and_coherent.patch --- diff --git a/queue-4.20/arm64-dts-qcom-msm8998-extend-tz-reserved-memory-area.patch b/queue-4.20/arm64-dts-qcom-msm8998-extend-tz-reserved-memory-area.patch new file mode 100644 index 00000000000..29d3bef6707 --- /dev/null +++ b/queue-4.20/arm64-dts-qcom-msm8998-extend-tz-reserved-memory-area.patch @@ -0,0 +1,37 @@ +From 6e53330909672bd9a8c9f826e989a5945d9d9fdf Mon Sep 17 00:00:00 2001 +From: Marc Gonzalez +Date: Mon, 25 Feb 2019 11:41:33 +0100 +Subject: arm64: dts: qcom: msm8998: Extend TZ reserved memory area + +From: Marc Gonzalez + +commit 6e53330909672bd9a8c9f826e989a5945d9d9fdf upstream. + +My console locks up as soon as Linux writes to [88800000,88f00000[ +AFAIU, that memory area is reserved for trustzone. + +Extend TZ reserved memory range, to prevent Linux from stepping on +trustzone's toes. + +Cc: stable@vger.kernel.org # 4.20+ +Reviewed-by: Sibi Sankar +Fixes: c7833949564ec ("arm64: dts: qcom: msm8998: Add smem related nodes") +Signed-off-by: Marc Gonzalez +Signed-off-by: Andy Gross +Signed-off-by: Greg Kroah-Hartman + +--- + arch/arm64/boot/dts/qcom/msm8998.dtsi | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/arm64/boot/dts/qcom/msm8998.dtsi ++++ b/arch/arm64/boot/dts/qcom/msm8998.dtsi +@@ -36,7 +36,7 @@ + }; + + memory@86200000 { +- reg = <0x0 0x86200000 0x0 0x2600000>; ++ reg = <0x0 0x86200000 0x0 0x2d00000>; + no-map; + }; + diff --git a/queue-4.20/mips-ebpf-fix-icache-flush-end-address.patch b/queue-4.20/mips-ebpf-fix-icache-flush-end-address.patch new file mode 100644 index 00000000000..c504e1cce40 --- /dev/null +++ b/queue-4.20/mips-ebpf-fix-icache-flush-end-address.patch @@ -0,0 +1,55 @@ +From d1a2930d8a992fb6ac2529449f81a0056e1b98d1 Mon Sep 17 00:00:00 2001 +From: Paul Burton +Date: Fri, 1 Mar 2019 22:58:09 +0000 +Subject: MIPS: eBPF: Fix icache flush end address + +From: Paul Burton + +commit d1a2930d8a992fb6ac2529449f81a0056e1b98d1 upstream. + +The MIPS eBPF JIT calls flush_icache_range() in order to ensure the +icache observes the code that we just wrote. Unfortunately it gets the +end address calculation wrong due to some bad pointer arithmetic. + +The struct jit_ctx target field is of type pointer to u32, and as such +adding one to it will increment the address being pointed to by 4 bytes. +Therefore in order to find the address of the end of the code we simply +need to add the number of 4 byte instructions emitted, but we mistakenly +add the number of instructions multiplied by 4. This results in the call +to flush_icache_range() operating on a memory region 4x larger than +intended, which is always wasteful and can cause crashes if we overrun +into an unmapped page. + +Fix this by correcting the pointer arithmetic to remove the bogus +multiplication, and use braces to remove the need for a set of brackets +whilst also making it obvious that the target field is a pointer. + +Signed-off-by: Paul Burton +Fixes: b6bd53f9c4e8 ("MIPS: Add missing file for eBPF JIT.") +Cc: Alexei Starovoitov +Cc: Daniel Borkmann +Cc: Martin KaFai Lau +Cc: Song Liu +Cc: Yonghong Song +Cc: netdev@vger.kernel.org +Cc: bpf@vger.kernel.org +Cc: linux-mips@vger.kernel.org +Cc: stable@vger.kernel.org # v4.13+ +Signed-off-by: Daniel Borkmann +Signed-off-by: Greg Kroah-Hartman + +--- + arch/mips/net/ebpf_jit.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/mips/net/ebpf_jit.c ++++ b/arch/mips/net/ebpf_jit.c +@@ -1818,7 +1818,7 @@ struct bpf_prog *bpf_int_jit_compile(str + + /* Update the icache */ + flush_icache_range((unsigned long)ctx.target, +- (unsigned long)(ctx.target + ctx.idx * sizeof(u32))); ++ (unsigned long)&ctx.target[ctx.idx]); + + if (bpf_jit_enable > 1) + /* Dump JIT code */ diff --git a/queue-4.20/scsi-3w-9xxx-fix-calls-to-dma_set_mask_and_coherent.patch b/queue-4.20/scsi-3w-9xxx-fix-calls-to-dma_set_mask_and_coherent.patch new file mode 100644 index 00000000000..03cb986a7bb --- /dev/null +++ b/queue-4.20/scsi-3w-9xxx-fix-calls-to-dma_set_mask_and_coherent.patch @@ -0,0 +1,62 @@ +From 33d6667416c73eb0b37f0f10f56d825b15389dab Mon Sep 17 00:00:00 2001 +From: Hannes Reinecke +Date: Mon, 18 Feb 2019 08:34:20 +0100 +Subject: scsi: 3w-9xxx: fix calls to dma_set_mask_and_coherent() + +From: Hannes Reinecke + +commit 33d6667416c73eb0b37f0f10f56d825b15389dab upstream. + +The change to use dma_set_mask_and_coherent() incorrectly made a second +call with the 32 bit DMA mask value when the call with the 64 bit DMA mask +value succeeded. + +Fixes: b000bced5739 ("scsi: 3w-9xxx: fully convert to the generic DMA API") +Cc: +Signed-off-by: Hannes Reinecke +Reviewed-by: Christoph Hellwig +Reviewed-by: Ewan D. Milne +Signed-off-by: Martin K. Petersen +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/scsi/3w-9xxx.c | 14 +++++++++----- + 1 file changed, 9 insertions(+), 5 deletions(-) + +--- a/drivers/scsi/3w-9xxx.c ++++ b/drivers/scsi/3w-9xxx.c +@@ -2010,7 +2010,7 @@ static int twa_probe(struct pci_dev *pde + struct Scsi_Host *host = NULL; + TW_Device_Extension *tw_dev; + unsigned long mem_addr, mem_len; +- int retval = -ENODEV; ++ int retval; + + retval = pci_enable_device(pdev); + if (retval) { +@@ -2021,8 +2021,10 @@ static int twa_probe(struct pci_dev *pde + pci_set_master(pdev); + pci_try_set_mwi(pdev); + +- if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)) || +- dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32))) { ++ retval = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)); ++ if (retval) ++ retval = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); ++ if (retval) { + TW_PRINTK(host, TW_DRIVER, 0x23, "Failed to set dma mask"); + retval = -ENODEV; + goto out_disable_device; +@@ -2241,8 +2243,10 @@ static int twa_resume(struct pci_dev *pd + pci_set_master(pdev); + pci_try_set_mwi(pdev); + +- if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)) || +- dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32))) { ++ retval = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)); ++ if (retval) ++ retval = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); ++ if (retval) { + TW_PRINTK(host, TW_DRIVER, 0x40, "Failed to set dma mask during resume"); + retval = -ENODEV; + goto out_disable_device; diff --git a/queue-4.20/scsi-3w-sas-fix-calls-to-dma_set_mask_and_coherent.patch b/queue-4.20/scsi-3w-sas-fix-calls-to-dma_set_mask_and_coherent.patch new file mode 100644 index 00000000000..25b59e27711 --- /dev/null +++ b/queue-4.20/scsi-3w-sas-fix-calls-to-dma_set_mask_and_coherent.patch @@ -0,0 +1,53 @@ +From 1feb3b02294994ee3a067c9b6cda6c244fd0ee18 Mon Sep 17 00:00:00 2001 +From: Hannes Reinecke +Date: Mon, 18 Feb 2019 08:34:21 +0100 +Subject: scsi: 3w-sas: fix calls to dma_set_mask_and_coherent() + +From: Hannes Reinecke + +commit 1feb3b02294994ee3a067c9b6cda6c244fd0ee18 upstream. + +The change to use dma_set_mask_and_coherent() incorrectly made a second +call with the 32 bit DMA mask value when the call with the 64 bit DMA mask +value succeeded. + +Fixes: b1fa122930c4 ("scsi: 3w-sas: fully convert to the generic DMA API") +Cc: +Signed-off-by: Hannes Reinecke +Reviewed-by: Christoph Hellwig +Reviewed-by: Ewan D. Milne +Signed-off-by: Martin K. Petersen +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/scsi/3w-sas.c | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +--- a/drivers/scsi/3w-sas.c ++++ b/drivers/scsi/3w-sas.c +@@ -1573,8 +1573,10 @@ static int twl_probe(struct pci_dev *pde + pci_set_master(pdev); + pci_try_set_mwi(pdev); + +- if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)) || +- dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32))) { ++ retval = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)); ++ if (retval) ++ retval = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); ++ if (retval) { + TW_PRINTK(host, TW_DRIVER, 0x18, "Failed to set dma mask"); + retval = -ENODEV; + goto out_disable_device; +@@ -1805,8 +1807,10 @@ static int twl_resume(struct pci_dev *pd + pci_set_master(pdev); + pci_try_set_mwi(pdev); + +- if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)) || +- dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32))) { ++ retval = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)); ++ if (retval) ++ retval = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); ++ if (retval) { + TW_PRINTK(host, TW_DRIVER, 0x25, "Failed to set dma mask during resume"); + retval = -ENODEV; + goto out_disable_device; diff --git a/queue-4.20/scsi-aic94xx-fix-calls-to-dma_set_mask_and_coherent.patch b/queue-4.20/scsi-aic94xx-fix-calls-to-dma_set_mask_and_coherent.patch new file mode 100644 index 00000000000..9bbd1ea0922 --- /dev/null +++ b/queue-4.20/scsi-aic94xx-fix-calls-to-dma_set_mask_and_coherent.patch @@ -0,0 +1,44 @@ +From c326de562f1fc149da4855a1b9d0433300c2a85d Mon Sep 17 00:00:00 2001 +From: Hannes Reinecke +Date: Mon, 18 Feb 2019 08:34:22 +0100 +Subject: scsi: aic94xx: fix calls to dma_set_mask_and_coherent() + +From: Hannes Reinecke + +commit c326de562f1fc149da4855a1b9d0433300c2a85d upstream. + +The change to use dma_set_mask_and_coherent() incorrectly made a second +call with the 32 bit DMA mask value when the call with the 64 bit DMA mask +value succeeded. + +[mkp: fixed subject] + +Fixes: 3a21986f1a59 ("scsi: aic94xx: fully convert to the generic DMA API") +Cc: +Signed-off-by: Hannes Reinecke +Reviewed-by: Christoph Hellwig +Reviewed-by: Ewan D. Milne +Signed-off-by: Martin K. Petersen +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/scsi/aic94xx/aic94xx_init.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +--- a/drivers/scsi/aic94xx/aic94xx_init.c ++++ b/drivers/scsi/aic94xx/aic94xx_init.c +@@ -770,9 +770,11 @@ static int asd_pci_probe(struct pci_dev + if (err) + goto Err_remove; + +- err = -ENODEV; +- if (dma_set_mask_and_coherent(&dev->dev, DMA_BIT_MASK(64)) || +- dma_set_mask_and_coherent(&dev->dev, DMA_BIT_MASK(32))) { ++ err = dma_set_mask_and_coherent(&dev->dev, DMA_BIT_MASK(64)); ++ if (err) ++ err = dma_set_mask_and_coherent(&dev->dev, DMA_BIT_MASK(32)); ++ if (err) { ++ err = -ENODEV; + asd_printk("no suitable DMA mask for %s\n", pci_name(dev)); + goto Err_remove; + } diff --git a/queue-4.20/scsi-csiostor-fix-calls-to-dma_set_mask_and_coherent.patch b/queue-4.20/scsi-csiostor-fix-calls-to-dma_set_mask_and_coherent.patch new file mode 100644 index 00000000000..aec725d43c2 --- /dev/null +++ b/queue-4.20/scsi-csiostor-fix-calls-to-dma_set_mask_and_coherent.patch @@ -0,0 +1,41 @@ +From 732f3238dcf27acb92959a99b7923dc49395980e Mon Sep 17 00:00:00 2001 +From: Hannes Reinecke +Date: Mon, 18 Feb 2019 08:34:24 +0100 +Subject: scsi: csiostor: fix calls to dma_set_mask_and_coherent() + +From: Hannes Reinecke + +commit 732f3238dcf27acb92959a99b7923dc49395980e upstream. + +The change to use dma_set_mask_and_coherent() incorrectly made a second +call with the 32 bit DMA mask value when the call with the 64 bit DMA mask +value succeeded. + +Fixes: c22b332d811b ("scsi: csiostor: switch to generic DMA API") +Cc: +Signed-off-by: Hannes Reinecke +Reviewed-by: Christoph Hellwig +Reviewed-by: Ewan D. Milne +Signed-off-by: Martin K. Petersen +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/scsi/csiostor/csio_init.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +--- a/drivers/scsi/csiostor/csio_init.c ++++ b/drivers/scsi/csiostor/csio_init.c +@@ -210,8 +210,11 @@ csio_pci_init(struct pci_dev *pdev, int + pci_set_master(pdev); + pci_try_set_mwi(pdev); + +- if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)) || +- dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32))) { ++ rv = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)); ++ if (rv) ++ rv = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); ++ if (rv) { ++ rv = -ENODEV; + dev_err(&pdev->dev, "No suitable DMA available.\n"); + goto err_release_regions; + } diff --git a/queue-4.20/series b/queue-4.20/series index f65c10c900b..8596779717c 100644 --- a/queue-4.20/series +++ b/queue-4.20/series @@ -79,3 +79,9 @@ crypto-ccree-add-missing-inline-qualifier.patch mips-fix-truncation-in-__cmpxchg_small-for-short-values.patch mips-bcm63xx-provide-dma-masks-for-ethernet-devices.patch mips-fix-memory-setup-for-platforms-with-phys_offset-0.patch +scsi-3w-sas-fix-calls-to-dma_set_mask_and_coherent.patch +scsi-csiostor-fix-calls-to-dma_set_mask_and_coherent.patch +scsi-3w-9xxx-fix-calls-to-dma_set_mask_and_coherent.patch +scsi-aic94xx-fix-calls-to-dma_set_mask_and_coherent.patch +arm64-dts-qcom-msm8998-extend-tz-reserved-memory-area.patch +mips-ebpf-fix-icache-flush-end-address.patch