From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS22989 209.51.188.0/24 X-Spam-Status: No, score=-4.0 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 0A5561F453 for ; Sat, 2 Feb 2019 22:58:52 +0000 (UTC) Received: from localhost ([127.0.0.1]:48850 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gq4FP-000530-Bv for normalperson@yhbt.net; Sat, 02 Feb 2019 17:58:51 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39364) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gq4FL-00052f-1I for bug-gnulib@gnu.org; Sat, 02 Feb 2019 17:58:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gq4FJ-0000uR-3G for bug-gnulib@gnu.org; Sat, 02 Feb 2019 17:58:46 -0500 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:35652) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gq4FH-0000qB-5t for bug-gnulib@gnu.org; Sat, 02 Feb 2019 17:58:44 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 29B671611D5; Sat, 2 Feb 2019 14:58:36 -0800 (PST) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id gAd3aC04cJjd; Sat, 2 Feb 2019 14:58:35 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 668BD1611DD; Sat, 2 Feb 2019 14:58:35 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id IfZaB7gd1gb9; Sat, 2 Feb 2019 14:58:35 -0800 (PST) Received: from [192.168.1.9] (cpe-23-242-74-103.socal.res.rr.com [23.242.74.103]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 122A216112F; Sat, 2 Feb 2019 14:58:35 -0800 (PST) Subject: Re: VLA and alloca To: =?UTF-8?Q?Tim_R=c3=bchsen?= , Bruno Haible , =?UTF-8?Q?P=c3=a1draig_Brady?= References: <2625370.QrXcNNoFVb@omega> <2f26e4a4-c899-686c-473c-2c7773fff14b@draigBrady.com> <4425313.A21oZ5zyQ0@omega> From: Paul Eggert Organization: UCLA Computer Science Department Message-ID: Date: Sat, 2 Feb 2019 14:58:34 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 131.179.128.68 X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: James Youngman , Bernhard Voelker , bug-gnulib@gnu.org Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" Tim R=C3=BChsen wrote: >> Just reading this CVE [1] from a week ago, makes me want to >> disable all large allocations on the stack. > Yes please. Any chance to remove it from gettext.h ? >=20 > #if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS > char msg_ctxt_id[msgctxt_len + msgid_len]; > #else >=20 It's already removed from gettext.h if you define GNULIB_NO_VLAS. Typical applications never give dcpgettext_expr arguments so long that it= s VLA=20 will crush the stack. For these applications enabling VLAs can be a minor= =20 performance win, so I'm not inclined to define GNULIB_NO_VLA for the apps= I help=20 maintain. Ironically, though, one of the few applications that needs to support=20 really-long message-IDs is the 'gettext' program itself. This might be an= =20 argument for disabling use of VLAs in libgettext, even though most applic= ations=20 work just fine with VLAs. If we do that, GNULIB_NO_VLA will have no effe= ct=20 since lib/gettext.h is the only source file where Gnulib creates VLAs.