From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/4491 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: install.sh is wrong with libc.so Date: Wed, 15 Jan 2014 11:31:50 -0500 Message-ID: <20140115163150.GG24286@brightrain.aerifal.cx> References: <5905c9fb-9fc8-4cf1-ac29-ed830c8ae5a1@email.android.com> <20140115121352.GG1685@port70.net> 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 1389803517 13693 80.91.229.3 (15 Jan 2014 16:31:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 15 Jan 2014 16:31:57 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-4495-gllmg-musl=m.gmane.org@lists.openwall.com Wed Jan 15 17:32:06 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 1W3TNt-0004LV-OO for gllmg-musl@plane.gmane.org; Wed, 15 Jan 2014 17:32:05 +0100 Original-Received: (qmail 9725 invoked by uid 550); 15 Jan 2014 16:32:04 -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 9717 invoked from network); 15 Jan 2014 16:32:03 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:4491 Archived-At: 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. Rich