2
0
mirror of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-09-04 20:19:47 +08:00
linux/arch/um/include/shared
Benjamin Berg e92e255285 um: pass FD for memory operations when needed
Instead of always sharing the FDs with the userspace process, only hand
over the FDs needed for mmap when required. The idea is that userspace
might be able to force the stub into executing an mmap syscall, however,
it will not be able to manipulate the control flow sufficiently to have
access to an FD that would allow mapping arbitrary memory.

Security wise, we need to be sure that only the expected syscalls are
executed after the kernel sends FDs through the socket. This is
currently not the case, as userspace can trivially jump to the
rt_sigreturn syscall instruction to execute any syscall that the stub is
permitted to do. With this, it can trick the kernel to send the FD,
which in turn allows userspace to freely map any physical memory.

As such, this is currently *not* secure. However, in principle the
approach should be fine with a more strict SECCOMP filter and a careful
review of the stub control flow (as userspace can prepare a stack). With
some care, it is likely possible to extend the security model to SMP if
desired.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Link: https://patch.msgid.link/20250602130052.545733-8-benjamin@sipsolutions.net
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2025-06-02 16:20:10 +02:00
..
skas um: pass FD for memory operations when needed 2025-06-02 16:20:10 +02:00
arch.h um: mark rodata read-only and implement _nofault accesses 2025-03-18 11:03:14 +01:00
as-layout.h um: mark rodata read-only and implement _nofault accesses 2025-03-18 11:03:14 +01:00
common-offsets.h um: Implement kernel side of SECCOMP based process handling 2025-06-02 15:17:19 +02:00
elf_user.h um: Add SPDX headers for files in arch/um/include 2019-09-15 21:37:17 +02:00
frame_kern.h um: Add SPDX headers for files in arch/um/include 2019-09-15 21:37:17 +02:00
init.h treewide: Convert macro and uses of __section(foo) to __section("foo") 2020-10-25 14:51:49 -07:00
irq_kern.h um: fix 3 instances of -Wmissing-prototypes 2023-08-26 22:45:05 +02:00
irq_user.h um: Track userspace children dying in SECCOMP mode 2025-06-02 15:17:19 +02:00
kern_util.h um: mark rodata read-only and implement _nofault accesses 2025-03-18 11:03:14 +01:00
kern.h um: Add SPDX headers for files in arch/um/include 2019-09-15 21:37:17 +02:00
longjmp.h um: rename set_signals() to um_set_signals() 2021-12-21 21:13:44 +01:00
mem_user.h arch, mm: set max_mapnr when allocating memory map for FLATMEM 2025-03-17 22:06:52 -07:00
mem.h um: Replace to_phys() and to_virt() with less generic function names 2022-07-17 23:44:40 +02:00
os.h um: Implement kernel side of SECCOMP based process handling 2025-06-02 15:17:19 +02:00
ptrace_user.h um: Drop support for hosts without SYSEMU_SINGLESTEP support 2024-01-04 23:29:11 +01:00
registers.h um: always use the internal copy of the FP registers 2024-10-10 12:03:55 +02:00
sigio.h um: Rewrite the sigio workaround based on epoll and tgkill 2025-03-20 09:28:44 +01:00
timetravel.h um: always include kconfig.h and compiler-version.h 2024-11-07 17:36:30 +01:00
um_malloc.h This pull request contains the following changes for UML: 2024-05-25 13:17:48 -07:00
user.h um: always include kconfig.h and compiler-version.h 2024-11-07 17:36:30 +01:00