]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 4.4
authorSasha Levin <sashal@kernel.org>
Mon, 16 Nov 2020 13:58:18 +0000 (08:58 -0500)
committerSasha Levin <sashal@kernel.org>
Mon, 16 Nov 2020 13:58:18 +0000 (08:58 -0500)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-4.4/cosa-add-missing-kfree-in-error-path-of-cosa_write.patch [new file with mode: 0644]
queue-4.4/of-address-fix-of_node-memory-leak-in-of_dma_is_cohe.patch [new file with mode: 0644]
queue-4.4/perf-fix-get_recursion_context.patch [new file with mode: 0644]
queue-4.4/series
queue-4.4/xfs-fix-a-missing-unlock-on-error-in-xfs_fs_map_bloc.patch [new file with mode: 0644]

diff --git a/queue-4.4/cosa-add-missing-kfree-in-error-path-of-cosa_write.patch b/queue-4.4/cosa-add-missing-kfree-in-error-path-of-cosa_write.patch
new file mode 100644 (file)
index 0000000..26c7742
--- /dev/null
@@ -0,0 +1,39 @@
+From 9990b46f80c8e7899ed81cb8eb1e9532862ae2af Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 10 Nov 2020 22:46:14 +0800
+Subject: cosa: Add missing kfree in error path of cosa_write
+
+From: Wang Hai <wanghai38@huawei.com>
+
+[ Upstream commit 52755b66ddcef2e897778fac5656df18817b59ab ]
+
+If memory allocation for 'kbuf' succeed, cosa_write() doesn't have a
+corresponding kfree() in exception handling. Thus add kfree() for this
+function implementation.
+
+Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
+Reported-by: Hulk Robot <hulkci@huawei.com>
+Signed-off-by: Wang Hai <wanghai38@huawei.com>
+Acked-by: Jan "Yenya" Kasprzak <kas@fi.muni.cz>
+Link: https://lore.kernel.org/r/20201110144614.43194-1-wanghai38@huawei.com
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/net/wan/cosa.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/drivers/net/wan/cosa.c b/drivers/net/wan/cosa.c
+index 848ea6a399f23..cbda69e58e084 100644
+--- a/drivers/net/wan/cosa.c
++++ b/drivers/net/wan/cosa.c
+@@ -903,6 +903,7 @@ static ssize_t cosa_write(struct file *file,
+                       chan->tx_status = 1;
+                       spin_unlock_irqrestore(&cosa->lock, flags);
+                       up(&chan->wsem);
++                      kfree(kbuf);
+                       return -ERESTARTSYS;
+               }
+       }
+-- 
+2.27.0
+
diff --git a/queue-4.4/of-address-fix-of_node-memory-leak-in-of_dma_is_cohe.patch b/queue-4.4/of-address-fix-of_node-memory-leak-in-of_dma_is_cohe.patch
new file mode 100644 (file)
index 0000000..b5ee6f9
--- /dev/null
@@ -0,0 +1,47 @@
+From 931610393a561476b32a25fd631416fcc30fc60d Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 10 Nov 2020 15:28:25 +1300
+Subject: of/address: Fix of_node memory leak in of_dma_is_coherent
+
+From: Evan Nimmo <evan.nimmo@alliedtelesis.co.nz>
+
+[ Upstream commit a5bea04fcc0b3c0aec71ee1fd58fd4ff7ee36177 ]
+
+Commit dabf6b36b83a ("of: Add OF_DMA_DEFAULT_COHERENT & select it on
+powerpc") added a check to of_dma_is_coherent which returns early
+if OF_DMA_DEFAULT_COHERENT is enabled. This results in the of_node_put()
+being skipped causing a memory leak. Moved the of_node_get() below this
+check so we now we only get the node if OF_DMA_DEFAULT_COHERENT is not
+enabled.
+
+Fixes: dabf6b36b83a ("of: Add OF_DMA_DEFAULT_COHERENT & select it on powerpc")
+Signed-off-by: Evan Nimmo <evan.nimmo@alliedtelesis.co.nz>
+Link: https://lore.kernel.org/r/20201110022825.30895-1-evan.nimmo@alliedtelesis.co.nz
+Signed-off-by: Rob Herring <robh@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/of/address.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/of/address.c b/drivers/of/address.c
+index b3bf8762f4e8c..77881432dd404 100644
+--- a/drivers/of/address.c
++++ b/drivers/of/address.c
+@@ -1014,11 +1014,13 @@ EXPORT_SYMBOL_GPL(of_dma_get_range);
+  */
+ bool of_dma_is_coherent(struct device_node *np)
+ {
+-      struct device_node *node = of_node_get(np);
++      struct device_node *node;
+       if (IS_ENABLED(CONFIG_OF_DMA_DEFAULT_COHERENT))
+               return true;
++      node = of_node_get(np);
++
+       while (node) {
+               if (of_property_read_bool(node, "dma-coherent")) {
+                       of_node_put(node);
+-- 
+2.27.0
+
diff --git a/queue-4.4/perf-fix-get_recursion_context.patch b/queue-4.4/perf-fix-get_recursion_context.patch
new file mode 100644 (file)
index 0000000..f4f3005
--- /dev/null
@@ -0,0 +1,35 @@
+From 455aea3ea3e9b2961978f1128ad8ee209bc11957 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 30 Oct 2020 12:49:45 +0100
+Subject: perf: Fix get_recursion_context()
+
+From: Peter Zijlstra <peterz@infradead.org>
+
+[ Upstream commit ce0f17fc93f63ee91428af10b7b2ddef38cd19e5 ]
+
+One should use in_serving_softirq() to detect SoftIRQ context.
+
+Fixes: 96f6d4444302 ("perf_counter: avoid recursion")
+Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
+Link: https://lkml.kernel.org/r/20201030151955.120572175@infradead.org
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ kernel/events/internal.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/kernel/events/internal.h b/kernel/events/internal.h
+index 2bbad9c1274c3..8baa3121e7a6b 100644
+--- a/kernel/events/internal.h
++++ b/kernel/events/internal.h
+@@ -193,7 +193,7 @@ static inline int get_recursion_context(int *recursion)
+               rctx = 3;
+       else if (in_irq())
+               rctx = 2;
+-      else if (in_softirq())
++      else if (in_serving_softirq())
+               rctx = 1;
+       else
+               rctx = 0;
+-- 
+2.27.0
+
index 0786a2bf97c786fcd1104f6332151c9fd71de27f..7fdd81f483a631ddfc2d5686d17393d4d0fe5e9b 100644 (file)
@@ -25,3 +25,7 @@ mac80211-fix-use-of-skb-payload-instead-of-header.patch
 mac80211-always-wind-down-sta-state.patch
 cfg80211-regulatory-fix-inconsistent-format-argument.patch
 iommu-amd-increase-interrupt-remapping-table-limit-t.patch
+xfs-fix-a-missing-unlock-on-error-in-xfs_fs_map_bloc.patch
+of-address-fix-of_node-memory-leak-in-of_dma_is_cohe.patch
+cosa-add-missing-kfree-in-error-path-of-cosa_write.patch
+perf-fix-get_recursion_context.patch
diff --git a/queue-4.4/xfs-fix-a-missing-unlock-on-error-in-xfs_fs_map_bloc.patch b/queue-4.4/xfs-fix-a-missing-unlock-on-error-in-xfs_fs_map_bloc.patch
new file mode 100644 (file)
index 0000000..a5827db
--- /dev/null
@@ -0,0 +1,37 @@
+From 190d001b198ae93e00dc7682819e884f0b7d36f8 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 11 Nov 2020 08:07:37 -0800
+Subject: xfs: fix a missing unlock on error in xfs_fs_map_blocks
+
+From: Christoph Hellwig <hch@lst.de>
+
+[ Upstream commit 2bd3fa793aaa7e98b74e3653fdcc72fa753913b5 ]
+
+We also need to drop the iolock when invalidate_inode_pages2 fails, not
+only on all other error or successful cases.
+
+Fixes: 527851124d10 ("xfs: implement pNFS export operations")
+Signed-off-by: Christoph Hellwig <hch@lst.de>
+Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
+Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ fs/xfs/xfs_pnfs.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/fs/xfs/xfs_pnfs.c b/fs/xfs/xfs_pnfs.c
+index dc6221942b85f..ab66ea0a72bfb 100644
+--- a/fs/xfs/xfs_pnfs.c
++++ b/fs/xfs/xfs_pnfs.c
+@@ -162,7 +162,7 @@ xfs_fs_map_blocks(
+               goto out_unlock;
+       error = invalidate_inode_pages2(inode->i_mapping);
+       if (WARN_ON_ONCE(error))
+-              return error;
++              goto out_unlock;
+       end_fsb = XFS_B_TO_FSB(mp, (xfs_ufsize_t)offset + length);
+       offset_fsb = XFS_B_TO_FSBT(mp, offset);
+-- 
+2.27.0
+