From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 43369 invoked by alias); 27 Sep 2018 12:32:14 -0000 Mailing-List: contact libc-stable-help@sourceware.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Subscribe: List-Archive: Sender: libc-stable-owner@sourceware.org Received: (qmail 43094 invoked by uid 89); 27 Sep 2018 12:32:14 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.100.1 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1345 X-Spam-Status: No, score=-25.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 27 Sep 2018 12:32:13 +0000 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1240886668 for ; Thu, 27 Sep 2018 12:32:12 +0000 (UTC) Received: from oldenburg.str.redhat.com (ovpn-116-50.ams2.redhat.com [10.36.116.50]) by smtp.corp.redhat.com (Postfix) with ESMTP id CD46F308BE75 for ; Thu, 27 Sep 2018 12:32:11 +0000 (UTC) Received: by oldenburg.str.redhat.com (Postfix, from userid 1000) id B80AC4399457D; Thu, 27 Sep 2018 14:32:10 +0200 (CEST) Date: Mon, 01 Jan 2018 00:00:00 -0000 To: libc-stable@sourceware.org Subject: [2.28 COMMITTED] Fix stack overflow in tst-setcontext9 (bug 23717) User-Agent: Heirloom mailx 12.5 7/5/10 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20180927123210.B80AC4399457D@oldenburg.str.redhat.com> From: fweimer@redhat.com (Florian Weimer) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 27 Sep 2018 12:32:12 +0000 (UTC) X-IsSubscribed: yes X-SW-Source: 2018-09/txt/msg00008.txt.bz2 From: Andreas Schwab 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) 2018-09-27 Andreas Schwab [BZ #23717] * stdlib/tst-setcontext9.c (f1a): Make st2 static. (do_test): Make st1 static. 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) {