Skip to content

Commit

Permalink
Merge pull request #3310 from Sonicadvance1/disable_clear_sighand
Browse files Browse the repository at this point in the history
FEXLoader: Temporarily disable CLONE_CLEAR_SIGHAND
  • Loading branch information
Sonicadvance1 committed Dec 6, 2023
2 parents 60b0852 + 3013103 commit 26c9d5d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Source/Tools/FEXLoader/LinuxSyscalls/Syscalls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,14 @@ static uint64_t Clone3Handler(FEXCore::Core::CpuStateFrame *Frame, FEX::HLE::clo
uint64_t CloneHandler(FEXCore::Core::CpuStateFrame *Frame, FEX::HLE::clone3_args *args) {
uint64_t flags = args->args.flags;

if (flags & CLONE_CLEAR_SIGHAND) {
// CLONE_CLEAR_SIGHAND was added in kernel 5.5. FEX doesn't properly support this.
// glibc started using this flag in 2.38 as an optimization for posix_spawn.
// If clone returns EINVAL or ENOSYS then it will fallback to the non-optimized path.
LogMan::Msg::IFmt("CLONE_CLEAR_SIGHAND passed to clone3. Returning EINVAL.");
return -EINVAL;
}

auto HasUnhandledFlags = [](FEX::HLE::clone3_args *args) -> bool {
constexpr uint64_t UNHANDLED_FLAGS =
CLONE_NEWNS |
Expand Down

0 comments on commit 26c9d5d

Please sign in to comment.