From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oo1-xc2d.google.com (mail-oo1-xc2d.google.com [IPv6:2607:f8b0:4864:20::c2d]) by sourceware.org (Postfix) with ESMTPS id 40FFD3858D28 for ; Tue, 1 Aug 2023 20:28:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 40FFD3858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-oo1-xc2d.google.com with SMTP id 006d021491bc7-55e1a9ff9d4so131930eaf.1 for ; Tue, 01 Aug 2023 13:28:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1690921729; x=1691526529; h=content-transfer-encoding:organization:subject:from:to :content-language:user-agent:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=rvLvO5XxRCdvnnKxUQzjs+G266VsWp/ukMsyoCe7WFM=; b=pTrym/XQyvOq4gqdubiMVMhphnxiz+Pea4OOec9HVY9+AOCEwEVgltJyWbFFVgg6HX bvtwT9m2qPWdHNjRXk5t2WhziO6NppryqPmWtUwcrOlOUo4+8jayHZ0Op8WxG2qhzSsj NQEY7HzYiVCEl+tw/vP0z9MQJiYVWRpxPWETFpZ2UVTxELswOkvvIgCHkOALONXG8Apz NEciCEoszW4/46m2RRPzUdAVkq2aLAb62LYyLpMS94cE5oNoOAzIFcD8nvMkpv/MTc0g RFdOKQW7mnYLKT9l7G7QiElLMywMrqOwGVCLymEeYmGsc+FfY5am35dUgchF1hlZJBoz ieUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690921729; x=1691526529; h=content-transfer-encoding:organization:subject:from:to :content-language:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=rvLvO5XxRCdvnnKxUQzjs+G266VsWp/ukMsyoCe7WFM=; b=U/GQLwUHF/2nv14kPX2nxU9X5Qc4SmMAl0Da6Si4Qj7/d3Dr5CnEsQ/nP2iIYkFspO 4/GtcXoz+GwqXkuUjnUSkaB3Q6edPk2n4MuLw5gJBG5oIkRKn9a3eDWwdmVz3WRSHkRB Dm6GAbRThNarM3QRJN3zx7fkySlutXXTzKEGpNQimnu0C10LfYCAju/Ryaxd0BMna5jU E+ssOZi6pEl4AggG6ZznVGgW5uN69eLmXDktFyJwIKQc6U7V6VeHkkHWgbm+EBCf56+q jv1opmVStyRWeSGbSsGj4il08Qjqu+//X3oB3WxkIE6EV+SKW5R1cTx2Of9pPta6HPvE UzwA== X-Gm-Message-State: ABy/qLbErZ6UXkRVOKQUqdsW5A8Uf8F+Hi3tQhtNmnxPDwJZ1pm1sp6M 80CJ61NyX+GKbNKilpb/oo9eLNBuaszYuvZFac2KcQ== X-Google-Smtp-Source: APBJJlFpEeHCtdKhlPAq8LF8gm25Tyt/zq51VwwwTNf3LD6QgttZn3ygRtCtamBvcjJlIwCgkS29VA== X-Received: by 2002:a05:6870:1605:b0:1b0:6ad0:80c3 with SMTP id b5-20020a056870160500b001b06ad080c3mr15263153oae.3.1690921728768; Tue, 01 Aug 2023 13:28:48 -0700 (PDT) Received: from ?IPV6:2804:1b3:a7c1:9aa9:84f6:53b3:4cd0:ffe6? ([2804:1b3:a7c1:9aa9:84f6:53b3:4cd0:ffe6]) by smtp.gmail.com with ESMTPSA id h6-20020a056870860600b00172ac40356csm5895752oal.50.2023.08.01.13.28.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 01 Aug 2023 13:28:48 -0700 (PDT) Message-ID: Date: Tue, 1 Aug 2023 17:28:45 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Content-Language: en-US To: libc-alpha , Bruno Haible , Thorsten Kukuk From: Adhemerval Zanella Netto Subject: utmp 64 bit time_t support Organization: Linaro Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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. I have sent a possible 64 bit fix [6], but as Joseph has hinted there is not easy way to maintain compatibility [7]. It would require a lot of work, probably some breakage; which I think no one is really interested in fixing. So I think it is really time to just deprecate these functions, move them to compat symbols, and return ENOSYS for new code. Thoughts? [1] https://sourceware.org/bugzilla/show_bug.cgi?id=30701 [2] https://github.com/thkukuk/utmpx/blob/main/Y2038.md [3] https://sourceware.org/bugzilla/show_bug.cgi?id=28146 [4] https://sourceware.org/bugzilla/show_bug.cgi?id=17470 [5] https://sourceware.org/bugzilla/show_bug.cgi?id=24492 [6] https://sourceware.org/pipermail/libc-alpha/2020-July/116742.html [7] https://sourceware.org/pipermail/libc-alpha/2020-July/116764.html