drgn/libdrgn
Omar Sandoval 2c612ea97f libdrgn: fix address of global per-CPU variables with KASLR
The address of a per-CPU variable is really an offset into the per-CPU
area, but we're applying the load bias (i.e., KASLR offset) to it as if
it were an address, resulting in an invalid pointer when it's eventually
passed to per_cpu_ptr().

Fix this by applying the bias only if it the address is in the module's
address range. This heuristic avoids any Linux kernel-specific logic;
hopefully it doesn't have any undesired side effects.

Signed-off-by: Omar Sandoval <osandov@osandov.com>
2021-01-21 10:14:50 -08:00
..
build-aux libdrgn/python: add Qualifiers.NONE and stop using Optional[Qualifiers] 2020-08-27 11:31:29 -07:00
elfutils Update elfutils and revert activation frame patch 2020-05-20 13:38:49 -07:00
examples libdrgn: add load_debug_info example program 2020-07-10 16:18:58 -07:00
include Update copyright headers to Facebook and add missing headers 2020-05-15 15:13:02 -07:00
m4 libdrgn: build with bundled elfutils 2019-09-19 11:07:12 -07:00
python Add support for C++ template parameters 2021-01-08 17:39:51 -08:00
.gitignore Document with Sphinx 2019-04-11 12:48:15 -07:00
arch_x86_64.c.in libdrgn: x86-64: fix rsp of initial stack frame 2021-01-15 10:57:08 -08:00
binary_buffer.c libdrgn: report better errors when parsing DWARF/kmod index 2020-11-13 17:00:07 -08:00
binary_buffer.h libdrgn: report better errors when parsing DWARF/kmod index 2020-11-13 17:00:07 -08:00
binary_search_tree.h Clean up #includes with include-what-you-use 2020-09-23 16:29:42 -07:00
bitops.h libdrgn: split bit operations into their own header 2020-10-09 17:44:15 -07:00
cityhash.h Update copyright headers to Facebook and add missing headers 2020-05-15 15:13:02 -07:00
configure.ac drgn 0.0.8 2020-11-11 13:32:04 -08:00
debug_info.c libdrgn: fix address of global per-CPU variables with KASLR 2021-01-21 10:14:50 -08:00
debug_info.h libdrgn: report better errors when parsing DWARF/kmod index 2020-11-13 17:00:07 -08:00
Doxyfile libdrgn: fix Doxygen 2020-09-30 01:32:33 -07:00
drgn.h.in Add support for C++ template parameters 2021-01-08 17:39:51 -08:00
dwarf_index.c libdrgn: debug_info: pass around Dwfl_Module instead of bias 2021-01-21 10:12:29 -08:00
dwarf_index.h libdrgn: debug_info: pass around Dwfl_Module instead of bias 2021-01-21 10:12:29 -08:00
error.c libdrgn: rename "unavailable" objects to "absent" objects 2020-12-29 14:58:26 -08:00
error.h libdrgn: rename "unavailable" objects to "absent" objects 2020-12-29 14:58:26 -08:00
hash_table.c Update copyright headers to Facebook and add missing headers 2020-05-15 15:13:02 -07:00
hash_table.h libdrgn: clean up hash function APIs and improve documentation 2020-10-12 16:20:08 -07:00
helpers.h Clean up #includes with include-what-you-use 2020-09-23 16:29:42 -07:00
kdump.c Clean up #includes with include-what-you-use 2020-09-23 16:29:42 -07:00
language_c.c libdrgn: get drgn_type_member.bit_field_size through drgn_member_type() 2021-01-08 17:39:51 -08:00
language.c libdrgn: simplify language fall back handling 2021-01-08 10:46:35 -08:00
language.h libdrgn: simplify language fall back handling 2021-01-08 10:46:35 -08:00
lazy_object.c libdrgn: replace lazy types with lazy objects 2021-01-08 17:39:51 -08:00
lazy_object.h libdrgn: replace lazy types with lazy objects 2021-01-08 17:39:51 -08:00
lexer.c Clean up #includes with include-what-you-use 2020-09-23 16:29:42 -07:00
lexer.h Clean up #includes with include-what-you-use 2020-09-23 16:29:42 -07:00
linux_kernel_helpers.c libdrgn: get drgn_type_member.bit_field_size through drgn_member_type() 2021-01-08 17:39:51 -08:00
linux_kernel.c libdrgn: rename "unavailable" objects to "absent" objects 2020-12-29 14:58:26 -08:00
linux_kernel.h libdrgn: linux kernel: remove THREAD_SIZE object finder 2020-12-10 02:08:13 -08:00
Makefile.am libdrgn: replace lazy types with lazy objects 2021-01-08 17:39:51 -08:00
memory_reader.c libdrgn: add {min,max}_iconst() and rewrite min() and max() 2020-10-10 23:48:03 -07:00
memory_reader.h libdrgn: fix Doxygen 2020-09-30 01:32:33 -07:00
minmax.h libdrgn: add {min,max}_iconst() and rewrite min() and max() 2020-10-10 23:48:03 -07:00
object_index.c Clean up #includes with include-what-you-use 2020-09-23 16:29:42 -07:00
object_index.h libdrgn: fold drgn_type_index into drgn_program 2020-08-26 17:36:35 -07:00
object.c libdrgn: get drgn_type_member.bit_field_size through drgn_member_type() 2021-01-08 17:39:51 -08:00
object.h Remove bit_offset from value objects 2020-12-14 12:29:17 -08:00
path.c Clean up #includes with include-what-you-use 2020-09-23 16:29:42 -07:00
path.h libdrgn: fix Doxygen 2020-09-30 01:32:33 -07:00
platform.c libdrgn: add macros for strict enum switch statements 2020-12-04 12:02:23 -08:00
platform.h libdrgn: cache page_offset and vmemmap as objects instead of uint64_t 2020-12-10 02:40:07 -08:00
pp.h libdrgn: add preprocessor utility macros 2020-10-09 16:36:59 -07:00
program.c libdrgn: debug_info: pass around Dwfl_Module instead of bias 2021-01-21 10:12:29 -08:00
program.h Add support for C++ template parameters 2021-01-08 17:39:51 -08:00
serialize.c libdrgn: add {min,max}_iconst() and rewrite min() and max() 2020-10-10 23:48:03 -07:00
serialize.h Update copyright headers to Facebook and add missing headers 2020-05-15 15:13:02 -07:00
siphash.h Update copyright headers to Facebook and add missing headers 2020-05-15 15:13:02 -07:00
splay_tree.c Clean up #includes with include-what-you-use 2020-09-23 16:29:42 -07:00
stack_trace.c libdrgn: make drgn_object::is_reference an enum 2020-12-04 13:37:58 -08:00
string_builder.c libdrgn: add {min,max}_iconst() and rewrite min() and max() 2020-10-10 23:48:03 -07:00
string_builder.h Clean up #includes with include-what-you-use 2020-09-23 16:29:42 -07:00
symbol.c Clean up #includes with include-what-you-use 2020-09-23 16:29:42 -07:00
symbol.h Update copyright headers to Facebook and add missing headers 2020-05-15 15:13:02 -07:00
type.c Add support for C++ template parameters 2021-01-08 17:39:51 -08:00
type.h Add support for C++ template parameters 2021-01-08 17:39:51 -08:00
util.h libdrgn: add macros for strict enum switch statements 2020-12-04 12:02:23 -08:00
vector.c libdrgn: fix vector_shrink_to_fit() with size 0 2021-01-06 17:47:39 -08:00
vector.h Clean up #includes with include-what-you-use 2020-09-23 16:29:42 -07:00