Bug 1893662 - glibc: Fix DT_AARCH64_VARIANT_PCS handling (lazy binding not disabled)
Summary: glibc: Fix DT_AARCH64_VARIANT_PCS handling (lazy binding not disabled)
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: glibc
Version: 8.4
Hardware: aarch64
OS: Linux
Target Milestone: alpha
: 8.4
Assignee: Carlos O'Donell
QA Contact: Sergey Kolosov
Zuzana Zoubkova
Depends On: 1893197
TreeView+ depends on / blocked
Reported: 2020-11-02 10:22 UTC by Florian Weimer
Modified: 2021-09-17 12:34 UTC (History)
8 users (show)

Fixed In Version: glibc-2.28-140.el8
Doc Type: Bug Fix
Doc Text:
.The `glibc` dynamic linker now disables lazy binding for the 64-bit ARM variant calling convention Previously, the `glibc` dynamic linker did not disable lazy binding for functions using the 64-bit ARM (AArch64) variant calling convention. As a consequence, the dynamic linker corrupted arguments in such function calls, leading to incorrect results or process failures. With this update, the dynamic linker now disables lazy binding in the described scenario, and the function arguments are passed correctly.
Clone Of:
Last Closed: 2021-05-18 14:36:39 UTC
Type: Bug
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Sourceware 26798 0 P2 RESOLVED aarch64: variant PCS symbols may be incorrectly lazy bound 2021-01-27 08:24:07 UTC

Description Florian Weimer 2020-11-02 10:22:26 UTC
We need to backport these upstream commits for proper support of the AArch64 vector PCS:

commit 558251bd8785760ad40fcbfeaaee5d27fa5b0fe4
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date:   Thu Oct 22 17:55:01 2020 +0100

    aarch64: Fix DT_AARCH64_VARIANT_PCS handling [BZ #26798]
    The variant PCS support was ineffective because in the common case
    linkmap->l_mach.plt == 0 but then the symbol table flags were ignored
    and normal lazy binding was used instead of resolving the relocs early.
    (This was a misunderstanding about how GOT[1] is setup by the linker.)
    In practice this mainly affects SVE calls when the vector length is
    more than 128 bits, then the top bits of the argument registers get
    clobbered during lazy binding.
    Fixes bug 26798.

commit e156dabc766d6f6f99ce9402999eae380a3ec1f2
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date:   Mon Oct 26 15:48:01 2020 +0000

    aarch64: Add variant PCS lazy binding test [BZ #26798]
    This test fails without bug 26798 fixed because some integer registers
    likely get clobbered by lazy binding and variant PCS only allows x16
    and x17 to be clobbered at call time.
    The test requires binutils 2.32.1 or newer for handling variant PCS
    symbols. SVE registers are not covered by this test, to avoid the
    complexity of handling multiple compile- and runtime feature support

Comment 15 errata-xmlrpc 2021-05-18 14:36:39 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: glibc security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.