public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Thorsten Kukuk <kukuk@suse.com>
To: Adhemerval Zanella Netto via Libc-alpha <libc-alpha@sourceware.org>
Cc: Bruno Haible <bruno@clisp.org>
Subject: Re: utmp 64 bit time_t support
Date: Tue, 1 Aug 2023 20:46:18 +0000	[thread overview]
Message-ID: <20230801204618.GA415@suse.com> (raw)
In-Reply-To: <ca8064d9-d7bc-b5b8-cce8-bc2259d56526@linaro.org>


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)

  reply	other threads:[~2023-08-01 20:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-01 20:28 Adhemerval Zanella Netto
2023-08-01 20:46 ` Thorsten Kukuk [this message]
2023-08-04  7:00 ` Paul Eggert
2023-08-04  7:28   ` Andreas Schwab
2023-08-05 18:22     ` Paul Eggert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230801204618.GA415@suse.com \
    --to=kukuk@suse.com \
    --cc=bruno@clisp.org \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).