There is a bug of not supporting randomized kernel address, this patch fix it.

Signed-off-by: Tao Liu <l...@redhat.com>
---
 erase_info.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/erase_info.c b/erase_info.c
index af6bfae..b67d1d0 100644
--- a/erase_info.c
+++ b/erase_info.c
@@ -1881,7 +1881,7 @@ get_symbol_addr_all(char *name) {
        if (!strcmp(get_dwarf_module_name(), "vmlinux")) {
                symbol_addr = get_symbol_addr(name);
                if (symbol_addr)
-                       return symbol_addr;
+                       return symbol_addr + info->kaslr_offset;
 
                vmlinux_searched = 1;
        }
@@ -1942,9 +1942,9 @@ get_symbol_addr_all(char *name) {
         * this function is called with debuginfo set to a particular
         * kernel module and we are looking for symbol in vmlinux
         */
-       if (!vmlinux_searched)
-               return get_symbol_addr(name);
-       else
+       if (!vmlinux_searched && !!(symbol_addr = get_symbol_addr(name))) {
+               return symbol_addr + info->kaslr_offset;
+       } else
                return NOT_FOUND_SYMBOL;
 }
 
-- 
2.47.0
--
Crash-utility mailing list -- devel@lists.crash-utility.osci.io
To unsubscribe send an email to devel-le...@lists.crash-utility.osci.io
https://${domain_name}/admin/lists/devel.lists.crash-utility.osci.io/
Contribution Guidelines: https://github.com/crash-utility/crash/wiki

Reply via email to