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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230102145833.2758-1-syoshida@redhat.com>
Date:   Mon,  2 Jan 2023 14:58:33 +0000
From:   Shigeru Yoshida <syoshida@...hat.com>
To:     tytso@....edu, adilger.kernel@...ger.ca
Cc:     linux-ext4@...r.kernel.org, linux-kernel@...r.kernel.org,
        Shigeru Yoshida <syoshida@...hat.com>,
        syzbot+bf4bb7731ef73b83a3b4@...kaller.appspotmail.com
Subject: [PATCH] ext4: Verify extent header in ext4_find_extent()

syzbot reported use-after-free in ext4_find_extent() [1].  If there is
a corrupted file system, this can cause invalid memory access.

This patch fixes the issue by verifying extent header.

Reported-by: syzbot+bf4bb7731ef73b83a3b4@...kaller.appspotmail.com
Link: https://syzkaller.appspot.com/bug?id=cd95cb722bfa1234ac4c78345c8953ee2e7170d0 [1]
Signed-off-by: Shigeru Yoshida <syoshida@...hat.com>
---
 fs/ext4/extents.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 9de1c9d1a13d..79bfa583ab1d 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -901,6 +901,9 @@ ext4_find_extent(struct inode *inode, ext4_lblk_t block,
 		ret = -EFSCORRUPTED;
 		goto err;
 	}
+	ret = ext4_ext_check(inode, eh, depth, 0);
+	if (ret)
+		goto err;
 
 	if (path) {
 		ext4_ext_drop_refs(path);
-- 
2.38.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ