]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.19-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Jan 2023 07:08:57 +0000 (08:08 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Jan 2023 07:08:57 +0000 (08:08 +0100)
added patches:
fs-reiserfs-remove-useless-new_opts-in-reiserfs_remount.patch

queue-4.19/fs-reiserfs-remove-useless-new_opts-in-reiserfs_remount.patch [new file with mode: 0644]
queue-4.19/series

diff --git a/queue-4.19/fs-reiserfs-remove-useless-new_opts-in-reiserfs_remount.patch b/queue-4.19/fs-reiserfs-remove-useless-new_opts-in-reiserfs_remount.patch
new file mode 100644 (file)
index 0000000..e3e957a
--- /dev/null
@@ -0,0 +1,56 @@
+From 81dedaf10c20959bdf5624f9783f408df26ba7a4 Mon Sep 17 00:00:00 2001
+From: Dongliang Mu <mudongliangabcd@gmail.com>
+Date: Wed, 27 Oct 2021 22:34:41 +0800
+Subject: fs: reiserfs: remove useless new_opts in reiserfs_remount
+
+From: Dongliang Mu <mudongliangabcd@gmail.com>
+
+commit 81dedaf10c20959bdf5624f9783f408df26ba7a4 upstream.
+
+Since the commit c3d98ea08291 ("VFS: Don't use save/replace_mount_options
+if not using generic_show_options") eliminates replace_mount_options
+in reiserfs_remount, but does not handle the allocated new_opts,
+it will cause memory leak in the reiserfs_remount.
+
+Because new_opts is useless in reiserfs_mount, so we fix this bug by
+removing the useless new_opts in reiserfs_remount.
+
+Fixes: c3d98ea08291 ("VFS: Don't use save/replace_mount_options if not using generic_show_options")
+Link: https://lore.kernel.org/r/20211027143445.4156459-1-mudongliangabcd@gmail.com
+Signed-off-by: Dongliang Mu <mudongliangabcd@gmail.com>
+Signed-off-by: Jan Kara <jack@suse.cz>
+Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ fs/reiserfs/super.c |    6 ------
+ 1 file changed, 6 deletions(-)
+
+--- a/fs/reiserfs/super.c
++++ b/fs/reiserfs/super.c
+@@ -1443,7 +1443,6 @@ static int reiserfs_remount(struct super
+       unsigned long safe_mask = 0;
+       unsigned int commit_max_age = (unsigned int)-1;
+       struct reiserfs_journal *journal = SB_JOURNAL(s);
+-      char *new_opts;
+       int err;
+       char *qf_names[REISERFS_MAXQUOTAS];
+       unsigned int qfmt = 0;
+@@ -1451,10 +1450,6 @@ static int reiserfs_remount(struct super
+       int i;
+ #endif
+-      new_opts = kstrdup(arg, GFP_KERNEL);
+-      if (arg && !new_opts)
+-              return -ENOMEM;
+-
+       sync_filesystem(s);
+       reiserfs_write_lock(s);
+@@ -1605,7 +1600,6 @@ out_ok_unlocked:
+ out_err_unlock:
+       reiserfs_write_unlock(s);
+ out_err:
+-      kfree(new_opts);
+       return err;
+ }
index e1c8b664cba8d710f0471259c62355b5d530a071..127cecdf3c92c7215d42309563f11af624c13126 100644 (file)
@@ -37,3 +37,4 @@ mmc-sdhci-esdhc-imx-correct-the-tuning-start-tap-and.patch
 netfilter-conntrack-do-not-renew-entry-stuck-in-tcp-.patch
 block-fix-and-cleanup-bio_check_ro.patch
 perf-env-do-not-return-pointers-to-local-variables.patch
+fs-reiserfs-remove-useless-new_opts-in-reiserfs_remount.patch