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  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 20 Nov 2020 12:24:23 -0800
From:   Rick Edgecombe <rick.p.edgecombe@...el.com>
To:     akpm@...ux-foundation.org, jeyu@...nel.org, bpf@...r.kernel.org,
        ast@...nel.org, daniel@...earbox.net, luto@...nel.org,
        dave.hansen@...ux.intel.com, peterz@...radead.org, x86@...nel.org,
        rppt@...nel.org, linux-mm@...ck.org, linux-kernel@...r.kernel.org,
        dan.j.williams@...el.com
Cc:     elena.reshetova@...el.com, ira.weiny@...el.com,
        Rick Edgecombe <rick.p.edgecombe@...el.com>
Subject: [PATCH RFC 07/10] x86/unwind: Unwind orc at module writable address

Since modules can have a separate writable address during loading,
do the orc unwind at the writable address.

Signed-off-by: Rick Edgecombe <rick.p.edgecombe@...el.com>
---
 arch/x86/kernel/unwind_orc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/x86/kernel/unwind_orc.c b/arch/x86/kernel/unwind_orc.c
index 73f800100066..41f9022a10cc 100644
--- a/arch/x86/kernel/unwind_orc.c
+++ b/arch/x86/kernel/unwind_orc.c
@@ -238,8 +238,8 @@ static int orc_sort_cmp(const void *_a, const void *_b)
 void unwind_module_init(struct module *mod, void *_orc_ip, size_t orc_ip_size,
 			void *_orc, size_t orc_size)
 {
-	int *orc_ip = _orc_ip;
-	struct orc_entry *orc = _orc;
+	int *orc_ip = module_adjust_writable_addr(_orc_ip);
+	struct orc_entry *orc = module_adjust_writable_addr(_orc);
 	unsigned int num_entries = orc_ip_size / sizeof(int);
 
 	WARN_ON_ONCE(orc_ip_size % sizeof(int) != 0 ||
@@ -257,8 +257,8 @@ void unwind_module_init(struct module *mod, void *_orc_ip, size_t orc_ip_size,
 	sort(orc_ip, num_entries, sizeof(int), orc_sort_cmp, orc_sort_swap);
 	mutex_unlock(&sort_mutex);
 
-	mod->arch.orc_unwind_ip = orc_ip;
-	mod->arch.orc_unwind = orc;
+	mod->arch.orc_unwind_ip = _orc_ip;
+	mod->arch.orc_unwind = _orc;
 	mod->arch.num_orcs = num_entries;
 }
 #endif
-- 
2.20.1

Powered by blists - more mailing lists