From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8B5563858401; Wed, 3 Apr 2024 17:43:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8B5563858401 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1712166190; bh=7FyZgsTbUkgAIPZ7B43k+yoXJqaJ6HgtSKWj5k/1tZI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ZwNK8CT61VN1BzShK2ISx/SEd6MKPScTZhwVlHiaTNkxXr7lkCAvnRS8XFmbB9o3s ARcrOhiuhXHPL8JFxh8h8bRdvEr6lgE/waIvnFj1i4YzziYB4nW50NPVu55Zt9M2WL rcJ2qiORI+jJgGa3cqc8HIvpRsrUk3ywfxA8AlGs= From: "cvs-commit at gcc dot gnu.org" To: glibc-bugs@sourceware.org Subject: [Bug dynamic-link/31501] _dl_tlsdesc_dynamic_xsavec may clobber %rbx Date: Wed, 03 Apr 2024 17:43:09 +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: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: hjl.tools at gmail dot com X-Bugzilla-Target-Milestone: 2.40 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=3D31501 --- Comment #10 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=3D354cabcb2634abe16da= 7a2ba5e648aac1204b58e commit 354cabcb2634abe16da7a2ba5e648aac1204b58e 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 (cherry picked from commit 717ebfa85c8240d32d0d19d86a484c31c55c9617) --=20 You are receiving this mail because: You are on the CC list for the bug.=