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: <1565076756-71682-1-git-send-email-chenzefeng2@huawei.com>
Date:   Tue, 6 Aug 2019 15:32:36 +0800
From:   chenzefeng <chenzefeng2@...wei.com>
To:     <linux@...linux.org.uk>, <kstewart@...uxfoundation.org>,
        <tglx@...utronix.de>, <allison@...utok.net>, <jeyu@...nel.org>,
        <gregkh@...uxfoundation.org>, <matthias.schiffer@...tq-group.com>
CC:     <linux-arm-kernel@...ts.infradead.org>,
        <linux-kernel@...r.kernel.org>, <stable@...r.kernel.org>,
        <chenzefeng2@...wei.com>, <nixiaoming@...wei.com>
Subject: [PATCH] arm:unwind: fix backtrace error with unwind_table

For arm, when load_module success, the mod->init_layout.base would
be free in function do_free_init, but do not remove it's unwind table
from the unwind_tables' list. And later the above mod->init_layout.base
would alloc for another module's text section, and add to the
unwind_tables which cause one address can found more than two unwind table
in the unwind_tables' list, therefore may get to errror unwind table to
backtrace, and get an error backtrace.

Signed-off-by: chenzefeng <chenzefeng2@...wei.com>
---
 arch/arm/kernel/module.c | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/arch/arm/kernel/module.c b/arch/arm/kernel/module.c
index deef17f..a4eb5f4 100644
--- a/arch/arm/kernel/module.c
+++ b/arch/arm/kernel/module.c
@@ -403,14 +403,24 @@ int module_finalize(const Elf32_Ehdr *hdr, const Elf_Shdr *sechdrs,
 	return 0;
 }
 
-void
-module_arch_cleanup(struct module *mod)
-{
+
 #ifdef CONFIG_ARM_UNWIND
+void module_arch_cleanup(struct module *mod)
+{
 	int i;
 
 	for (i = 0; i < ARM_SEC_MAX; i++)
-		if (mod->arch.unwind[i])
+		if (mod->arch.unwind[i]) {
 			unwind_table_del(mod->arch.unwind[i]);
-#endif
+			mod->arch.unwind[i] = NULL;
+		}
 }
+
+void module_arch_freeing_init(struct module *mod)
+{
+	if (mod->arch.unwind[ARM_SEC_INIT]) {
+		unwind_table_del(mod->arch.unwind[ARM_SEC_INIT]);
+		mod->arch.unwind[ARM_SEC_INIT] = NULL;
+	}
+}
+#endif
-- 
1.8.5.6

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ