Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seccomp: Fix a couple minor things. #4353

Merged
merged 1 commit into from
Feb 13, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,9 @@ std::optional<int> SeccompEmulator::SerializeFilters(FEXCore::Core::CpuStateFram
lseek(FD, 0, SEEK_SET);

// Seal everything about this FD.
fcntl(FD, F_ADD_SEALS, F_SEAL_SEAL | F_SEAL_SHRINK | F_SEAL_GROW | F_SEAL_WRITE | F_SEAL_FUTURE_WRITE);
if (fcntl(FD, F_ADD_SEALS, F_SEAL_SEAL | F_SEAL_SHRINK | F_SEAL_GROW | F_SEAL_WRITE | F_SEAL_FUTURE_WRITE) == -1) {
LogMan::Msg::IFmt("Couldn't seal seccomp serialize FD. Nefarious code could modify");
}

return FD;
}
Expand Down Expand Up @@ -410,7 +412,7 @@ SeccompEmulator::ExecuteFilter(FEXCore::Core::CpuStateFrame* Frame, uint64_t JIT
case SECCOMP_RET_KILL_PROCESS: {
const int KillSignal = GetKillSignal();
// Ignores signal handler and sigmask
uint64_t Mask = 1 << (KillSignal - 1);
uint64_t Mask = 1ULL << (KillSignal - 1);
SignalDelegation->GuestSigProcMask(Thread, SIG_UNBLOCK, &Mask, nullptr);
SignalDelegation->UninstallHostHandler(KillSignal);
kill(0, KillSignal);
Expand Down
Loading