From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/10281 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: abort() fails to terminate PID 1 process Date: Sun, 3 Jul 2016 16:24:49 -0400 Message-ID: <20160703202448.GK15995@brightrain.aerifal.cx> References: <20160620100443.GV22574@port70.net> <20160620194110.GM10893@brightrain.aerifal.cx> <20160703135846.GF15995@brightrain.aerifal.cx> <82c4150b-3433-4e3f-2304-9aceef82a54b@skarnet.org> <20160703200125.GJ15995@brightrain.aerifal.cx> <4f7df3fa-ed15-5650-b26f-47c5225bfbf3@skarnet.org> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1467577507 6373 80.91.229.3 (3 Jul 2016 20:25:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 3 Jul 2016 20:25:07 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-10294-gllmg-musl=m.gmane.org@lists.openwall.com Sun Jul 03 22:25:05 2016 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1bJnwu-00029t-M6 for gllmg-musl@m.gmane.org; Sun, 03 Jul 2016 22:25:04 +0200 Original-Received: (qmail 21673 invoked by uid 550); 3 Jul 2016 20:25:02 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 21654 invoked from network); 3 Jul 2016 20:25:01 -0000 Content-Disposition: inline In-Reply-To: <4f7df3fa-ed15-5650-b26f-47c5225bfbf3@skarnet.org> User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:10281 Archived-At: On Sun, Jul 03, 2016 at 10:20:46PM +0200, Laurent Bercot wrote: > On 03/07/2016 22:01, Rich Felker wrote: > >No. Halting the system safely (which kernel panic does) is completely > >different from runaway wrong-code execution, and the only reason we > >don't have runaway wrong-code execution right now is because I built > >in the for(;;) safety in case termination failed. > > Halting the system, no matter how safely, is also completely different from > cleanly terminating the aborting process (while not impacting other processes > as is supposed to be guaranteed by Unix). At this point, we're wildly outside > the realm of specification anyway, and I find it acceptable to say that pid 1 > abort (or any kind of death for that matter) is UB. Your choice of > implementation for abort() is good and safe, but I think it's just QoI, > not something you're bound to do by a standard. Halting the system when init exits is functionally equivalent to having a hidden parent process provided by the OS that performs a halt when its child (pid 1) exits. There's nothing fishy going on there. On the other hand, having random code start executing would be clearly wrong well beyond mere QoI. Rich