Skip to content

Commit

Permalink
Reset signal handlers to default in case this is a detach-teleport child
Browse files Browse the repository at this point in the history
  • Loading branch information
rocallahan committed Nov 30, 2024
1 parent 2c5a433 commit 419c235
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1567,6 +1567,7 @@ set(TESTS_WITH_PROGRAM
mutex_pi_stress
nested_detach_wait
nested_detach_kill_stuck
nested_release_signal
overflow_branch_counter
pack
patch_page_end
Expand Down
5 changes: 5 additions & 0 deletions src/Task.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3561,6 +3561,11 @@ static void set_up_process(Session& session, const ScopedFd& err_fd,
TraceeAttentionSet::get_original_sigmask(&sigmask);
sigprocmask(SIG_SETMASK, &sigmask, nullptr);

// Stop igoring signals.
for (int sig = 1; sig <= 31; ++sig) {
signal(sig, SIG_DFL);
}

struct NativeArch::cap_header header = {.version =
_LINUX_CAPABILITY_VERSION_3,
.pid = 0 };
Expand Down
3 changes: 3 additions & 0 deletions src/test/nested_release_signal.run
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source `dirname $0`/util.sh
just_record $RR_EXE "record --nested=detach nested_release_signal$bitness" && failed "error not propagated"
passed

0 comments on commit 419c235

Please sign in to comment.