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]
Date:   Wed, 10 Jun 2020 21:43:35 +0800
From:   Yang Yingliang <yangyingliang@...wei.com>
To:     <linux-fsdevel@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <slava@...eyko.com>
CC:     <yangyingliang@...wei.com>
Subject: [PATCH] hfsplus: fix null-ptr-deref in hfs_find_init()

It may lead a null-ptr-deref in hfs_find_init() by
mounting a crafted hfs filesystem. So We need check
tree in hfs_find_init().

Signed-off-by: Yang Yingliang <yangyingliang@...wei.com>
---
 fs/hfsplus/bfind.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/hfsplus/bfind.c b/fs/hfsplus/bfind.c
index ca2ba8c..85bef3e 100644
--- a/fs/hfsplus/bfind.c
+++ b/fs/hfsplus/bfind.c
@@ -16,6 +16,9 @@ int hfs_find_init(struct hfs_btree *tree, struct hfs_find_data *fd)
 {
 	void *ptr;
 
+	if (!tree)
+		return -EINVAL;
+
 	fd->tree = tree;
 	fd->bnode = NULL;
 	ptr = kmalloc(tree->max_key_len * 2 + 4, GFP_KERNEL);
-- 
1.8.3

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ