|
10 | 10 |
|
11 | 11 | import volatility3.framework.symbols.linux.utilities.modules as linux_utilities_modules
|
12 | 12 | from volatility3.plugins.linux import hidden_modules, modxview
|
13 |
| -from volatility3.framework import constants, exceptions, interfaces |
| 13 | +from volatility3.framework import constants, exceptions, interfaces, renderers |
14 | 14 | from volatility3.framework.configuration import requirements
|
15 | 15 | from volatility3.framework.renderers import format_hints, NotAvailableValue, TreeGrid
|
16 | 16 | from volatility3.framework.symbols.linux import extensions
|
@@ -116,18 +116,25 @@ def parse_tracepoint(
|
116 | 116 | known_modules: A dict of known modules, used to locate callbacks origin. Typically obtained through modxview.run_modules_scanners().
|
117 | 117 | tracepoint: The tracepoint struct to parse
|
118 | 118 | run_hidden_modules: Whether to run the hidden_modules plugin or not. Note: it won't be run, even if specified, \
|
119 |
| -if the "hidden_modules" key is present in known_modules. |
| 119 | + if the "hidden_modules" key is present in known_modules. |
120 | 120 |
|
121 | 121 | Yields:
|
122 | 122 | An iterable of ParsedTracepointFunc dataclasses, containing a selection of useful fields related to a tracepoint struct
|
123 | 123 | """
|
124 |
| - |
125 | 124 | kernel = context.modules[kernel_name]
|
126 | 125 | kernel_layer = context.layers[kernel.layer_name]
|
127 | 126 |
|
128 | 127 | for tracepoint_func in cls.iterate_tracepoint_funcs(
|
129 | 128 | context, kernel_layer.name, tracepoint
|
130 | 129 | ):
|
| 130 | + try: |
| 131 | + tracepoint_name = utility.pointer_to_string(tracepoint.name, count=512) |
| 132 | + except exceptions.InvalidAddressException: |
| 133 | + vollog.debug( |
| 134 | + f"Tracepoint function at {tracepoint.vol.offset:#x} is smeared." |
| 135 | + ) |
| 136 | + continue |
| 137 | + |
131 | 138 | probe_handler_address = tracepoint_func.func
|
132 | 139 | probe_handler_symbol = module_address = module_name = None
|
133 | 140 |
|
@@ -183,16 +190,21 @@ def parse_tracepoint(
|
183 | 190 | probe_handler_address
|
184 | 191 | )
|
185 | 192 | else:
|
186 |
| - vollog.warning( |
| 193 | + vollog.debug( |
187 | 194 | f"Could not determine tracepoint@{tracepoint.vol.offset:#x} probe handler {probe_handler_address:#x} module origin.",
|
188 | 195 | )
|
189 | 196 |
|
| 197 | + if hasattr(tracepoint_func, "prio"): |
| 198 | + prio = tracepoint_func.prio |
| 199 | + else: |
| 200 | + prio = renderers.NotAvailableValue() |
| 201 | + |
190 | 202 | yield ParsedTracepointFunc(
|
191 |
| - utility.pointer_to_string(tracepoint.name, count=512), |
| 203 | + tracepoint_name, |
192 | 204 | tracepoint.vol.offset,
|
193 | 205 | probe_handler_symbol,
|
194 | 206 | probe_handler_address,
|
195 |
| - tracepoint_func.prio, |
| 207 | + prio, |
196 | 208 | module_name,
|
197 | 209 | module_address,
|
198 | 210 | )
|
@@ -258,11 +270,11 @@ def _generator(self):
|
258 | 270 | kernel_layer = self.context.layers[kernel.layer_name]
|
259 | 271 |
|
260 | 272 | if not kernel.has_symbol("__start___tracepoints_ptrs"):
|
261 |
| - raise exceptions.SymbolError( |
262 |
| - "__start___tracepoints_ptrs", |
263 |
| - self.vmlinux.symbol_table_name, |
264 |
| - 'The provided symbol table does not include the "__start___tracepoints_ptrs" symbol. This means you are either analyzing an unsupported kernel version or that your symbol table is corrupted.', |
| 273 | + vollog.error( |
| 274 | + 'The provided symbol table does not include the "__start___tracepoints_ptrs" symbol.' |
| 275 | + "This means you are either analyzing an unsupported kernel version or that your symbol table is corrupted." |
265 | 276 | )
|
| 277 | + return |
266 | 278 |
|
267 | 279 | known_modules = modxview.Modxview.run_modules_scanners(
|
268 | 280 | self.context, kernel_name, run_hidden_modules=False
|
|
0 commit comments