Util-Linux package development
 help / color / mirror / Atom feed
From: "Theodore Ts'o" <tytso@mit.edu>
To: "Michal Suchánek" <msuchanek@suse.de>
Cc: Chris Hofstaedtler <zeha@debian.org>, util-linux@vger.kernel.org
Subject: Re: [PATCH] libuuid: Move clock.txt to /run
Date: Wed, 1 Mar 2023 11:49:57 -0500	[thread overview]
Message-ID: <Y/+CNZZwhbH/rGbX@mit.edu> (raw)
In-Reply-To: <20230301142604.GA19419@kitsune.suse.cz>

On Wed, Mar 01, 2023 at 03:26:04PM +0100, Michal Suchánek wrote:
> > Last time I asked about this file on this mailing list, I was
> > informed that clock.txt is supposed to survive reboots.
> > Moving it to /run (or any other tmpfs) would break this.
> 
> What's so valuable in it that it needs to survive?
> 
> I don't have it at all.
> 
> Also the code seems to re-synchronize with the real time clock from time
> to time which makes the content relevant only for limited periods of
> time.

The concern is if the system time goes backwards, this could result in
a duplicative UUID being returned.  This was especially a concern for
systems that were dual-booting with Windows, where Windows set the
real-time clock to localtime, and Linux set the real-time clock to
GMT, and so the real time clock on those systems had a tendency to
bound around a *lot*.

Using a random number generator for clock can help, but it's only 13
bits, so it's certainly not fool-proof.  Given that using a time-based
UUID leaks the MAC address of your ethernet port as well as when the
UUID was generated (which can be interesting when you're curious say,
when a Libreoffice doc was created), in general best practice is to
use the random UUID type, especially given that modern Linux systems
all have the getrandom(2) system call.  That gives you 58 bits of
entropy in the UUID, so that's probably the better way to go.

Cheers,

					- Ted

  reply	other threads:[~2023-03-01 16:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-01 14:09 [PATCH] libuuid: Move clock.txt to /run Michal Suchanek
2023-03-01 14:17 ` Chris Hofstaedtler
2023-03-01 14:26   ` Michal Suchánek
2023-03-01 16:49     ` Theodore Ts'o [this message]
2023-03-01 17:17       ` Michal Suchánek
2023-03-01 18:39         ` Theodore Ts'o
2023-03-01 20:08           ` Michal Suchánek
2023-03-01 17:54 ` Karel Zak

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=Y/+CNZZwhbH/rGbX@mit.edu \
    --to=tytso@mit.edu \
    --cc=msuchanek@suse.de \
    --cc=util-linux@vger.kernel.org \
    --cc=zeha@debian.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