From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from hera.aquilenet.fr (hera.aquilenet.fr [IPv6:2a0c:e300::1]) by sourceware.org (Postfix) with ESMTPS id 55BA43858D28 for ; Sat, 1 Jan 2022 18:58:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 55BA43858D28 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 4037C30B; Sat, 1 Jan 2022 19:58:39 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jRBncPNJB1yI; Sat, 1 Jan 2022 19:58:38 +0100 (CET) Received: from begin (unknown [IPv6:2a01:cb19:956:1b00:de41:a9ff:fe47:ec49]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 3F6462C3; Sat, 1 Jan 2022 19:58:38 +0100 (CET) Received: from samy by begin with local (Exim 4.95) (envelope-from ) id 1n3jaO-009Gw5-98; Sat, 01 Jan 2022 19:58:36 +0100 Date: Sat, 1 Jan 2022 19:58:36 +0100 From: Samuel Thibault To: Florian Weimer Cc: bug-hurd@gnu.org, commit-hurd@gnu.org, libc-alpha@sourceware.org Subject: Re: [hurd, commited] hurd: Use __trivfs_server_name instead of trivfs_server_name Message-ID: <20220101185836.qwzd3af5ojjyjspl@begin> Mail-Followup-To: Florian Weimer , bug-hurd@gnu.org, commit-hurd@gnu.org, libc-alpha@sourceware.org References: <20220101165311.2197758-1-samuel.thibault@ens-lyon.org> <87tuenv016.fsf@mid.deneb.enyo.de> <20220101174120.z7kh5zq4qdsbfnvt@begin> <87mtkfuway.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87mtkfuway.fsf@mid.deneb.enyo.de> Organization: I am not organized User-Agent: NeoMutt/20170609 (1.8.3) X-Spamd-Bar: / X-Rspamd-Server: hera X-Rspamd-Queue-Id: 4037C30B X-Spamd-Result: default: False [0.40 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; HAS_ORG_HEADER(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; MID_RHS_NOT_FQDN(0.50)[] X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, KAM_DMARC_NONE, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_SOFTFAIL, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jan 2022 18:58:41 -0000 Florian Weimer, le sam. 01 janv. 2022 19:48:21 +0100, a ecrit: > * Samuel Thibault via Libc-alpha: > >> > + if (&__trivfs_server_name && __trivfs_server_name > >> > + && __trivfs_server_name[0] == 'r' > >> > + && __trivfs_server_name[1] == 'a' > >> > + && __trivfs_server_name[2] == 'n' > >> > + && __trivfs_server_name[3] == 'd' > >> > + && __trivfs_server_name[4] == 'o' > >> > + && __trivfs_server_name[5] == 'm' > >> > + && __trivfs_server_name[6] == '\0') > >> > /* We are random, don't try to read ourselves! */ > >> > return length; > >> > >> How does this work? It's a new synbol name, so there's no definition, > >> so the weak reference is always null. > > > > It is peeking it from the program. > > > > Basically the problem is that the random translator uses glibc, whose > > malloc implementation started using /dev/random in glibc 2.34, thus > > reading itself. > > I still don't understand. Why isn't the condition always false? The definition is in the random translator, which exports it in its dynamic symbol table. Samuel