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-Status: No, score=-1.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_DOTEDU_SUSP, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS,UNPARSEABLE_RELAY shortcircuit=no autolearn=no autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 4D1A61F4B4 for ; Sat, 24 Oct 2020 14:25:51 +0000 (UTC) Received: from localhost ([::1]:38926 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kWKUP-0006pu-Ng for normalperson@yhbt.net; Sat, 24 Oct 2020 10:25:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36174) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kWKTd-0005Ud-Pb for bug-gnulib@gnu.org; Sat, 24 Oct 2020 10:25:03 -0400 Received: from scc-mailout-kit-02.scc.kit.edu ([2a00:1398:9:f712::810d:e752]:33242) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kWKTW-0003eZ-Uq for bug-gnulib@gnu.org; Sat, 24 Oct 2020 10:25:01 -0400 Received: from hekate.asta.kit.edu ([141.3.145.153] helo=hekate.usta.de) by scc-mailout-kit-02.scc.kit.edu with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (envelope-from ) id 1kWKTJ-0001OP-ON for bug-gnulib@gnu.org; Sat, 24 Oct 2020 16:24:43 +0200 Received: from donnerwolke.asta.kit.edu ([141.3.145.61] helo=donnerwolke.usta.de) by hekate.usta.de with esmtp (Exim 4.92.2) (envelope-from ) id 1kWKTI-0002VP-FK for bug-gnulib@gnu.org; Sat, 24 Oct 2020 16:24:40 +0200 Received: from athene.asta.kit.edu ([141.3.145.60] helo=athene.usta.de) by donnerwolke.usta.de with esmtp (Exim 4.84_2) (envelope-from ) id 1kWKTI-0000HS-9u for bug-gnulib@gnu.org; Sat, 24 Oct 2020 16:24:40 +0200 Received: from localhost (athene.usta.de [local]) by athene.usta.de (OpenSMTPD) with ESMTPA id 7abfdc7a for ; Sat, 24 Oct 2020 16:24:40 +0200 (CEST) Date: Sat, 24 Oct 2020 16:24:40 +0200 From: Ingo Schwarze To: bug-gnulib@gnu.org Subject: swarm of bugs in gnulib wrt restrict Message-ID: <20201024142440.GA96855@athene.usta.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.12.2 (2019-09-21) Received-SPF: none client-ip=2a00:1398:9:f712::810d:e752; envelope-from=schwarze@usta.de; helo=scc-mailout-kit-02.scc.kit.edu X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_NONE=0.001, UNPARSEABLE_RELAY=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" Hello, i'd like to give you a heads-up regarding a swarm of bugs in gnulib related to the C99 "restrict" keyword. I first sent this report directly to Bruno Haible because, as far as i can see, he was the last one to add a new bug to that swarm, in this commit: commit 182afcba2635cbff91240656c7fb3742dd23ab6f Author: Bruno Haible Date: Sat Feb 22 20:57:30 2020 +0100 But Bruno requested that i send this to bug-gnulib@ instead because he considered it potentially interesting for more people and because he hoped for participation of more people who posess exxpertise with respect to the "restrict" keyword. Before the commit, testing for "restrict" functionality was already broken, and using "#define restrict ..." for C++ code was already wrong, too. The above commit added the additional bug to the swarm that gnulib/lib/stdio.in.h can no longer be used from C++ code either, because it now stomps on the application namespace, too. For details, see comment #5 in this ticket: https://savannah.gnu.org/bugs/index.php?59276 I'm not planning to draft patches to gnulib myself because the complexity of gnulib is seriously excessive for my taste. All the same, i consider it fair to send a notification in case you want to investigate the problem on your own, using the information in the above GNU troff ticket. Yours, Ingo P.S. We found this because a recent update of gnulib in the GNU troff project -Subproject commit dce8759f0f0236a860a3e68b63c5e99cc6f168f9 +Subproject commit d60a35e94c4f5b8f09f15828242418f5073d46e7 broke compilation with GCC 4.2.1, i.e. the latest GPLv2 version of GCC. After detecting that, another user reported that the build crashed even with "gcc (Gentoo 9.3.0-r1 p3) 9.3.0", while the build still succeeded with clang. Fortunately, the workaround on the groff side was easy - just adding #include "config.h" to all files that #include , even to those that don't need it for their own purposes, but we were worried that more might be broken in groff, so i had a closer look and found that nothing more appears to be broken in groff, but that gnulib suffers from the issues listed in the ticket cited above. P.P.S. Unrelated to the swarm of bugs discussed above, but i might mention this as well while here, even though it is not a proper bug report but merely a concern. For some years, several operating systems have now been discouraging or even outlawing %n in printf(3) for security reasons. Some do so by default with an option for the application developer to re-enable it (e.g. MS Windows), some do so unconditionally for %n in writeable memory (e.g. MacOS X), and GNU/Linux appears to provide some hardening option to the effect. If the operating system provides a secure printf(3) that forbids %n in writeable memory, then gnulib mis-classifies that deliberate decision as a defect and compiles vasnprintf.c, which unconditionally re-enables %n in writeable memory behind the users back. I consider silently and agressively disabling security features of the operating system very nasty misbehaviour and totally outside the scope of a portability library. The net effect is that the more modern a version of glibc is in use, the more likely that gnulib will wrongly consider the native printf(3) broken and replace it with its own, less secure version. I got a report from a user who had that happen to him even on an up-to-date Gentoo Linux system. -- Ingo Schwarze http://www.openbsd.org/ http://mandoc.bsd.lv/