lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20260205135318.5346-1-wangqing7171@gmail.com>
Date: Thu,  5 Feb 2026 21:53:18 +0800
From: Qing Wong <wangqing7171@...il.com>
To: Andreas Gruenbacher <agruenba@...hat.com>,
	Bob Peterson <rpeterso@...hat.com>
Cc: gfs2@...ts.linux.dev,
	linux-kernel@...r.kernel.org,
	Qing Wang <wangqing7171@...il.com>,
	syzbot+e57495fb65020ac7bca4@...kaller.appspotmail.com
Subject: [PATCH] gfs2: Fix memory leak in gfs2_make_fs_rw()

From: Qing Wang <wangqing7171@...il.com>

If gfs2_quota_init() success and filesystem is withdrawn, need to cleanup
by gfs2_quota_cleanup() to avoid memory leak.

Reported-by: syzbot+e57495fb65020ac7bca4@...kaller.appspotmail.com
Closes: https://syzbot.org/bug?extid=e57495fb65020ac7bca4
Tested-by: syzbot+e57495fb65020ac7bca4@...kaller.appspotmail.com
Fixes: 601ef0d52e96 ("gfs2: Force withdraw to replay journals and wait for it to finish")
Signed-off-by: Qing Wang <wangqing7171@...il.com>
---
 fs/gfs2/super.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c
index f6cd907b3ec6..efa0e2452bc7 100644
--- a/fs/gfs2/super.c
+++ b/fs/gfs2/super.c
@@ -147,8 +147,10 @@ int gfs2_make_fs_rw(struct gfs2_sbd *sdp)
 	}
 
 	error = gfs2_quota_init(sdp);
-	if (!error && gfs2_withdrawn(sdp))
-		error = -EIO;
+	if (!error && gfs2_withdrawn(sdp)) {
+		gfs2_quota_cleanup(sdp);
+		return -EIO;
+	}
 	if (!error)
 		set_bit(SDF_JOURNAL_LIVE, &sdp->sd_flags);
 	return error;
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ