From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1BE283858C5E; Tue, 2 Apr 2024 13:16:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1BE283858C5E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1712063800; bh=hLPCxpe20s6h3KkcSUQ0ItS0yipA+TgGXz6B8kMx18s=; h=From:To:Subject:Date:In-Reply-To:References:From; b=p9xuyoFoQhe5pRkdoMqDJgkOwdTzJ0ZRUqbStUjZQwsK8bHyRU153OGRX/3UNrJJe w3079PdpwlvIBcvBm6wj4WdII8JE/JUl25QYMwh0i8aWuex8RHW114Sb2IXBp0VFQl Zw5XCeTEfFbINcY9DjL3KGCWP0CuZqfkNuULahnY= From: "carlos at redhat dot com" To: glibc-bugs@sourceware.org Subject: [Bug dynamic-link/31372] _dl_tlsdesc_dynamic doesn't preserve all caller-saved registers Date: Tue, 02 Apr 2024 13:16:36 +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: carlos at redhat dot com 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: cc 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 Carlos O'Donell changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |carlos at redhat dot com --- Comment #12 from Carlos O'Donell --- These two other issues are needed and should be noted as needed: commit fd7ee2e6c5eb49e4a630a9978b4d668bff6354ee Author: Andreas Schwab Date: Tue Mar 19 13:49:50 2024 +0100 Add tst-gnu2-tls2mod1 to test-internal-extras That allows sysdeps/x86_64/tst-gnu2-tls2mod1.S to use internal headers. Fixes: 717ebfa85c ("x86-64: Allocate state buffer space for RDI, RSI and RBX") commit 717ebfa85c8240d32d0d19d86a484c31c55c9617 Author: H.J. Lu Date: Mon Mar 18 06:40:16 2024 -0700 x86-64: Allocate state buffer space for RDI, RSI and RBX _dl_tlsdesc_dynamic preserves RDI, RSI and RBX before realigning stack. After realigning stack, it saves RCX, RDX, R8, R9, R10 and R11. Define TLSDESC_CALL_REGISTER_SAVE_AREA to allocate space for RDI, RSI and RBX to avoid clobbering saved RDI, RSI and RBX values on stack by xsave to STATE_SAVE_OFFSET(%rsp). +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+<- stack fra= me start aligned at 8 or 16 bytes | |<- RDI saved in the red zone | |<- RSI saved in the red zone | |<- RBX saved in the red zone | |<- paddings for stack realignment of 64 bytes |------------------|<- xsave buffer end aligned at 64 bytes | |<- | |<- | |<- |------------------|<- xsave buffer start at STATE_SAVE_OFFSET(%rsp) | |<- 8-byte padding for 64-byte alignment | |<- 8-byte padding for 64-byte alignment | |<- R11 | |<- R10 | |<- R9 | |<- R8 | |<- RDX | |<- RCX +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+<- RSP align= ed at 64 bytes Define TLSDESC_CALL_REGISTER_SAVE_AREA, the total register save area si= ze for all integer registers by adding 24 to STATE_SAVE_OFFSET since RDI, = RSI and RBX are saved onto stack without adjusting stack pointer first, usi= ng the red-zone. This fixes BZ #31501. Reviewed-by: Sunil K Pandey --=20 You are receiving this mail because: You are on the CC list for the bug.=