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>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230412111508.892296-1-p.raghav@samsung.com>
Date:   Wed, 12 Apr 2023 13:15:08 +0200
From:   Pankaj Raghav <p.raghav@...sung.com>
To:     <jan.kiszka@...mens.com>, <kbingham@...nel.org>
CC:     <gost.dev@...sung.com>, <linux-kernel@...r.kernel.org>,
        <song@...nel.org>, <mcgrof@...nel.org>, <p.raghav@...sung.com>
Subject: [PATCH] scripts/gdb: use mem instead of core_layout to get the
 module address

commit ac3b43283923 ("module: replace module_layout with module_memory")
changed the struct module data structure from module_layout to
module_memory. The core_layout member which is used while loading
modules are not available anymore leading to the following error while
running gdb:

(gdb) lx-symbols
loading vmlinux
Python Exception <class 'gdb.error'>: There is no member named core_layout.
Error occurred in Python: There is no member named core_layout.

Replace core_layout with its new counterpart mem[MOD_TEXT].

Fixes: ac3b43283923 ("module: replace module_layout with module_memory")
Signed-off-by: Pankaj Raghav <p.raghav@...sung.com>
---
 scripts/gdb/linux/modules.py | 2 +-
 scripts/gdb/linux/symbols.py | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/gdb/linux/modules.py b/scripts/gdb/linux/modules.py
index 441b23239896..6ec51e913070 100644
--- a/scripts/gdb/linux/modules.py
+++ b/scripts/gdb/linux/modules.py
@@ -73,7 +73,7 @@ class LxLsmod(gdb.Command):
                 "        " if utils.get_long_type().sizeof == 8 else ""))
 
         for module in module_list():
-            layout = module['core_layout']
+            layout = module['mem'][0]
             gdb.write("{address} {name:<19} {size:>8}  {ref}".format(
                 address=str(layout['base']).split()[0],
                 name=module['name'].string(),
diff --git a/scripts/gdb/linux/symbols.py b/scripts/gdb/linux/symbols.py
index dc07b6d12e30..3a7976401e00 100644
--- a/scripts/gdb/linux/symbols.py
+++ b/scripts/gdb/linux/symbols.py
@@ -109,7 +109,7 @@ lx-symbols command."""
 
     def load_module_symbols(self, module):
         module_name = module['name'].string()
-        module_addr = str(module['core_layout']['base']).split()[0]
+        module_addr = str(module['mem'][0]['base']).split()[0]
 
         module_file = self._get_module_file(module_name)
         if not module_file and not self.module_files_updated:
-- 
2.39.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ