Re: [PATCH v2 1/1] mm: pgtable: fix pte_swp_exclusive

2025-06-02 Thread Sam James
Al Viro writes: > On Sat, Apr 05, 2025 at 06:09:11PM +0100, Sam James wrote: >> Sam James writes: >> >> > Lovely cleanup and a great suggestion from Al. >> > >> > Reviewed-by: Sam James >> > >> > I'd suggest adding a: >> > Suggested-by: Al Viro >> >> Al, were you planning on taking this thro

[PATCH 2/2] arch: use always-$(KBUILD_BUILTIN) for vmlinux.lds

2025-06-02 Thread Masahiro Yamada
The extra-y syntax is deprecated. Instead, use always-$(KBUILD_BUILTIN), which behaves equivalently. Signed-off-by: Masahiro Yamada --- arch/alpha/kernel/Makefile | 2 +- arch/arc/kernel/Makefile| 2 +- arch/arm/kernel/Makefile| 2 +- arch/arm64/kernel/Makefile | 2 +-

[PATCH v3 3/7] um: Add helper functions to get/set state for SECCOMP

2025-06-02 Thread Benjamin Berg
When not using ptrace, we need to both save and restore registers through the mcontext as provided by the host kernel to our signal handlers. Add corresponding functions to store the state to an mcontext and helpers to access the mcontext of the subprocess through the stub data. Signed-off-by: Be

[PATCH v3 7/7] um: pass FD for memory operations when needed

2025-06-02 Thread Benjamin Berg
From: Benjamin Berg 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 sufficient

[PATCH v3 4/7] um: Track userspace children dying in SECCOMP mode

2025-06-02 Thread Benjamin Berg
When in seccomp mode, we would hang forever on the futex if a child has died unexpectedly. In contrast, ptrace mode will notice it and kill the corresponding thread when it fails to run it. Fix this issue using a new IRQ that is fired after a SIGCHLD and keeping an (internal) list of all MMs. In t

[PATCH v3 5/7] um: Implement kernel side of SECCOMP based process handling

2025-06-02 Thread Benjamin Berg
This adds the kernel side of the seccomp based process handling. Co-authored-by: Johannes Berg Signed-off-by: Benjamin Berg Signed-off-by: Benjamin Berg --- v1: - Fix FUTEX_WAIT EINTR handling - Don't send fatal_sigsegv when waiting during child startup --- arch/um/include/shared/common-offs

[PATCH v3 0/7] SECCOMP based userspace for UML

2025-06-02 Thread Benjamin Berg
From: Benjamin Berg Hi all, we should be getting close to a usable SECCOMP patchset now. This revision mostly fixes an issue with FP size detection and makes SECCOMP mode a runtime rather than compile time option. Benjamin v3: - Fix an issue where the FP size was not detected (memor was not sh

[PATCH v3 1/7] um: Move faultinfo extraction into userspace routine

2025-06-02 Thread Benjamin Berg
The segv handler is called slightly differently depending on whether PTRACE_FULL_FAULTINFO is set or not (32bit vs. 64bit). The only difference is that we don't try to pass the registers and instruction pointer to the segv handler. It would be good to either document or remove the difference, but

[PATCH v3 2/7] um: Add stub side of SECCOMP/futex based process handling

2025-06-02 Thread Benjamin Berg
This adds the stub side for the new seccomp process management code. In this case we do register save/restore through the signal handler mcontext. Add special code for handling TLS, which for x86_64 means setting the FS_BASE/GS_BASE registers while for i386 it means calling the set_thread_area sys

[PATCH v3 6/7] um: Add SECCOMP support detection and initialization

2025-06-02 Thread Benjamin Berg
This detects seccomp support, sets the global using_seccomp variable and initilizes the exec registers. The support is only enabled if the seccomp= kernel parameter is set to either "on" or "auto". With "auto" a fallback to ptrace mode will happen if initialization failed. Signed-off-by: Benjamin