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: <20230112070503.817076-1-korantwork@gmail.com>
Date:   Thu, 12 Jan 2023 15:05:03 +0800
From:   korantwork@...il.com
To:     ardb@...nel.org, sudeep.holla@....com, cristian.marussi@....com
Cc:     linux-kernel@...r.kernel.org, Xinghui Li <korantli@...cent.com>,
        loydlv <loydlv@...cent.com>
Subject: [PATCH] firmware: fix one UAF issue

From: Xinghui Li <korantli@...cent.com>

There could be the use after free issue in dmi_sysfs_register_handle.
During handling specializations process, the entry->child could be
free if the error occurs. However, it will be kobject_put after free.
So, we set the entry->child to NULL to avoid above case.

Reported-by: loydlv <loydlv@...cent.com>
Signed-off-by: Xinghui Li <korantli@...cent.com>
---
 drivers/firmware/dmi-sysfs.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/firmware/dmi-sysfs.c b/drivers/firmware/dmi-sysfs.c
index 66727ad3361b..dd4ff5f7e200 100644
--- a/drivers/firmware/dmi-sysfs.c
+++ b/drivers/firmware/dmi-sysfs.c
@@ -470,6 +470,7 @@ static int dmi_system_event_log(struct dmi_sysfs_entry *entry)
 	kobject_del(entry->child);
 out_free:
 	kfree(entry->child);
+	entry->child = NULL;
 	return ret;
 }
 
-- 
2.31.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ