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 X-Spam-Level: X-Spam-Status: No, score=-3.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AD963C63697 for ; Thu, 19 Nov 2020 17:43:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 62F7121D7A for ; Thu, 19 Nov 2020 17:43:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729290AbgKSRnM (ORCPT ); Thu, 19 Nov 2020 12:43:12 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:51660 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726593AbgKSRnK (ORCPT ); Thu, 19 Nov 2020 12:43:10 -0500 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: krisman) with ESMTPSA id 4F6B71F45ABF From: Gabriel Krisman Bertazi To: luto@kernel.org, Rich Felker Cc: tglx@linutronix.de, keescook@chromium.org, christian.brauner@ubuntu.com, peterz@infradead.org, willy@infradead.org, shuah@kernel.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, linux-kselftest@vger.kernel.org, x86@kernel.org, gofmanp@gmail.com, kernel@collabora.com Subject: Re: [PATCH v7 3/7] kernel: Implement selective syscall userspace redirection Organization: Collabora References: <20201118032840.3429268-1-krisman@collabora.com> <20201118032840.3429268-4-krisman@collabora.com> Date: Thu, 19 Nov 2020 12:43:05 -0500 In-Reply-To: <20201118032840.3429268-4-krisman@collabora.com> (Gabriel Krisman Bertazi's message of "Tue, 17 Nov 2020 22:28:36 -0500") Message-ID: <87a6vdmedy.fsf@collabora.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Gabriel Krisman Bertazi writes: > Introduce a mechanism to quickly disable/enable syscall handling for a > specific process and redirect to userspace via SIGSYS. This is useful > for processes with parts that require syscall redirection and parts that > don't, but who need to perform this boundary crossing really fast, > without paying the cost of a system call to reconfigure syscall handling > on each boundary transition. This is particularly important for Windows > games running over Wine. I raised a discussion about this on libc-alpha, as requested by Florian. At the moment, there was some back and forth on why the use-case is not done by seccomp, but a more interesting point about user_notif was raised by Rich Felker (cc'ed). SIGSYS, as a signal handler, is limited in what can be done inside it. Rich suggested the user_notif design is a better solution. I understand that from a Wine perspective, SIGSYS suffices for their work, but would it make sense to extend SUD interface to support a user_notif-like interface? Would this be acceptable as future work to be added when/if needed, or should we design it from the start? The existing interface could be extended with a flags field as part of the opcode passed in argument 2, which is currently reserved, and then return a FD, just like seccomp(2) does. So it is not like the current patches couldn't be extended in the future if needed, unless I'm mistaken. -- Gabriel Krisman Bertazi