Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1529981

Summary: gcc: incorrect CFI information on i386 with -fstack-clash-protection
Product: Red Hat Enterprise Linux 7 Reporter: Florian Weimer <fweimer>
Component: gccAssignee: Marek Polacek <mpolacek>
Status: CLOSED ERRATA QA Contact: Michael Petlan <mpetlan>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.5CC: bgollahe, jakub, mcermak, ohudlick
Target Milestone: rc   
Target Release: ---   
Hardware: i386   
OS: Unspecified   
Whiteboard:
Fixed In Version: gcc-4.8.5-26.el7 Doc Type: No Doc Update
Doc Text:
undefined
Story Points: ---
Clone Of: 1529979 Environment:
Last Closed: 2018-04-10 15:12:44 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1529979    
Bug Blocks: 1529982    
Attachments:
Description Flags
unwind.i cleaned up for GCC 4.8 none

Description Florian Weimer 2017-12-31 16:22:30 UTC
Created attachment 1374985 [details]
unwind.i cleaned up for GCC 4.8

This also seems to affect gcc-4.8.5-25.el7.x86_64.  Based on the disassembly of /lib/libpthread.so.0, glibc-2.17-220.el7.i686 is miscompiled as well.

+++ This bug was initially created as a clone of Bug #1529979 +++

Description of problem:

The attached program, when compiled using

gcc -fPIC -O2 -fgnu89-inline-fstack-clash-protection -c unwind.i

produces invalid CFI instructions for __GI___pthread_unwind:

__GI___pthread_unwind:
.LFB55:
        .cfi_startproc
        pushl   %esi
        .cfi_def_cfa_offset 8
        .cfi_offset 6, -8
        pushl   %ebx
        .cfi_def_cfa_offset 12
        .cfi_offset 3, -12
        pushl   %esi
        .cfi_def_cfa_offset 16
        .cfi_offset 6, -16
        popl    %esi
        .cfi_restore 6
        .cfi_def_cfa_offset 12
        call    __x86.get_pc_thunk.bx
        addl    $_GLOBAL_OFFSET_TABLE_, %ebx
        subl    $8, %esp
        .cfi_def_cfa_offset 20
        movl    %eax, %esi

The problem is that the .cfi_restore for %esi does not restore the original location at offset 8, but essentially declares that the register will not be clobbered further below, while in fact it is used to store the function argument (__pthread_unwind is compiled with __attribute__ ((regparm (1)))).

As a result, the libgcc unwinder restores the wrong value for %esi, leading to bug 1529549.

Version-Release number of selected component (if applicable):

gcc-7.2.1-4.fc28.i686

Comment 3 Michael Petlan 2018-02-19 15:48:50 UTC
Related tests passed with gcc-4.8.5-28.el7.
VERIFIED.

Comment 6 errata-xmlrpc 2018-04-10 15:12:44 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, and where to find the updated
files, follow the link below.

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

https://access.redhat.com/errata/RHSA-2018:0849