Re: [PATCH v2 06/12] libdwfl [6/12]: Elf* caching via dwfl_process_tracker

2025-04-15 Thread Serhei Makarov
On Tue, Apr 15, 2025, at 2:15 PM, Christian Hergert wrote: > On 4/15/25 09:12, Serhei Makarov wrote: >> Option 2: expose one function, treat file_name and fd as optional input >> parameters. >> >> // normal use case >> module_name = "/usr/lib/whatever.so"; /* name of module */ >> file_name = "

Re: [PATCH] src/readelf.c: Access symbol and version data only if available

2025-04-15 Thread Mark Wielaard
Hi Aaron, Hi Constantine, On Thu, 2025-04-10 at 10:52 -0400, Aaron Merey wrote: > handle_dynamic_symtab can attempt to read symbol and version data from > file offset 0 if the associated DT_ tags aren't found. > > Fix this by only reading symbol and version data when non-zero file > offsets have

Re: [PATCH v2 06/12] libdwfl [6/12]: Elf* caching via dwfl_process_tracker

2025-04-15 Thread Serhei Makarov
On Fri, Apr 4, 2025, at 5:04 PM, Serhei Makarov wrote: > Changes for v2: > > - Add locking for elftab. This is needed in addition to the > intrinsic locking in dynamicsizehash_concurrent to avoid > having cache_elf expose an incomplete dwfltracker_elf_info* > entry to other threads while i

Re: [PATCH v2 06/12] libdwfl [6/12]: Elf* caching via dwfl_process_tracker

2025-04-15 Thread Christian Hergert
On 4/15/25 09:12, Serhei Makarov wrote: Option 2: expose one function, treat file_name and fd as optional input parameters. // normal use case module_name = "/usr/lib/whatever.so"; /* name of module */ file_name = "/proc/PID/root/usr/lib/whatever.so"; /* actual location of module */ dwfl_proce

[PATCH] libdw: Fix eu_search_tree TOCTOU bugs

2025-04-15 Thread Aaron Merey
eu_tfind is used to facilitate lazy loading throughout libdw. If a result is not found via eu_tfind, work is done to load the result and cache it in an eu_search_tree. Some calls to eu_tfind allow for TOCTOU bugs. Multiple threads might race to call eu_tfind on some result that hasn't yet been ca