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=-3.9 required=3.0 tests=AWL,BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H2, SPF_HELO_PASS,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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 23BEB1F910 for ; Sun, 27 Nov 2022 11:27:42 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=permerror (0-bit key) header.d=josefsson.org header.i=@josefsson.org header.b="w3PsBmcW"; dkim=temperror (0-bit key; unprotected) header.d=josefsson.org header.i=@josefsson.org header.b="F0uzr8GN"; dkim-atps=neutral Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ozFot-00040o-0M; Sun, 27 Nov 2022 06:27:35 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ozFon-0003yJ-Na for bug-gnulib@gnu.org; Sun, 27 Nov 2022 06:27:30 -0500 Received: from uggla.sjd.se ([2001:9b1:8633::107]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ozFok-0000uN-VQ for bug-gnulib@gnu.org; Sun, 27 Nov 2022 06:27:28 -0500 DKIM-Signature: v=1; a=ed25519-sha256; q=dns/txt; c=relaxed/relaxed; d=josefsson.org; s=ed2110; h=Content-Type:MIME-Version:Message-ID:In-Reply-To :Date:References:Subject:To:From:Sender:Reply-To:Cc:Content-Transfer-Encoding :Content-ID:Content-Description; bh=08syyO0jsozcuNUZfUzImgpb3NYeV7+XlT3aWAfQxoc=; t=1669548445; x=1670758045; b=w3PsBmcWT+MrLtxCF3jaRchhEFbK3CaYfBDetdYSdclvxcx1F3SMzJmGIchLyAIku6x2dCXtO8X ch9it2t3dCQ==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=josefsson.org; s=rsa2110; h=Content-Type:MIME-Version:Message-ID: In-Reply-To:Date:References:Subject:To:From:Sender:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description; bh=08syyO0jsozcuNUZfUzImgpb3NYeV7+XlT3aWAfQxoc=; t=1669548445; x=1670758045; b=F0uzr8GNH5ldXUPvFCdDc5UxeY07q3rzil3P1LEZPNgxuzTer2rRddVlSZyK3UVppshHqyQcqP+ zXEzbPf5k1UfR8NEALtvLKT5dGCqLJDJ+HgZiU7IoEsct2tB4YPi5e4LvBDGx2jmWONGBNAoElEg7 xttA+wrieeC2I97nnCViV5+FqdWbWpyrvraRQo/uyxtX0iK8Szsu5hfugOXtSQiL++x4gr1dObhe8 WDdDIbzccLQZ7nWUeViaOVXBO8S8bdY7Ak94Ff9QEAnKjOxXGMPJJIIyZYdrDn4ENpFxcCBp//01G GvJFLCW9KD0j6Mlej9UycPwlUrvr8YR/A1S2xNYP4AqDaahBng8IClE6dAd9P02c2fLOdraFYdYdf xmSMlnqebRtKlZhre2Q8yqQ9Le0IGN0z4RA/kBgzyiVOfqh4E7TYWaG3JG7x/DEr3nePArjgq; Received: from [2001:9b1:41ac:ff00:a360:dda7:f90e:1e60] (port=49846 helo=latte) by uggla.sjd.se with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ozFoh-005LdW-44 for bug-gnulib@gnu.org; Sun, 27 Nov 2022 12:27:23 +0100 X-Hashcash: 1:22:221127:bug-gnulib@gnu.org::Sp+pdDXMXPgG1S5b:Fqcd To: bug-gnulib@gnu.org Subject: explicit_bzero and -std=c99 References: <87tu2kps44.fsf@latte> OpenPGP: id=B1D2BD1375BECB784CF4F8C4D73CF638C53C06BE; url=https://josefsson.org/key-20190320.txt X-Hashcash: 1:22:221127:th0ma7@gmail.com::2Pbkuv68uzIrPnsc:6IoQ X-Hashcash: 1:22:221127:help-libtasn1@gnu.org::NXZPD7xy54ZBufPa:KgH7 Date: Sun, 27 Nov 2022 12:27:22 +0100 In-Reply-To: <87tu2kps44.fsf@latte> (Simon Josefsson via Discussion list for's message of "Sun, 27 Nov 2022 12:13:47 +0100") Message-ID: <87pmd8prhh.fsf_-_@latte> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Received-SPF: pass client-ip=2001:9b1:8633::107; envelope-from=simon@josefsson.org; helo=uggla.sjd.se X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Simon Josefsson From: Simon Josefsson via Gnulib discussion list Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org --=-=-= Content-Type: text/plain Hi. We got a bug report about a build failure (see below), and I'm wondering: 1) Does gnulib support building with gcc -std=c99? I think we should, but it could have documented missing functionality or breakage. 2) It seems explicit_bzero.c in gnulib fall backs to using 'asm' for GCC, which isn't working in non-GNU modes of gcc. Further wondering: 1) The reason for having explicit_bzero is read_file, which needs it for reading sensitive files, a feature we don't use. Uncoupling this unnecessary dependency would have been nice. 2) Is there no other way to implement explicit_bzero without 'asm'? There is a another fallback code using volatile pointers, but I'm not sure it really has the same semantics. 3) Is there a way to detect if the compiler supports 'asm'? The current test 'defined __GNUC__ && !defined __clang__' is what is really failing here. 3) Is the idiom of using separate functions bzero() vs explicit_bzero() to avoid security-problematic compiler optimization still a good one? 1) If yes, I think we should have read_sensitive_file() rather than extending read_file() with a flag for this purpose. 2) If no, what is the better idiom to use here instead of explicit_bzero? Other thoughts? /Simon Simon Josefsson via Discussion list for GNU Libtasn1 writes: > Vincent Fortier writes: > >> While preparing a gnutls update I ended-up updating libtasn1 from >> 4.16. Going to 4.17 works but anything after that fails with: > > Thanks for the report! I can reproduce this using: > > ./configure ac_cv_func_explicit_bzero=no CPPFLAGS="-std=c99" > > In other words, the problem is due to a combination of a platform > without explicit_bzero and forcing GCC into C99 mode where it doesn't > support 'asm', so it is not possible to implement 'explicit_bzero'. Why > do you hard code -std=c99? Try just removing that. Or use -std=gnu99' > to allow GCC to use 'asm'. > > Analysing further, the 'explicit_bzero' function is only used by > 'read_file' in a mode that we never use (for reading sensitive files), > so it is never needed by libtasn1. This is not ideal, but I'm not sure > what a maintainable solution is. > > /Simon > --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iIoEARYIADIWIQSjzJyHC50xCrrUzy9RcisI/kdFogUCY4NJmhQcc2ltb25Aam9z ZWZzc29uLm9yZwAKCRBRcisI/kdFoqnTAQCYL0zwcbVyIFdNlAZmyxq+utktQNxV yx4rOBg9q1JbQgEAhcxaYi90PzBwRTnZgtuCMr/5aTZRdla1r9EWIyQGegE= =E27S -----END PGP SIGNATURE----- --=-=-=--