[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200116231758.872830984@linuxfoundation.org>
Date: Fri, 17 Jan 2020 00:17:59 +0100
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Wenwen Wang <wenwen@...uga.edu>,
Richard Weinberger <richard@....at>,
Romain Izard <romain.izard.pro@...il.com>
Subject: [PATCH 5.4 162/203] Revert "ubifs: Fix memory leak bug in alloc_ubifs_info() error path"
From: Richard Weinberger <richard@....at>
commit 91cbf01178c37086b32148c53e24b04cb77557cf upstream.
This reverts commit 9163e0184bd7d5f779934d34581843f699ad2ffd.
At the point when ubifs_fill_super() runs, we have already a reference
to the super block. So upon deactivate_locked_super() c will get
free()'ed via ->kill_sb().
Cc: Wenwen Wang <wenwen@...uga.edu>
Fixes: 9163e0184bd7 ("ubifs: Fix memory leak bug in alloc_ubifs_info() error path")
Reported-by: https://twitter.com/grsecurity/status/1180609139359277056
Signed-off-by: Richard Weinberger <richard@....at>
Tested-by: Romain Izard <romain.izard.pro@...il.com>
Signed-off-by: Richard Weinberger <richard@....at>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
fs/ubifs/super.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
--- a/fs/ubifs/super.c
+++ b/fs/ubifs/super.c
@@ -2267,10 +2267,8 @@ static struct dentry *ubifs_mount(struct
}
} else {
err = ubifs_fill_super(sb, data, flags & SB_SILENT ? 1 : 0);
- if (err) {
- kfree(c);
+ if (err)
goto out_deact;
- }
/* We do not support atime */
sb->s_flags |= SB_ACTIVE;
if (IS_ENABLED(CONFIG_UBIFS_ATIME_SUPPORT))
Powered by blists - more mailing lists