lkml.org 
[lkml]   [2020]   [Nov]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH RFC 07/10] x86/unwind: Unwind orc at module writable address
Date
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@intel.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
\
 
 \ /
  Last update: 2020-11-20 21:39    [W:0.261 / U:0.468 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site