From: orc <orc@sibserver.ru>
To: musl@lists.openwall.com
Subject: Re: install.sh is wrong with libc.so
Date: Thu, 16 Jan 2014 09:34:26 +0800 [thread overview]
Message-ID: <7ece5d58-9e08-4583-9c0a-089690d0f6f9@email.android.com> (raw)
In-Reply-To: <20140115163150.GG24286@brightrain.aerifal.cx>
Rich Felker <dalias@aerifal.cx> пишет:
>On Wed, Jan 15, 2014 at 08:48:18PM +0800, orc wrote:
>> Szabolcs Nagy <nsz@port70.net> пишет:
>> >* orc <orc@sibserver.ru> [2014-01-15 16:42:08 +0800]:
>> >> umask 077
>> >> cat < lib/libc.so > /lib/libc.so.tmp.pid # /lib/libc.so.tmp.pid is
>> >created with mode 600
>> >> mv -f /lib/libc.so.tmp.pid /lib/libc.so
>> >> chmod 755 /lib/libc.so # failed with "Permission denied"
>> >>
>> >> After that the system is unusable and requires external
>assistance.
>> >
>> >this is why you should have chmod statically linked
>
>In fairness, my having chmod statically linked is why I didn't catch
>this bug...
>
>> I agree with that. For historical reasons it's not. But I expected
>> musl will continue to use standard install program.
>
>Unfortunately the "standard" (historical) install program is even more
>dangerous; it truncates and overwrites the file in-place rather than
>atomically renaming the new version over top of the old. This can
>crash any programs currently running with the old version and could
>even result in runaway random code execution. This was the motivation
>for replacing it with musl's install.sh.
>
>Regardless of that, I agree the current order (chmod after mv) is a
>serious bug in atomicity of the install, and I apologize for the
>breakage you experienced. I'm glad it got reported so we can fix it
>before 1.0 though.
>
Thanks for detailed explanation and quick fix!
>Rich
prev parent reply other threads:[~2014-01-16 1:34 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-15 8:42 orc
2014-01-15 11:01 ` Laurent Bercot
2014-01-15 11:35 ` Christian Wiese
2014-01-15 11:52 ` orc
2014-01-15 12:58 ` Christian Wiese
2014-01-15 12:13 ` Szabolcs Nagy
2014-01-15 12:48 ` orc
2014-01-15 14:18 ` Szabolcs Nagy
2014-01-15 16:31 ` Rich Felker
2014-01-16 1:34 ` orc [this message]
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=7ece5d58-9e08-4583-9c0a-089690d0f6f9@email.android.com \
--to=orc@sibserver.ru \
--cc=musl@lists.openwall.com \
/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.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
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 NNTP newsgroup(s).