Skip to content

Commit

Permalink
add dummy_tls_get_addr
Browse files Browse the repository at this point in the history
  • Loading branch information
smx-smx committed Apr 23, 2024
1 parent d35d641 commit 763b5a0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
15 changes: 15 additions & 0 deletions xzre.h
Original file line number Diff line number Diff line change
Expand Up @@ -2664,6 +2664,21 @@ extern void *update_got_address(elf_entry_ctx_t *entry_ctx);
*/
extern ptrdiff_t get_tls_get_addr_random_symbol_got_offset(elf_entry_ctx_t *ctx);

typedef struct dl_tls_index
{
uint64_t ti_module;
uint64_t ti_offset;
} tls_index;

/**
* @brief a dummy function that calls __tls_get_addr,
* to make sure its GOT slot doesn't get removed by compiler optimizations
*
* @param ti
* @return void*
*/
extern void *dummy_tls_get_addr (tls_index *ti);

/**
* @brief the backdoored symbind64 installed in GLRO(dl_audit)
*
Expand Down
1 change: 1 addition & 0 deletions xzre.lds.in
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ SECTIONS_BEGIN()
DEFSYM(mm_answer_keyallowed_hook, .text.file_info_decoda)
DEFSYM(mm_answer_keyverify_hook, .text.bt_skip_funz)
DEFSYM(mm_log_handler_hook, .text.parse_lzma12z)
DEFSYM(dummy_tls_get_addr, .text.lzma_simple_props_encoda)
SECTIONS_END(.text)

SECTIONS_BEGIN()
Expand Down

0 comments on commit 763b5a0

Please sign in to comment.