Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Mon, 12 Jun 2017 19:58:30 -0400
From: Rich Felker <dalias@...c.org>
To: musl@...ts.openwall.com
Subject: Re: detect timezone changes by monitoring /etc/localtime
 (like glibc)

On Tue, Jun 13, 2017 at 09:49:59AM +1000, Patrick Oppenlander wrote:
> On another note, while reading the code in this area I noticed that
> musl mmap's the timezone file and holds pointers to the mapped area.
> Is this safe given that system updates often change these files? Or
> do we assume that no package manager is dumb enough to modify files
> in place?

I'm aware of that. Ideally we'd be using MAP_COPY, but Linux lacks it.
Note that even if we read the files into memory, though, there'd be a
race aginst modifying them at the same time. The only safe way to
install replacements for shared files is with atomic replacement
(rename). It's actually much more dangerous to modify executables or
shared libraries in place, so hopefully package managers are already
getting this right and applying the same solution to both executable
and non-executable files.

Rich

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.