linux/arch/um/kernel/skas
Jinjie Ruan 7ba2ba7471 seccomp, treewide: Rename and convert __secure_computing() to return boolean
The return value of __secure_computing() currently uses 0 to indicate
that a system call should be allowed, and -1 to indicate that it should
be blocked/killed. This 0/-1 pattern is non-intuitive for a security
check function and makes the control flow at the call sites less readable.

Furthermore, any potential future changes to these return values would
require a high-risk, error-prone audit of all its users across different
architectures.

Sanitize this logic by converting the return type of __secure_computing()
to a proper boolean, where 'true' explicitly means 'allow' and 'false'
means 'fail/deny'.

Update all the two dozen or so call sites across the tree to align with
this new boolean semantic. No functional changes are intended, as the
callers still return -1 to the lower-level assembly entry code upon
seccomp denial.

Rename the function to __seccomp_permit_syscall() so that the purpose is
entirely clear.

[ tglx: Rename the function ]

Suggested-by: Thomas Gleixner <tglx@kernel.org>
Suggested-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Tested-by: Mukesh Kumar Chaurasiya (IBM) <mkchauras@gmail.com>
Reviewed-by: Mukesh Kumar Chaurasiya (IBM) <mkchauras@gmail.com>
Acked-by: Oleg Nesterov <oleg@redhat.com>
Link: https://patch.msgid.link/20260707190254.230735780@kernel.org
2026-07-12 12:38:02 +02:00
..
.gitignore um: use execveat to create userspace MMs 2024-10-10 13:37:16 +02:00
Makefile um: fix stub exe build with CONFIG_GCOV 2024-10-26 16:06:10 +02:00
mmu.c um: Fix incorrect __acquires/__releases annotations 2026-01-05 16:43:32 +01:00
process.c um: Add initial SMP support 2025-10-27 16:41:15 +01:00
stub_exe_embed.S um: use execveat to create userspace MMs 2024-10-10 13:37:16 +02:00
stub_exe.c um: pass FD for memory operations when needed 2025-06-02 16:20:10 +02:00
stub.c um: fix address-of CMSG_DATA() rvalue in stub 2026-03-21 10:41:44 +01:00
syscall.c seccomp, treewide: Rename and convert __secure_computing() to return boolean 2026-07-12 12:38:02 +02:00
uaccess.c um: Replace strncpy() with strnlen()+memcpy_and_pad() in strncpy_chunk_from_user() 2026-03-27 08:21:09 +01:00