From: Sasha Levin Date: Fri, 18 Jun 2021 11:47:18 +0000 (-0400) Subject: Fixes for 4.14 X-Git-Tag: v5.4.128~62 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=55bd1c36f500a40e3e100191918c7103bd4809b5;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 4.14 Signed-off-by: Sasha Levin --- diff --git a/queue-4.14/dmaengine-altera_msgdma-depends-on-has_iomem.patch b/queue-4.14/dmaengine-altera_msgdma-depends-on-has_iomem.patch new file mode 100644 index 00000000000..5efccdbe576 --- /dev/null +++ b/queue-4.14/dmaengine-altera_msgdma-depends-on-has_iomem.patch @@ -0,0 +1,49 @@ +From 8f399fb8f703a7fe9d849ae3942d79301d2bb459 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 21 May 2021 19:13:10 -0700 +Subject: dmaengine: ALTERA_MSGDMA depends on HAS_IOMEM + +From: Randy Dunlap + +[ Upstream commit 253697b93c2a1c237d34d3ae326e394aeb0ca7b3 ] + +When CONFIG_HAS_IOMEM is not set/enabled, certain iomap() family +functions [including ioremap(), devm_ioremap(), etc.] are not +available. +Drivers that use these functions should depend on HAS_IOMEM so that +they do not cause build errors. + +Repairs this build error: +s390-linux-ld: drivers/dma/altera-msgdma.o: in function `request_and_map': +altera-msgdma.c:(.text+0x14b0): undefined reference to `devm_ioremap' + +Fixes: a85c6f1b2921 ("dmaengine: Add driver for Altera / Intel mSGDMA IP core") +Signed-off-by: Randy Dunlap +Reported-by: kernel test robot +Cc: Stefan Roese +Cc: Vinod Koul +Cc: dmaengine@vger.kernel.org +Reviewed-by: Stefan Roese +Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de +Link: https://lore.kernel.org/r/20210522021313.16405-2-rdunlap@infradead.org +Signed-off-by: Vinod Koul +Signed-off-by: Sasha Levin +--- + drivers/dma/Kconfig | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig +index 79b809dbfda0..ff69feefc1c6 100644 +--- a/drivers/dma/Kconfig ++++ b/drivers/dma/Kconfig +@@ -58,6 +58,7 @@ config DMA_OF + #devices + config ALTERA_MSGDMA + tristate "Altera / Intel mSGDMA Engine" ++ depends on HAS_IOMEM + select DMA_ENGINE + help + Enable support for Altera / Intel mSGDMA controller. +-- +2.30.2 + diff --git a/queue-4.14/dmaengine-qcom_hidma_mgmt-depends-on-has_iomem.patch b/queue-4.14/dmaengine-qcom_hidma_mgmt-depends-on-has_iomem.patch new file mode 100644 index 00000000000..bdea50c1156 --- /dev/null +++ b/queue-4.14/dmaengine-qcom_hidma_mgmt-depends-on-has_iomem.patch @@ -0,0 +1,50 @@ +From 861c00739bc7e96f6f5b935cc15f7d0c09c4b5cc Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 21 May 2021 19:13:11 -0700 +Subject: dmaengine: QCOM_HIDMA_MGMT depends on HAS_IOMEM + +From: Randy Dunlap + +[ Upstream commit 0cfbb589d67f16fa55b26ae02b69c31b52e344b1 ] + +When CONFIG_HAS_IOMEM is not set/enabled, certain iomap() family +functions [including ioremap(), devm_ioremap(), etc.] are not +available. +Drivers that use these functions should depend on HAS_IOMEM so that +they do not cause build errors. + +Rectifies these build errors: +s390-linux-ld: drivers/dma/qcom/hidma_mgmt.o: in function `hidma_mgmt_probe': +hidma_mgmt.c:(.text+0x780): undefined reference to `devm_ioremap_resource' +s390-linux-ld: drivers/dma/qcom/hidma_mgmt.o: in function `hidma_mgmt_init': +hidma_mgmt.c:(.init.text+0x126): undefined reference to `of_address_to_resource' +s390-linux-ld: hidma_mgmt.c:(.init.text+0x16e): undefined reference to `of_address_to_resource' + +Fixes: 67a2003e0607 ("dmaengine: add Qualcomm Technologies HIDMA channel driver") +Signed-off-by: Randy Dunlap +Reported-by: kernel test robot +Cc: Sinan Kaya +Cc: Vinod Koul +Cc: dmaengine@vger.kernel.org +Link: https://lore.kernel.org/r/20210522021313.16405-3-rdunlap@infradead.org +Signed-off-by: Vinod Koul +Signed-off-by: Sasha Levin +--- + drivers/dma/qcom/Kconfig | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/dma/qcom/Kconfig b/drivers/dma/qcom/Kconfig +index a7761c4025f4..a97c7123d913 100644 +--- a/drivers/dma/qcom/Kconfig ++++ b/drivers/dma/qcom/Kconfig +@@ -9,6 +9,7 @@ config QCOM_BAM_DMA + + config QCOM_HIDMA_MGMT + tristate "Qualcomm Technologies HIDMA Management support" ++ depends on HAS_IOMEM + select DMA_ENGINE + help + Enable support for the Qualcomm Technologies HIDMA Management. +-- +2.30.2 + diff --git a/queue-4.14/dmaengine-stedma40-add-missing-iounmap-on-error-in-d.patch b/queue-4.14/dmaengine-stedma40-add-missing-iounmap-on-error-in-d.patch new file mode 100644 index 00000000000..8059f4e3730 --- /dev/null +++ b/queue-4.14/dmaengine-stedma40-add-missing-iounmap-on-error-in-d.patch @@ -0,0 +1,40 @@ +From dc3f9c3bdb8afc97c31bd02420965f9a7a66dfde Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 18 May 2021 22:11:08 +0800 +Subject: dmaengine: stedma40: add missing iounmap() on error in d40_probe() + +From: Yang Yingliang + +[ Upstream commit fffdaba402cea79b8d219355487d342ec23f91c6 ] + +Add the missing iounmap() before return from d40_probe() +in the error handling case. + +Fixes: 8d318a50b3d7 ("DMAENGINE: Support for ST-Ericssons DMA40 block v3") +Reported-by: Hulk Robot +Signed-off-by: Yang Yingliang +Reviewed-by: Linus Walleij +Link: https://lore.kernel.org/r/20210518141108.1324127-1-yangyingliang@huawei.com +Signed-off-by: Vinod Koul +Signed-off-by: Sasha Levin +--- + drivers/dma/ste_dma40.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c +index 90feb6a05e59..ee15d4fefbad 100644 +--- a/drivers/dma/ste_dma40.c ++++ b/drivers/dma/ste_dma40.c +@@ -3656,6 +3656,9 @@ static int __init d40_probe(struct platform_device *pdev) + + kfree(base->lcla_pool.base_unaligned); + ++ if (base->lcpa_base) ++ iounmap(base->lcpa_base); ++ + if (base->phy_lcpa) + release_mem_region(base->phy_lcpa, + base->lcpa_size); +-- +2.30.2 + diff --git a/queue-4.14/mm-memory-failure-make-sure-wait-for-page-writeback-.patch b/queue-4.14/mm-memory-failure-make-sure-wait-for-page-writeback-.patch new file mode 100644 index 00000000000..2e6a3c320d4 --- /dev/null +++ b/queue-4.14/mm-memory-failure-make-sure-wait-for-page-writeback-.patch @@ -0,0 +1,84 @@ +From 0ab805768336eedddb28afcefeb8d4a306c7faf9 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 15 Jun 2021 18:23:32 -0700 +Subject: mm/memory-failure: make sure wait for page writeback in + memory_failure + +From: yangerkun + +[ Upstream commit e8675d291ac007e1c636870db880f837a9ea112a ] + +Our syzkaller trigger the "BUG_ON(!list_empty(&inode->i_wb_list))" in +clear_inode: + + kernel BUG at fs/inode.c:519! + Internal error: Oops - BUG: 0 [#1] SMP + Modules linked in: + Process syz-executor.0 (pid: 249, stack limit = 0x00000000a12409d7) + CPU: 1 PID: 249 Comm: syz-executor.0 Not tainted 4.19.95 + Hardware name: linux,dummy-virt (DT) + pstate: 80000005 (Nzcv daif -PAN -UAO) + pc : clear_inode+0x280/0x2a8 + lr : clear_inode+0x280/0x2a8 + Call trace: + clear_inode+0x280/0x2a8 + ext4_clear_inode+0x38/0xe8 + ext4_free_inode+0x130/0xc68 + ext4_evict_inode+0xb20/0xcb8 + evict+0x1a8/0x3c0 + iput+0x344/0x460 + do_unlinkat+0x260/0x410 + __arm64_sys_unlinkat+0x6c/0xc0 + el0_svc_common+0xdc/0x3b0 + el0_svc_handler+0xf8/0x160 + el0_svc+0x10/0x218 + Kernel panic - not syncing: Fatal exception + +A crash dump of this problem show that someone called __munlock_pagevec +to clear page LRU without lock_page: do_mmap -> mmap_region -> do_munmap +-> munlock_vma_pages_range -> __munlock_pagevec. + +As a result memory_failure will call identify_page_state without +wait_on_page_writeback. And after truncate_error_page clear the mapping +of this page. end_page_writeback won't call sb_clear_inode_writeback to +clear inode->i_wb_list. That will trigger BUG_ON in clear_inode! + +Fix it by checking PageWriteback too to help determine should we skip +wait_on_page_writeback. + +Link: https://lkml.kernel.org/r/20210604084705.3729204-1-yangerkun@huawei.com +Fixes: 0bc1f8b0682c ("hwpoison: fix the handling path of the victimized page frame that belong to non-LRU") +Signed-off-by: yangerkun +Acked-by: Naoya Horiguchi +Cc: Jan Kara +Cc: Theodore Ts'o +Cc: Oscar Salvador +Cc: Yu Kuai +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Sasha Levin +--- + mm/memory-failure.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/mm/memory-failure.c b/mm/memory-failure.c +index 001b6bfccbfb..e7827b9e6397 100644 +--- a/mm/memory-failure.c ++++ b/mm/memory-failure.c +@@ -1267,7 +1267,12 @@ int memory_failure(unsigned long pfn, int trapno, int flags) + return 0; + } + +- if (!PageTransTail(p) && !PageLRU(p)) ++ /* ++ * __munlock_pagevec may clear a writeback page's LRU flag without ++ * page_lock. We need wait writeback completion for this page or it ++ * may trigger vfs BUG while evict inode. ++ */ ++ if (!PageTransTail(p) && !PageLRU(p) && !PageWriteback(p)) + goto identify_page_state; + + /* +-- +2.30.2 + diff --git a/queue-4.14/series b/queue-4.14/series index 40231f3e79d..367babd08b5 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -15,3 +15,7 @@ rtnetlink-fix-missing-error-code-in-rtnl_bridge_noti.patch net-x25-return-the-correct-errno-code.patch net-return-the-correct-errno-code.patch fib-return-the-correct-errno-code.patch +dmaengine-altera_msgdma-depends-on-has_iomem.patch +dmaengine-qcom_hidma_mgmt-depends-on-has_iomem.patch +dmaengine-stedma40-add-missing-iounmap-on-error-in-d.patch +mm-memory-failure-make-sure-wait-for-page-writeback-.patch