]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.6-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 Apr 2020 07:12:44 +0000 (09:12 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 Apr 2020 07:12:44 +0000 (09:12 +0200)
added patches:
ubifs-fix-ubifs_tnc_lookup-usage-in-do_kill_orphans.patch

queue-5.6/series [new file with mode: 0644]
queue-5.6/ubifs-fix-ubifs_tnc_lookup-usage-in-do_kill_orphans.patch [new file with mode: 0644]

diff --git a/queue-5.6/series b/queue-5.6/series
new file mode 100644 (file)
index 0000000..45114f3
--- /dev/null
@@ -0,0 +1 @@
+ubifs-fix-ubifs_tnc_lookup-usage-in-do_kill_orphans.patch
diff --git a/queue-5.6/ubifs-fix-ubifs_tnc_lookup-usage-in-do_kill_orphans.patch b/queue-5.6/ubifs-fix-ubifs_tnc_lookup-usage-in-do_kill_orphans.patch
new file mode 100644 (file)
index 0000000..bdfad01
--- /dev/null
@@ -0,0 +1,47 @@
+From 4ab25ac8b2b5514151d5f91cf9514df08dd26938 Mon Sep 17 00:00:00 2001
+From: Richard Weinberger <richard@nod.at>
+Date: Sun, 19 Jan 2020 22:52:33 +0100
+Subject: ubifs: Fix ubifs_tnc_lookup() usage in do_kill_orphans()
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Richard Weinberger <richard@nod.at>
+
+commit 4ab25ac8b2b5514151d5f91cf9514df08dd26938 upstream.
+
+Orphans are allowed to point to deleted inodes.
+So -ENOENT is not a fatal error.
+
+Reported-by: Кочетков Максим <fido_max@inbox.ru>
+Reported-and-tested-by: "Christian Berger" <Christian.Berger@de.bosch.com>
+Tested-by: Karl Olsen <karl@micro-technic.com>
+Tested-by: Jef Driesen <jef.driesen@niko.eu>
+Fixes: ee1438ce5dc4 ("ubifs: Check link count of inodes when killing orphans.")
+Signed-off-by: Richard Weinberger <richard@nod.at>
+Cc: Christian Eggers <ceggers@arri.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/ubifs/orphan.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/fs/ubifs/orphan.c
++++ b/fs/ubifs/orphan.c
+@@ -688,14 +688,14 @@ static int do_kill_orphans(struct ubifs_
+                       ino_key_init(c, &key1, inum);
+                       err = ubifs_tnc_lookup(c, &key1, ino);
+-                      if (err)
++                      if (err && err != -ENOENT)
+                               goto out_free;
+                       /*
+                        * Check whether an inode can really get deleted.
+                        * linkat() with O_TMPFILE allows rebirth of an inode.
+                        */
+-                      if (ino->nlink == 0) {
++                      if (err == 0 && ino->nlink == 0) {
+                               dbg_rcvry("deleting orphaned inode %lu",
+                                         (unsigned long)inum);