[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <877dqivbrn.fsf@collabora.com>
Date: Wed, 18 Nov 2020 12:02:36 -0500
From: Gabriel Krisman Bertazi <krisman@...labora.com>
To: Florian Weimer <fw@...eb.enyo.de>
Cc: luto@...nel.org, tglx@...utronix.de, keescook@...omium.org,
christian.brauner@...ntu.com, peterz@...radead.org,
willy@...radead.org, shuah@...nel.org,
linux-kernel@...r.kernel.org, linux-api@...r.kernel.org,
linux-kselftest@...r.kernel.org, x86@...nel.org, gofmanp@...il.com,
kernel@...labora.com
Subject: Re: [PATCH v7 7/7] docs: Document Syscall User Dispatch
Florian Weimer <fw@...eb.enyo.de> writes:
> * 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, <op>, <offset>, <length>, [selector])
>> +
>> +<op> 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.
>> +
>> +<offset> and <offset+length> 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”.
It is per-thread, as it doesn't survive across clone/fork syscalls. I
will fix the first paragraph of this text.
--
Gabriel Krisman Bertazi
Powered by blists - more mailing lists