From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from albireo.enyo.de (albireo.enyo.de [37.24.231.21]) by sourceware.org (Postfix) with ESMTPS id 9A5723858D28 for ; Sat, 1 Jan 2022 19:02:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9A5723858D28 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=deneb.enyo.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=deneb.enyo.de Received: from [172.17.203.2] (port=53529 helo=deneb.enyo.de) by albireo.enyo.de ([172.17.140.2]) with esmtps (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) id 1n3jdt-003MfX-4n; Sat, 01 Jan 2022 19:02:13 +0000 Received: from fw by deneb.enyo.de with local (Exim 4.94.2) (envelope-from ) id 1n3jds-00083a-Qx; Sat, 01 Jan 2022 20:02:12 +0100 From: Florian Weimer To: bug-hurd@gnu.org Cc: commit-hurd@gnu.org, libc-alpha@sourceware.org Subject: Re: [hurd, commited] hurd: Use __trivfs_server_name instead of trivfs_server_name References: <20220101165311.2197758-1-samuel.thibault@ens-lyon.org> <87tuenv016.fsf@mid.deneb.enyo.de> <20220101174120.z7kh5zq4qdsbfnvt@begin> <87mtkfuway.fsf@mid.deneb.enyo.de> <20220101185836.qwzd3af5ojjyjspl@begin> Date: Sat, 01 Jan 2022 20:02:12 +0100 In-Reply-To: <20220101185836.qwzd3af5ojjyjspl@begin> (Samuel Thibault's message of "Sat, 1 Jan 2022 19:58:36 +0100") Message-ID: <87fsq7uvnv.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham 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 19:02:16 -0000 * Samuel Thibault: > 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. Oh, so there is a companion patch that is not reflected in the glibc sources?