about summary refs log tree commit diff
path: root/NEWS
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2023-12-20 16:31:43 -0800
committerH.J. Lu <hjl.tools@gmail.com>2023-12-23 07:11:29 -0800
commit6a1168279d770ee9631d8d0409768ac67c96be3c (patch)
tree6433bfc6e8a837d8987ccd3392b2c4091105a6b5 /NEWS
parent882a991620fcf2ecb3f623e2d29ac551b33bd6ee (diff)
downloadglibc-6a1168279d770ee9631d8d0409768ac67c96be3c.tar.gz
glibc-6a1168279d770ee9631d8d0409768ac67c96be3c.tar.xz
glibc-6a1168279d770ee9631d8d0409768ac67c96be3c.zip
x86-64: Fix the dtv field load for x32 [BZ #31184]
On x32, I got

FAIL: elf/tst-tlsgap

$ gdb elf/tst-tlsgap
...
open tst-tlsgap-mod1.so

Thread 2 "tst-tlsgap" received signal SIGSEGV, Segmentation fault.
[Switching to LWP 2268754]
_dl_tlsdesc_dynamic () at ../sysdeps/x86_64/dl-tlsdesc.S:108
108		movq	(%rsi), %rax
(gdb) p/x $rsi
$4 = 0xf7dbf9005655fb18
(gdb)

This is caused by

_dl_tlsdesc_dynamic:
        _CET_ENDBR
        /* Preserve call-clobbered registers that we modify.
           We need two scratch regs anyway.  */
        movq    %rsi, -16(%rsp)
        movq    %fs:DTV_OFFSET, %rsi

Since the dtv field in TCB is a pointer, %fs:DTV_OFFSET is a 32-bit
location, not 64-bit.  Load the dtv field to RSI_LP instead of rsi.
This fixes BZ #31184.

(cherry picked from commit 3502440397bbb840e2f7223734aa5cc2cc0e29b6)
Diffstat (limited to 'NEWS')
-rw-r--r--NEWS1
1 files changed, 1 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index ed72d2f2e6..377660ece0 100644
--- a/NEWS
+++ b/NEWS
@@ -87,6 +87,7 @@ The following bugs are resolved with this release:
   [30804] F_GETLK, F_SETLK, and F_SETLKW value change for powerpc64 with
     -D_FILE_OFFSET_BITS=64
   [30842] Stack read overflow in getaddrinfo in no-aaaa mode (CVE-2023-4527)
+  [31184] FAIL: elf/tst-tlsgap
 
 Version 2.36