diff options
author | Steven Rostedt <rostedt@goodmis.org> | 2025-05-01 15:19:09 -0400 |
---|---|---|
committer | Steven Rostedt (Google) <rostedt@goodmis.org> | 2025-05-01 16:06:55 -0400 |
commit | 1be8e54a1e0f0a4bf70e3d65f94ca1738ee4f1f3 (patch) | |
tree | aaa816ac1acc6f62d6092cb60a92d357cc834fbc /rust/helpers/io.c | |
parent | 3c1d9cfa8458a4d6b6cd9bc3ca7bb1591130a31c (diff) | |
download | linux-1be8e54a1e0f0a4bf70e3d65f94ca1738ee4f1f3.tar.gz linux-1be8e54a1e0f0a4bf70e3d65f94ca1738ee4f1f3.tar.bz2 linux-1be8e54a1e0f0a4bf70e3d65f94ca1738ee4f1f3.zip |
tracing: Fix trace_adjust_address() when there is no modules in scratch area
The function trace_adjust_address() is used to map addresses of modules
stored in the persistent memory and are also loaded in the current boot to
return the current address for the module.
If there's only one module entry, it will simply use that, otherwise it
performs a bsearch of the entry array to find the modules to offset with.
The issue is if there are no modules in the array. The code does not
account for that and ends up referencing the first element in the array
which does not exist and causes a crash.
If nr_entries is zero, exit out early as if this was a core kernel
address.
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Link: https://lore.kernel.org/20250501151909.65910359@gandalf.local.home
Fixes: 35a380ddbc653 ("tracing: Show last module text symbols in the stacktrace")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Diffstat (limited to 'rust/helpers/io.c')
0 files changed, 0 insertions, 0 deletions