[PW_SID:1120064] [RFC] entry: Untangle the return value of syscall_enter_from_user_mode from syscall NR#2196
[PW_SID:1120064] [RFC] entry: Untangle the return value of syscall_enter_from_user_mode from syscall NR#2196linux-riscv-bot wants to merge 2 commits into
Conversation
… syscall NR The return value of syscall_enter_from_user_mode is used both for the adjusted syscall number and the indicator that a syscall should be skipped. As seccomp can be invoked on any syscall, including invalid ones this somewhat undermines seccomp. While the seccomp variants that terminate the process do not need to care about this for the filter that sets the syscall return value this disctinction is required. Pass the syscall number as a pointer to the inline entry functions, and use the return value exclusively for the indication that the syscall is already handled. This should avoid the need for the s390 PIF_SYSCALL_RET_SET which is the workaround for exactly this deficiency. If this is desirable the patch could be split into some series that adjusts the code flow where needed so that the final change is mostly mechanical. There is also another way to handle this problem. With x86 using bit 30 to denote compatibility syscall it sounds like declaring syscall number a 30bit quantity would work. Then bit 31 could be used to denote an invalid syscall that can never be executed, and the -1 returned from syscall_enter_from_user_mode would then be inherently invalid. That is so long as no architectures use syscall numbers outside of this range so far, and the limitation is considered fine. Signed-off-by: Michal Suchánek <msuchanek@suse.de> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
|
Patch 1: "[RFC] entry: Untangle the return value of syscall_enter_from_user_mode from syscall NR" |
|
Patch 1: "[RFC] entry: Untangle the return value of syscall_enter_from_user_mode from syscall NR" |
|
Patch 1: "[RFC] entry: Untangle the return value of syscall_enter_from_user_mode from syscall NR" |
|
Patch 1: "[RFC] entry: Untangle the return value of syscall_enter_from_user_mode from syscall NR" |
|
Patch 1: "[RFC] entry: Untangle the return value of syscall_enter_from_user_mode from syscall NR" |
|
Patch 1: "[RFC] entry: Untangle the return value of syscall_enter_from_user_mode from syscall NR" |
|
Patch 1: "[RFC] entry: Untangle the return value of syscall_enter_from_user_mode from syscall NR" |
|
Patch 1: "[RFC] entry: Untangle the return value of syscall_enter_from_user_mode from syscall NR" |
|
Patch 1: "[RFC] entry: Untangle the return value of syscall_enter_from_user_mode from syscall NR" |
|
Patch 1: "[RFC] entry: Untangle the return value of syscall_enter_from_user_mode from syscall NR" |
|
Patch 1: "[RFC] entry: Untangle the return value of syscall_enter_from_user_mode from syscall NR" |
|
Patch 1: "[RFC] entry: Untangle the return value of syscall_enter_from_user_mode from syscall NR" |
a50938c to
40ba5ca
Compare
PR for series 1120064 applied to workflow__riscv__fixes
Name: [RFC] entry: Untangle the return value of syscall_enter_from_user_mode from syscall NR
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1120064
Version: 1