Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757193AbdIHVSP (ORCPT ); Fri, 8 Sep 2017 17:18:15 -0400 Received: from mail-oi0-f67.google.com ([209.85.218.67]:38512 "EHLO mail-oi0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757069AbdIHVSM (ORCPT ); Fri, 8 Sep 2017 17:18:12 -0400 X-Google-Smtp-Source: AOwi7QCYycqUpRgU8kMkxBLw8WZLCDpXsUVgt31luU8mt6E/ytfvIf7y1W5NJUeidLcw6U05QTIQfQ== Subject: Re: execve(NULL, argv, envp) for nommu? From: Rob Landley To: Alan Cox , Geert Uytterhoeven Cc: Linux Embedded , Oleg Nesterov , dalias@libc.org, "linux-kernel@vger.kernel.org" References: <324c00d9-06a6-1fc5-83fe-5bd36d874501@landley.net> <20170905142436.262ed118@alans-desktop> Message-ID: Date: Fri, 8 Sep 2017 16:18:10 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1120 Lines: 26 On 09/05/2017 08:12 PM, Rob Landley wrote: > On 09/05/2017 08:24 AM, Alan Cox wrote: >>>> honoring the suid bit if people feel that way. I just wanna unblock >>>> vfork() while still running this code. >> >> Would it make more sense to have a way to promote your vfork into a >> fork when you hit these cases (I appreciate that fork on NOMMU has a much >> higher performance cost as you start having to softmmu copy or swap >> pages). > > It's not the performance cost, it's rewriting all the pointers. > > Without address translation, copying the existing mappings to a new > range requires finding and adjusting every pointer to the old data, > which you can do for the executable mappings in PIE* binaries, but > tracking down all the pointers on the stack, heap, and in your global > variables? Flaming pain. > > Making fork() work on nommu is basically the same problem as making > garbage collection work in C on mmu. Thus those of us who defend vfork() > from the people who don't understand why it exists periodically > suggesting we remove it. So is exec(NULL, argv, envp) a reasonable thing to want? Rob