From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/4492 Path: news.gmane.org!not-for-mail From: orc Newsgroups: gmane.linux.lib.musl.general Subject: Re: install.sh is wrong with libc.so Date: Thu, 16 Jan 2014 09:34:26 +0800 Message-ID: <7ece5d58-9e08-4583-9c0a-089690d0f6f9@email.android.com> References: <5905c9fb-9fc8-4cf1-ac29-ed830c8ae5a1@email.android.com> <20140115121352.GG1685@port70.net> <20140115163150.GG24286@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1389836075 7083 80.91.229.3 (16 Jan 2014 01:34:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 16 Jan 2014 01:34:35 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-4496-gllmg-musl=m.gmane.org@lists.openwall.com Thu Jan 16 02:34:44 2014 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1W3br1-000312-05 for gllmg-musl@plane.gmane.org; Thu, 16 Jan 2014 02:34:43 +0100 Original-Received: (qmail 9651 invoked by uid 550); 16 Jan 2014 01:34:41 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 9643 invoked from network); 16 Jan 2014 01:34:41 -0000 User-Agent: K-9 Mail for Android In-Reply-To: <20140115163150.GG24286@brightrain.aerifal.cx> Xref: news.gmane.org gmane.linux.lib.musl.general:4492 Archived-At: Rich Felker пишет: >On Wed, Jan 15, 2014 at 08:48:18PM +0800, orc wrote: >> Szabolcs Nagy пишет: >> >* orc [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