]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.18-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Aug 2018 16:54:20 +0000 (09:54 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Aug 2018 16:54:20 +0000 (09:54 -0700)
added patches:
btrfs-don-t-leak-ret-from-do_chunk_alloc.patch

queue-3.18/btrfs-don-t-leak-ret-from-do_chunk_alloc.patch [new file with mode: 0644]
queue-3.18/series

diff --git a/queue-3.18/btrfs-don-t-leak-ret-from-do_chunk_alloc.patch b/queue-3.18/btrfs-don-t-leak-ret-from-do_chunk_alloc.patch
new file mode 100644 (file)
index 0000000..91f077c
--- /dev/null
@@ -0,0 +1,35 @@
+From 4559b0a71749c442d34f7cfb9e72c9e58db83948 Mon Sep 17 00:00:00 2001
+From: Josef Bacik <josef@toxicpanda.com>
+Date: Thu, 19 Jul 2018 10:49:51 -0400
+Subject: btrfs: don't leak ret from do_chunk_alloc
+
+From: Josef Bacik <josef@toxicpanda.com>
+
+commit 4559b0a71749c442d34f7cfb9e72c9e58db83948 upstream.
+
+If we're trying to make a data reservation and we have to allocate a
+data chunk we could leak ret == 1, as do_chunk_alloc() will return 1 if
+it allocated a chunk.  Since the end of the function is the success path
+just return 0.
+
+CC: stable@vger.kernel.org # 4.4+
+Signed-off-by: Josef Bacik <josef@toxicpanda.com>
+Reviewed-by: Nikolay Borisov <nborisov@suse.com>
+Signed-off-by: David Sterba <dsterba@suse.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/btrfs/extent-tree.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/fs/btrfs/extent-tree.c
++++ b/fs/btrfs/extent-tree.c
+@@ -4281,7 +4281,7 @@ static int flush_space(struct btrfs_root
+               break;
+       }
+-      return ret;
++      return 0;
+ }
+ static inline u64
index 686613519f722f1d6b39dfb1ae0af1d7fa7ab9d3..249978fea3bb524a9e5a53993532aa9037903a6b 100644 (file)
@@ -33,3 +33,4 @@ drivers-net-lmc-fix-case-value-for-target-abort-error.patch
 scsi-fcoe-drop-frames-in-els-logo-error-path.patch
 scsi-vmw_pvscsi-return-did_reset-for-status-sam_stat_command_terminated.patch
 mm-memory.c-check-return-value-of-ioremap_prot.patch
+btrfs-don-t-leak-ret-from-do_chunk_alloc.patch