diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2023-12-20 19:42:12 -0800 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2023-12-22 05:37:17 -0800 |
commit | 81be2a61dafc168327c1639e97b6dae128c7ccf3 (patch) | |
tree | 0f56678699b9deab602178f811dd9f0c45a22472 /iconv/gconv_charset.c | |
parent | 3502440397bbb840e2f7223734aa5cc2cc0e29b6 (diff) | |
download | glibc-81be2a61dafc168327c1639e97b6dae128c7ccf3.tar glibc-81be2a61dafc168327c1639e97b6dae128c7ccf3.tar.gz glibc-81be2a61dafc168327c1639e97b6dae128c7ccf3.tar.bz2 glibc-81be2a61dafc168327c1639e97b6dae128c7ccf3.zip |
x86-64: Fix the tcb field load for x32 [BZ #31185]
_dl_tlsdesc_undefweak and _dl_tlsdesc_dynamic access the thread pointer
via the tcb field in TCB:
_dl_tlsdesc_undefweak:
_CET_ENDBR
movq 8(%rax), %rax
subq %fs:0, %rax
ret
_dl_tlsdesc_dynamic:
...
subq %fs:0, %rax
movq -8(%rsp), %rdi
ret
Since the tcb field in TCB is a pointer, %fs:0 is a 32-bit location,
not 64-bit. It should use "sub %fs:0, %RAX_LP" instead. Since
_dl_tlsdesc_undefweak returns ptrdiff_t and _dl_make_tlsdesc_dynamic
returns void *, RAX_LP is appropriate here for x32 and x86-64. This
fixes BZ #31185.
Diffstat (limited to 'iconv/gconv_charset.c')
0 files changed, 0 insertions, 0 deletions