Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp166012pxb; Wed, 18 Nov 2020 00:57:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJzue6f5opk+vcoTqzpzSuIJ3rCES/yzrAlutlyF5PiudZ/I5gVmZTAXELGE1vZYkgRvkC1Y X-Received: by 2002:a17:907:435b:: with SMTP id oc19mr23916406ejb.535.1605689871419; Wed, 18 Nov 2020 00:57:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605689871; cv=none; d=google.com; s=arc-20160816; b=Gh7agbRMP9TBx0jOZu1FkxIfrQvbmQ+jH5E/9iGhRYkRMpUBVQcxemwnfrrdJ5eM1j F/L5STQiEPjUdl9SKZ3j8HCHiEV16zk+GlzxTumnLxxm2/+ynMhOGJ4oTqQmflKT5IVH 7We8Pfu7HFGBEYd8b1BTLq2rdfTa46J0BYbunzUVu7w1HAl5mBTl5lPUxOZs8hKQeA+S t9FykT2mEk2FTOU/C7xtKpSxeHcNTvVLbES8ZQW185Sqz/IJabORBAoamBaHEE0U2MS8 dM+1uUoEUghSLnEBnMrQICz1LrEU123r2o5nxQGdva6eRG0diFs2LCUy/gHnrEGkJOXP FafQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:in-reply-to:date:references:subject:cc:to:from; bh=Pcvt0AJTXjVwqnQm9/5pUZHaGBJelW41fWp4CcV+O78=; b=kgYlknnCKbEvtCfrmpYtlY32T9EpRX/Rk4HwnyCrOpBiJmdsTni/jYFoR2LvlQaFPq NVsojeQ3tnF11We7ZfYoj676uIaxPjjpRwflsTjtAHr8p6wxiUGgRWjSzwXzLtgbvLwl cXY8rnod/rk9GLHNjrEKNpa7S7q4pte4zAkevdRmj4ItIcSta50evCi03ePvs33zuJhl +/lGtPUXjSGgeaXpO9sxUmwtltTz0PZAp39kfBRSMHxO36IN2MDGB7Z5GdJXvWK99rcm +xCDD9I9k99PfW1BMd8pfEbhaJgYUNg/8pnraNQ/NGApaYBz/yERAVpc3eK3gIwf900u 9WUQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ci27si2698129ejc.495.2020.11.18.00.57.28; Wed, 18 Nov 2020 00:57:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727457AbgKRIzg convert rfc822-to-8bit (ORCPT + 99 others); Wed, 18 Nov 2020 03:55:36 -0500 Received: from albireo.enyo.de ([37.24.231.21]:60374 "EHLO albireo.enyo.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725772AbgKRIzg (ORCPT ); Wed, 18 Nov 2020 03:55:36 -0500 Received: from [172.17.203.2] (helo=deneb.enyo.de) by albireo.enyo.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) id 1kfJ8s-0000D4-23; Wed, 18 Nov 2020 08:48:42 +0000 Received: from fw by deneb.enyo.de with local (Exim 4.92) (envelope-from ) id 1kfJ8s-0001IL-02; Wed, 18 Nov 2020 09:48:42 +0100 From: Florian Weimer To: Gabriel Krisman Bertazi Cc: luto@kernel.org, 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 7/7] docs: Document Syscall User Dispatch References: <20201118032840.3429268-1-krisman@collabora.com> <20201118032840.3429268-8-krisman@collabora.com> Date: Wed, 18 Nov 2020 09:48:41 +0100 In-Reply-To: <20201118032840.3429268-8-krisman@collabora.com> (Gabriel Krisman Bertazi's message of "Tue, 17 Nov 2020 22:28:40 -0500") Message-ID: <875z63yrrq.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Gabriel Krisman Bertazi: > +Interface > +--------- > + > +A process can setup this mechanism on supported kernels > +CONFIG_SYSCALL_USER_DISPATCH) by executing the following prctl: > + > + prctl(PR_SET_SYSCALL_USER_DISPATCH, , , , [selector]) > + > + is either PR_SYS_DISPATCH_ON or PR_SYS_DISPATCH_OFF, to enable and > +disable the mechanism globally for that thread. When > +PR_SYS_DISPATCH_OFF is used, the other fields must be zero. > + > + and delimit a closed memory region interval > +from which syscalls are always executed directly, regardless of the > +userspace selector. This provides a fast path for the C library, which > +includes the most common syscall dispatchers in the native code > +applications, and also provides a way for the signal handler to return > +without triggering a nested SIGSYS on (rt_)sigreturn. Users of this > +interface should make sure that at least the signal trampoline code is > +included in this region. In addition, for syscalls that implement the > +trampoline code on the vDSO, that trampoline is never intercepted. > + > +[selector] is a pointer to a char-sized region in the process memory > +region, that provides a quick way to enable disable syscall redirection > +thread-wide, without the need to invoke the kernel directly. selector > +can be set to PR_SYS_DISPATCH_ON or PR_SYS_DISPATCH_OFF. Any other > +value should terminate the program with a SIGSYS. Is this a process property or a task/thread property? The last paragraph says “thread-wide”, but the first paragraph says “process”.