From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A5A3C38460B2; Wed, 3 Apr 2024 17:43:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A5A3C38460B2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1712166181; bh=clJKvpPGMZyJSyER+2jQ9pOWSwgXRS4ZLKjk6AHeu7o=; h=From:To:Subject:Date:In-Reply-To:References:From; b=GnbdSlaQ70wrZNBCuyKMtptOhuoL4c2GsopHK/XZVqF9d1fZllwWbWlZ1C7KlpvTX px3Bj71iplqLodNIoXo1PLX0o+fRxBhr5nrA4erz+yOnUCF7iXJ+BJNzLiwOaVHxHr trI44Bd0YO3DNVDfGBvS+Q5R8Ix3bT22IG4o1P+U= From: "cvs-commit at gcc dot gnu.org" To: glibc-bugs@sourceware.org Subject: [Bug dynamic-link/31372] _dl_tlsdesc_dynamic doesn't preserve all caller-saved registers Date: Wed, 03 Apr 2024 17:42:59 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: dynamic-link X-Bugzilla-Version: 2.40 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: security- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D31372 --- Comment #13 from Sourceware Commits --- The release/2.39/master branch has been updated by H.J. Lu : https://sourceware.org/git/gitweb.cgi?p=3Dglibc.git;h=3Da364304718725a31ab1= 41936322855c76c73e35e commit a364304718725a31ab141936322855c76c73e35e Author: H.J. Lu Date: Mon Feb 26 06:37:03 2024 -0800 x86: Update _dl_tlsdesc_dynamic to preserve caller-saved registers Compiler generates the following instruction sequence for GNU2 dynamic TLS access: leaq tls_var@TLSDESC(%rip), %rax call *tls_var@TLSCALL(%rax) or leal tls_var@TLSDESC(%ebx), %eax call *tls_var@TLSCALL(%eax) CALL instruction is transparent to compiler which assumes all registers, except for EFLAGS and RAX/EAX, are unchanged after CALL. When _dl_tlsdesc_dynamic is called, it calls __tls_get_addr on the slow path. __tls_get_addr is a normal function which doesn't preserve any caller-saved registers. _dl_tlsdesc_dynamic saved and restored integer caller-saved registers, but didn't preserve any other caller-saved registers. Add _dl_tlsdesc_dynamic IFUNC functions for FNSAVE, FXSAVE, XSAVE and XSAVEC to save and restore all caller-saved registers. This fixes BZ #31372. Add GLRO(dl_x86_64_runtime_resolve) with GLRO(dl_x86_tlsdesc_dynamic) to optimize elf_machine_runtime_setup. Reviewed-by: Noah Goldstein (cherry picked from commit 0aac205a814a8511e98d02b91a8dc908f1c53cde) --=20 You are receiving this mail because: You are on the CC list for the bug.=