From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 217D038582BD; Thu, 21 Dec 2023 03:29:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 217D038582BD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1703129372; bh=UvCLnyZ7w8mRJ2+RbEwtqloDsCcRIXgfsS04WcT+aps=; h=From:To:Subject:Date:From; b=eD5x+68kQCFHphqDJT8m6IJQrWqZiZbugw9BasHzQ0aSiCNvKEnIXCMATIZO4w++x lkeKfJIvInHa+yxYowRvIpqp6f7ieVBqyJdfvQjwki9GpteraNWeuIi+WgFqn4XVp6 dCJmQrP0ewmSmUsLiBh60HeN1EBH+yn7LuHMOaZk= From: "hjl.tools at gmail dot com" To: glibc-bugs@sourceware.org Subject: [Bug dynamic-link/31185] New: Incorrect thread point access in _dl_tlsdesc_undefweak and _dl_tlsdesc_dynamic Date: Thu, 21 Dec 2023 03:29:31 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: dynamic-link X-Bugzilla-Version: 2.38 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: hjl.tools at gmail 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: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone cf_gcctarget Message-ID: 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=3D31185 Bug ID: 31185 Summary: Incorrect thread point access in _dl_tlsdesc_undefweak and _dl_tlsdesc_dynamic Product: glibc Version: 2.38 Status: NEW Severity: normal Priority: P2 Component: dynamic-link Assignee: unassigned at sourceware dot org Reporter: hjl.tools at gmail dot com Target Milestone: --- Target: x32 _dl_tlsdesc_undefweak and _dl_tlsdesc_dynamic in sysdeps/x86_64/dl-tlsdesc.S access the thread pointer via the tcb field in TCB: _dl_tlsdesc_undefweak: _CET_ENDBR movq 8(%rax), %rax subq %fs:0, %rax ret=20 _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. --=20 You are receiving this mail because: You are on the CC list for the bug.=