From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 04B13C4332F for ; Wed, 11 May 2022 16:17:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344590AbiEKQRm (ORCPT ); Wed, 11 May 2022 12:17:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344658AbiEKQRe (ORCPT ); Wed, 11 May 2022 12:17:34 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7C7D23BA75 for ; Wed, 11 May 2022 09:17:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652285841; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ch8AYJSR0bVojuLA0JpsnHZw3evm/2ziMe/ALgDSt0o=; b=X8YfGfiPqkcDBms92WoEcjZAAQKyKJHqthBVN+/bG89z6C8EZ8f+a3e0oAG44JYNXUnws6 kctA0FlzcXsYyOKyOHj0G/hee8SDhPbBCHM5V4z365Pajl3OfXnyXp3QH02NghpNC+3QYF yvGj5AOIg302xL6YKuYzuodhA3wPrWw= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-152-gvGzGxhpO0KBaP3E_N9zzA-1; Wed, 11 May 2022 12:17:16 -0400 X-MC-Unique: gvGzGxhpO0KBaP3E_N9zzA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C32A380418F; Wed, 11 May 2022 16:17:15 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.192.194]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D295640CF8E4; Wed, 11 May 2022 16:17:10 +0000 (UTC) From: Florian Weimer To: Christian Brauner Cc: Arnd Bergmann , 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 Subject: Re: [PATCH V9 13/24] LoongArch: Add system call support References: <20220430090518.3127980-1-chenhuacai@loongson.cn> <20220430090518.3127980-14-chenhuacai@loongson.cn> <20220507121104.7soocpgoqkvwv3gc@wittgenstein> <20220509100058.vmrgn5fkk3ayt63v@wittgenstein> Date: Wed, 11 May 2022 18:17:09 +0200 In-Reply-To: <20220509100058.vmrgn5fkk3ayt63v@wittgenstein> (Christian Brauner's message of "Mon, 9 May 2022 12:00:58 +0200") Message-ID: <87bkw4doxm.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 Precedence: bulk List-ID: X-Mailing-List: linux-doc@vger.kernel.org * Christian Brauner: > 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. Furthermore, for glibc (and I believe musl as well), the trick with in-process emulation of clone3 using SIGSYS does not work here because we must inhibit delivery of signals on the nascent thread, before it is fully set up. This means that we have to block signals around the clone/clone3 system call, so that the new thread is created with all signals blocked. This means that instead of calling the SIGSYS handler, the filtered system call simply terminates the process. (I think there have been discussions of using out-of-process filtering, but I don't know where we are with that.) Thanks, Florian