From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 23069 invoked from network); 12 May 2022 12:11:47 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 12 May 2022 12:11:47 -0000 Received: (qmail 24539 invoked by uid 550); 12 May 2022 12:11:44 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 24502 invoked from network); 12 May 2022 12:11:44 -0000 Date: Thu, 12 May 2022 08:11:31 -0400 From: Rich Felker To: Arnd Bergmann Cc: musl@lists.openwall.com, Christian Brauner , Huacai Chen , Huacai Chen , Andy Lutomirski , Thomas Gleixner , Peter Zijlstra , Andrew Morton , David Airlie , Jonathan Corbet , Linus Torvalds , linux-arch , "open list:DOCUMENTATION" , Linux Kernel Mailing List , Xuefeng Li , Yanteng Si , Guo Ren , Xuerui Wang , Jiaxun Yang , Linux API , GNU C Library Message-ID: <20220512121131.GH7074@brightrain.aerifal.cx> References: <20220430090518.3127980-1-chenhuacai@loongson.cn> <20220430090518.3127980-14-chenhuacai@loongson.cn> <20220507121104.7soocpgoqkvwv3gc@wittgenstein> <20220509100058.vmrgn5fkk3ayt63v@wittgenstein> <20220511211231.GG7074@brightrain.aerifal.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [musl] Re: [PATCH V9 13/24] LoongArch: Add system call support On Thu, May 12, 2022 at 09:21:13AM +0200, Arnd Bergmann wrote: > On Wed, May 11, 2022 at 11:12 PM Rich Felker wrote: > > On Wed, May 11, 2022 at 09:11:56AM +0200, Arnd Bergmann wrote: > > > On Mon, May 9, 2022 at 12:00 PM Christian Brauner wrote: > > > ..... > > > > I can try and move a poc for this up the todo list. > > > > > > > > Without an approach like this certain sandboxes will fallback to > > > > ENOSYSing system calls they can't filter. This is a generic problem > > > > though with clone3() being one promiment example. > > > > > > Thank you for the detailed reply. It sounds to me like this will eventually have > > > to get solved anyway, so we could move ahead without clone() on loongarch, > > > and just not have support for Chrome until this is fully solved. > > > > > > As both the glibc and musl ports are being proposed for inclusion right > > > now, we should try to come to a decision so the libc ports can adjust if > > > necessary. Adding both mailing lists to Cc here, the discussion is archived > > > at [1]. > > > > > > Arnd > > > > > > [1] https://lore.kernel.org/linux-arch/20220509100058.vmrgn5fkk3ayt63v@wittgenstein/ > > > > Having read about the seccomp issue, I think it's a very strong > > argument that __NR_clone should be kept permanently for all future > > archs. > > Ok, let's keep clone() around for all architectures then. We should probably > just remove the __ARCH_WANT_SYS_CLONE macro and build the > code into the kernel unconditionally, but at the moment there > are still private versions for ia64 and sparc with the same name as > the generic version. Both are also still lacking support for clone3() and > don't have anyone actively working on them. > > In this case, we probably don't need to change clone3() to allow the > zero-length stack after all, and the wrapper that was added to the > musl port should get removed again. I still think disallowing a zero length (unknown length with caller providing the start address only) stack is a gratuitous limitation on the clone3 interface, and would welcome leaving the change to allow zero-length in place. There does not seem to be any good justification for forbidding it, and it does pose other real-world obstruction to use. For example if your main thread had exited (or if you're forking from a non-main thread) and you wanted to create a new process using the old main thread stack as your stack, you would not know a size/lowest-address, only a starting address from which it extends some long (and possibly expanding) amount. Rich