Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1346397 - glibc: debug/tst-longjump_chk2 calls printf from a signal handler
glibc: debug/tst-longjump_chk2 calls printf from a signal handler
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: glibc (Show other bugs)
7.3
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Florian Weimer
Sergey Kolosov
: Patch
Depends On:
Blocks: 1277314 1335925
  Show dependency treegraph
 
Reported: 2016-06-14 13:24 EDT by Florian Weimer
Modified: 2017-10-30 11:25 EDT (History)
8 users (show)

See Also:
Fixed In Version: glibc-2.17-140.el7
Doc Type: No Doc Update
Doc Text:
undefined
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-11-03 04:32:12 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Sourceware 20248 None None None 2016-06-14 13:24 EDT
Red Hat Product Errata RHSA-2016:2573 normal SHIPPED_LIVE Low: glibc security, bug fix, and enhancement update 2016-11-03 08:05:56 EDT

  None (edit)
Description Florian Weimer 2016-06-14 13:24:02 EDT
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 04:32:12 EDT
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.