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>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240906221208.136692-1-ghanshyam1898@gmail.com>
Date: Sat,  7 Sep 2024 03:42:08 +0530
From: Ghanshyam Agrawal <ghanshyam1898@...il.com>
To: mark@...heh.com,
	jlbec@...lplan.org,
	joseph.qi@...ux.alibaba.com
Cc: Ghanshyam Agrawal <ghanshyam1898@...il.com>,
	ocfs2-devel@...ts.linux.dev,
	linux-kernel@...r.kernel.org,
	syzbot+adfd64e93c46b99c957e@...kaller.appspotmail.com
Subject: [PATCH] ocfs2: bug fix when bh is null

Reported-by: syzbot+adfd64e93c46b99c957e@...kaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=adfd64e93c46b99c957e
Signed-off-by: Ghanshyam Agrawal <ghanshyam1898@...il.com>
---
 fs/ocfs2/buffer_head_io.c | 1 -
 fs/ocfs2/uptodate.c       | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/ocfs2/buffer_head_io.c b/fs/ocfs2/buffer_head_io.c
index cdb9b9bdea1f..e62c7e1de4eb 100644
--- a/fs/ocfs2/buffer_head_io.c
+++ b/fs/ocfs2/buffer_head_io.c
@@ -235,7 +235,6 @@ int ocfs2_read_blocks(struct ocfs2_caching_info *ci, u64 block, int nr,
 		if (bhs[i] == NULL) {
 			bhs[i] = sb_getblk(sb, block++);
 			if (bhs[i] == NULL) {
-				ocfs2_metadata_cache_io_unlock(ci);
 				status = -ENOMEM;
 				mlog_errno(status);
 				/* Don't forget to put previous bh! */
diff --git a/fs/ocfs2/uptodate.c b/fs/ocfs2/uptodate.c
index 09854925fa5c..3242291402c3 100644
--- a/fs/ocfs2/uptodate.c
+++ b/fs/ocfs2/uptodate.c
@@ -471,7 +471,7 @@ void ocfs2_set_buffer_uptodate(struct ocfs2_caching_info *ci,
 
 	/* The block may very well exist in our cache already, so avoid
 	 * doing any more work in that case. */
-	if (ocfs2_buffer_cached(ci, bh))
+	if (bh == NULL || ocfs2_buffer_cached(ci, bh))
 		return;
 
 	trace_ocfs2_set_buffer_uptodate_begin(
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ