Skip to content

[PW_SID:1120064] [RFC] entry: Untangle the return value of syscall_enter_from_user_mode from syscall NR#2196

Closed
linux-riscv-bot wants to merge 2 commits into
workflow__riscv__fixesfrom
pw1120064
Closed

[PW_SID:1120064] [RFC] entry: Untangle the return value of syscall_enter_from_user_mode from syscall NR#2196
linux-riscv-bot wants to merge 2 commits into
workflow__riscv__fixesfrom
pw1120064

Conversation

@linux-riscv-bot

Copy link
Copy Markdown

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

Linux RISC-V bot and others added 2 commits July 1, 2026 03:48
… 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>
@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[RFC] entry: Untangle the return value of syscall_enter_from_user_mode from syscall NR"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 120.07 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[RFC] entry: Untangle the return value of syscall_enter_from_user_mode from syscall NR"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1392.73 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[RFC] entry: Untangle the return value of syscall_enter_from_user_mode from syscall NR"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1701.38 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[RFC] entry: Untangle the return value of syscall_enter_from_user_mode from syscall NR"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 21.89 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[RFC] entry: Untangle the return value of syscall_enter_from_user_mode from syscall NR"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 23.14 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[RFC] entry: Untangle the return value of syscall_enter_from_user_mode from syscall NR"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 2.74 seconds
Result: ERROR
Output:

ERROR: space prohibited after that '&' (ctx:WxW)
#246: FILE: arch/x86/entry/syscall_32.c:255:
+		nr &= & GENMASK(31, 0);
 		      ^

WARNING: line length of 113 exceeds 100 columns
#311: FILE: include/linux/entry-common.h:72:
+static __always_inline long syscall_trace_enter(struct pt_regs *regs, unsigned long work, unsigned long *syscall)

total: 1 errors, 1 warnings, 0 checks, 288 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

Commit 7b788c291fa0 ("entry: Untangle the return value of syscall_enter_from_user_mode from syscall NR") has style problems, please review.

NOTE: Ignored message types: ALLOC_SIZEOF_STRUCT CAMELCASE COMMIT_LOG_LONG_LINE GIT_COMMIT_ID MACRO_ARG_REUSE NO_AUTHOR_SIGN_OFF

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.
ERROR: space prohibited after that '&' (ctx:WxW)
WARNING: line length of 113 exceeds 100 columns


@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[RFC] entry: Untangle the return value of syscall_enter_from_user_mode from syscall NR"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 80.58 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[RFC] entry: Untangle the return value of syscall_enter_from_user_mode from syscall NR"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[RFC] entry: Untangle the return value of syscall_enter_from_user_mode from syscall NR"
kdoc
Desc: Detects for kdoc errors
Duration: 0.77 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[RFC] entry: Untangle the return value of syscall_enter_from_user_mode from syscall NR"
module-param
Desc: Detect module_param changes
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[RFC] entry: Untangle the return value of syscall_enter_from_user_mode from syscall NR"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.22 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[RFC] entry: Untangle the return value of syscall_enter_from_user_mode from syscall NR"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.26 seconds
Result: PASS

@linux-riscv-bot
linux-riscv-bot force-pushed the workflow__riscv__fixes branch 3 times, most recently from a50938c to 40ba5ca Compare July 8, 2026 17:32
@linux-riscv-bot
linux-riscv-bot deleted the pw1120064 branch July 9, 2026 04:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants