Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1201038iob; Thu, 12 May 2022 13:33:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzlyDszYsw23x26jqanZ9sBl/5I/+LqSYN/R6BTqmyaxkt/J5iPnAwuP4oVNe+AsHWKNzXo X-Received: by 2002:a17:90b:1b4d:b0:1dc:c33c:3fc9 with SMTP id nv13-20020a17090b1b4d00b001dcc33c3fc9mr1249676pjb.123.1652387603964; Thu, 12 May 2022 13:33:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652387603; cv=none; d=google.com; s=arc-20160816; b=PyVgXqiYMftMjZ/6FNUXDjlQv+FBhk2qo2SbFGVwDc2vnz2G43djIj77L6tZUAEb+s j/UApQvzDTOGC/Gv5X5DJrfRHvXqt23djKoJEh4IheTOfvWz2ydMPHjWaKHTgcfGDvhT Yt1Gp9DQHT4x1LCBJZiGDcA6jJARux15QKBW6yiQ9hwK/Ubgnuo33xb0mxtkOiq7BCqK QSBrkXmpM4VfBa96gk1mErnrFN/Lcvyh1kXOa1/fDd3ZKW6uzRpFqIPf5epuPW/0q3k3 1LxJQRgHL8HZuAdG9RGVySKOT9WwUgcbX8D3DZgpUCGA7FlEsQyqmYtXV96GNHq6/1tt Ne7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=Oe+eQFu4e1QZYsKsCXrxNiNDLqg10Fw3jnczlhB30iI=; b=S9u6mcRmJALsDgWH45hkcrsroxxTOyBNuwhCrHDWRkfJnfWee/4c24io91xFTANfsB ld+RfzmbCq31n3Yi1j5JcfXqBRao4SgH8TqXzpgT+47N2tY18mNe/Cnh8+oHxu909qBi Uv3fwrk4wdIRXmY1wfHQ9u5Gj6qnUhWLOxMdTCi+xMlksmj4SCM8hK1TgQci6/efisef 0SbW7umyTGWmbZ5GZ+gn/U82ztlaAqKc4Wjo3bU+rfT4GOJ/tOyqwkvZxS6U6usdoYLt emEH68pxkP/wkYvPjHJr7+c9XhpvPdnroLyLWtxu/JhXYig56txt2huhkZhy+xSmf7dX T++w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o4-20020a6548c4000000b003d8204e46easi452277pgs.567.2022.05.12.13.33.09; Thu, 12 May 2022 13:33:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353578AbiELMLm (ORCPT + 99 others); Thu, 12 May 2022 08:11:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353579AbiELMLj (ORCPT ); Thu, 12 May 2022 08:11:39 -0400 Received: from brightrain.aerifal.cx (brightrain.aerifal.cx [216.12.86.13]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9F3F3D4B0 for ; Thu, 12 May 2022 05:11:33 -0700 (PDT) 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 Subject: Re: [musl] Re: [PATCH V9 13/24] LoongArch: Add system call support 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) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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