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  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]
Date:   Wed,  8 Sep 2021 15:06:40 +0800
From:   Chenyuan Mi <>
To:     unlisted-recipients:; (no To-header on input)
Cc:, Chenyuan Mi <>,
        Xiyu Yang <>,
        Xin Tan <>,
        "Theodore Ts'o" <>,
        Andreas Dilger <>,,
Subject: [PATCH] ext4: Fix handle refcount leak in ext4_write_begin()

The reference counting issue happens when ret is zero,
the function forgets to decrease the refcount of handle
increased by ext4_journal_start().

Fix this issue by using ext4_journal_stop() to decrease
the refcount of handle.

Signed-off-by: Chenyuan Mi <>
Signed-off-by: Xiyu Yang <>
Signed-off-by: Xin Tan <>
 fs/ext4/inode.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index d18852d6029c..90c57d8e3de1 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -1249,6 +1249,7 @@ static int ext4_write_begin(struct file *file, struct address_space *mapping,
 		return ret;
+	ext4_journal_stop(handle);
 	*pagep = page;
 	return ret;

Powered by blists - more mailing lists