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 1346397 - glibc: debug/tst-longjump_chk2 calls printf from a signal handler
Summary: glibc: debug/tst-longjump_chk2 calls printf from a signal handler
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: glibc
Version: 7.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Florian Weimer
QA Contact: Sergey Kolosov
URL:
Whiteboard:
Depends On:
Blocks: 1277314 1335925
TreeView+ depends on / blocked
 
Reported: 2016-06-14 17:24 UTC by Florian Weimer
Modified: 2017-10-30 15:25 UTC (History)
8 users (show)

Fixed In Version: glibc-2.17-140.el7
Doc Type: No Doc Update
Doc Text:
undefined
Clone Of:
Environment:
Last Closed: 2016-11-03 08:32:12 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:2573 0 normal SHIPPED_LIVE Low: glibc security, bug fix, and enhancement update 2016-11-03 12:05:56 UTC
Sourceware 20248 0 None None None 2019-04-03 14:25:47 UTC

Description Florian Weimer 2016-06-14 17:24:02 UTC
Quoting the upstream bug I filed:

stackoverflow_handler contains this:

  /* Using printf is not really kosher in signal handlers but we know
     it will work.  */
  printf ("%*sin signal handler\n", pass, "");

The comment is incorrect.  printf calls vfprintf (~1760 bytes of stack space), vfprintf calls buffered_vfprintf (~8592 bytes of stack space), and this calls vfprintf again (~1760 bytes of stack space).  Total space requirement is around 12 KiB, and the kernel places siginfo_t and ucontext_t on the stack (which can be as large 5 KiB).  As a result, a SIGSTKSZ value of 16 KiB is just not large enough.

This causes the test case to fail on aarch64 since the value of SIGSTKSZ has been increased.  Before that, the test passed, presumably because the 8 KiB stack allocation in buffered_vfprintf conveniently jumped over the stack frame created by do_test.  (Currently, the return address saved by do_test is clobbered by vfprintf.)

Fixing this is preferred to ignore scary-looking error messages such as:

*** longjmp causes uninitialized stack frame ***: /builddir/build/BUILD/glibc-2.17-c758a686/build-aarch64-redhat-linux/debug/tst-longjmp_chk2 terminated
======= Backtrace: =========
/builddir/build/BUILD/glibc-2.17-c758a686/build-aarch64-redhat-linux/libc.so.6(__fortify_fail+0x48)[0x3ffb7f61c24]
/builddir/build/BUILD/glibc-2.17-c758a686/build-aarch64-redhat-linux/libc.so.6(+0xf1b48)[0x3ffb7f61b48]
/builddir/build/BUILD/glibc-2.17-c758a686/build-aarch64-redhat-linux/libc.so.6(__longjmp_chk+0x30)[0x3ffb7f61ad8]
/builddir/build/BUILD/glibc-2.17-c758a686/build-aarch64-redhat-linux/debug/tst-longjmp_chk2[0x40187c]
[0x3ffb8000510]
======= Memory map: ========
00400000-00410000 r-xp 00000000 08:05 3042772                            /builddir/build/BUILD/glibc-2.17-c758a686/build-aarch64-redhat-linux/debug/tst-longjmp_chk2
…

Comment 11 errata-xmlrpc 2016-11-03 08:32:12 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://rhn.redhat.com/errata/RHSA-2016-2573.html


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