From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by sourceware.org (Postfix) with ESMTPS id A38D13858D28 for ; Tue, 1 Aug 2023 20:46:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A38D13858D28 Authentication-Results: sourceware.org; dmarc=fail (p=quarantine dis=none) header.from=suse.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id A21A71F88B; Tue, 1 Aug 2023 20:46:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1690922778; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vpec/W4RIa1XwsH8qaS0V6nJOVOvhHInQ+6vfYlkBCU=; b=FCWIbq3Tj3M3DjnIT9WLRXL4lOP+LcsS2JPx+sy+bdZynbmuxeRDnrcne05d5o4CRieFi4 NrzEOJMCQEgS3TXOSl1O35QdUwbK5PxprhLoRmwWIENxGDsbE5egwODTz7mb4xestBSVIG VbTJu8A36K0GirCZx3NKQlNRIZbg9fo= Received: from wotan.suse.de (wotan.suse.de [10.160.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 95FC22C142; Tue, 1 Aug 2023 20:46:18 +0000 (UTC) Received: by wotan.suse.de (Postfix, from userid 358) id 7FF146963; Tue, 1 Aug 2023 20:46:18 +0000 (UTC) Date: Tue, 1 Aug 2023 20:46:18 +0000 From: Thorsten Kukuk To: Adhemerval Zanella Netto via Libc-alpha Cc: Bruno Haible Subject: Re: utmp 64 bit time_t support Message-ID: <20230801204618.GA415@suse.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi, On Tue, Aug 01, Adhemerval Zanella Netto via Libc-alpha wrote: > The gnulib developers has reported that the lack of 64-bit support on utmp > records has created some real issues [1]. This issue is problematic because > now some 32-bit architectures when built with 64-bit time_t support have > a different utmp struct size, which essentially breaks __WORDSIZE_TIME64_COMPAT32 > support. The simple straightforward fix would to make utmp/utmpx always 32-bit > for theses architecture (mips, mips64n32, riscv32, sparcv9, and i686) but this > would be an ABI break. > > Thorsten has summarized other issues with the interface [2], and it is even a > problem for some 64 bit architectures that define __WORDSIZE_TIME64_COMPAT32 > (mips64, powerpc64, riscv64, sparc64, and x86_64) [3][4]. > > The current implementation also has a security issues [5] that would require a > complete rewrite to move the functionality to a proper service (which poses its > own issues). > > Thorsten suggestion would to replace wtmp with journald, which would require > some code rewrite since is has a different ABI. But I think this is the best > way to fix it. Correction: 1. replace utmp with systemd-logind https://github.com/thkukuk/utmpx/blob/main/utmp-to-logind.md https://www.thkukuk.de/blog/Y2038_glibc_utmp_64bit/ https://github.com/thkukuk/utmpx/tree/main/patches systemd, shadow, util-linux, procps-ng and Linux-PAM will support this. 2. replace wtmp with (pam_)wtmpdb https://github.com/thkukuk/wtmpdb https://www.thkukuk.de/blog/Y2038_glibc_wtmp_64bit/ this is what we did already with openSUSE Tumbleweed and MicroOS and nobody noticed so far. So seems to be really compatible. > So I think it is really time to just deprecate these functions, move them to > compat symbols, and return ENOSYS for new code. > > Thoughts? I like this idea, this would increase the "pressure" for this one, who think there is still enough time and just wait until it resolves magically by itself and blocking everything. But maybe we should wait a little bit, systemd v254, which is the main pre-requires for this, is really fresh and did not yet arrive in the big distributions. Thorsten -- Thorsten Kukuk, Distinguished Engineer, Senior Architect, Future Technologies SUSE Software Solutions Germany GmbH, Frankenstraße 146, 90461 Nuernberg, Germany Managing Director: Ivo Totev, Andrew McDonald, Werner Knoblich (HRB 36809, AG Nürnberg)