summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@suse.de>2018-09-27 12:37:06 +0200
committerAndreas K. Hüttel <dilfridge@gentoo.org>2018-10-21 17:44:29 +0200
commit812afeab880d73ac23c729c011be9332f702892f (patch)
tree949f08ca480a2634726c9d3cc41276f81492e03b
parenti386: Use ENTRY and END in start.S [BZ #23606] (diff)
downloadglibc-812afeab880d73ac23c729c011be9332f702892f.tar.gz
glibc-812afeab880d73ac23c729c011be9332f702892f.tar.bz2
glibc-812afeab880d73ac23c729c011be9332f702892f.zip
Fix stack overflow in tst-setcontext9 (bug 23717)
The function f1a, executed on a stack of size 32k, allocates an object of size 32k on the stack. Make the stack variables static to reduce excessive stack usage. (cherry picked from commit f841c97e515a1673485a2b12b3c280073d737890) (cherry picked from commit 3a67c72c1512f778304a5644dea2fcf5bdece274)
-rw-r--r--ChangeLog6
-rw-r--r--NEWS1
-rw-r--r--stdlib/tst-setcontext9.c4
3 files changed, 9 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 84503e3a0c..4fbb9e2ad8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2018-09-27 Andreas Schwab <schwab@suse.de>
+
+ [BZ #23717]
+ * stdlib/tst-setcontext9.c (f1a): Make st2 static.
+ (do_test): Make st1 static.
+
2018-09-21 H.J. Lu <hongjiu.lu@intel.com>
Xuepeng Guo <xuepeng.guo@intel.com>
diff --git a/NEWS b/NEWS
index d1f1dd4b22..bc568bcec0 100644
--- a/NEWS
+++ b/NEWS
@@ -15,6 +15,7 @@ The following bugs are resolved with this release:
[23578] regex: Fix memory overread in re_compile_pattern
[23606] Missing ENDBR32 in sysdeps/i386/start.S
[23679] gethostid: Missing NULL check for gethostbyname_r result
+ [23717] Fix stack overflow in stdlib/tst-setcontext9
Version 2.28
diff --git a/stdlib/tst-setcontext9.c b/stdlib/tst-setcontext9.c
index db8355766c..009928235d 100644
--- a/stdlib/tst-setcontext9.c
+++ b/stdlib/tst-setcontext9.c
@@ -58,7 +58,7 @@ f1b (void)
static void
f1a (void)
{
- char st2[32768];
+ static char st2[32768];
puts ("start f1a");
if (getcontext (&ctx[2]) != 0)
{
@@ -93,7 +93,7 @@ f1a (void)
static int
do_test (void)
{
- char st1[32768];
+ static char st1[32768];
puts ("making contexts");
if (getcontext (&ctx[0]) != 0)
{