--- exec/hashexec.c | 9 +++++++-- libdiskfs/disk-pager.c | 4 +++- libpager/pager-memcpy.c | 11 ++++++++--- libstore/memobj.c | 11 ++++++++--- startup/startup.c | 9 ++++++--- 5 files changed, 32 insertions(+), 12 deletions(-)
diff --git a/exec/hashexec.c b/exec/hashexec.c index 9e00704..a107291 100644 --- a/exec/hashexec.c +++ b/exec/hashexec.c @@ -53,6 +53,11 @@ check_hashbang (struct execdata *e, size_t new_argvlen; mach_port_t *new_dtable = NULL; mach_msg_type_number_t new_dtablesize; + sigset_t arg_env_sigset; + + sigemptyset (&arg_env_sigset); + sigaddset (&arg_env_sigset, SIGSEGV); + sigaddset (&arg_env_sigset, SIGBUS); file_t user_fd (int fd) { @@ -293,7 +298,7 @@ check_hashbang (struct execdata *e, if (strchr (name, '/') != NULL) error = lookup (name, 0, &name_file); else if ((error = hurd_catch_signal - (sigmask (SIGBUS) | sigmask (SIGSEGV), + (arg_env_sigset, (vm_address_t) envp, (vm_address_t) envp + envplen, &search_path, SIG_ERR))) name_file = MACH_PORT_NULL; @@ -416,7 +421,7 @@ check_hashbang (struct execdata *e, } /* Set up the arguments. */ - hurd_catch_signal (sigmask (SIGSEGV) | sigmask (SIGBUS), + hurd_catch_signal (arg_env_sigset, (vm_address_t) argv, (vm_address_t) argv + argvlen, &setup_args, &fault_handler); } diff --git a/libdiskfs/disk-pager.c b/libdiskfs/disk-pager.c index 1a5d8bf..7af0e3b 100644 --- a/libdiskfs/disk-pager.c +++ b/libdiskfs/disk-pager.c @@ -29,7 +29,6 @@ struct pager_requests *diskfs_disk_pager_requests; static void fault_handler (int sig, long int sigcode, struct sigcontext *scp); static struct hurd_signal_preemptor preemptor = { - signals: sigmask (SIGSEGV) | sigmask (SIGBUS), preemptor: NULL, handler: (sighandler_t) &fault_handler, }; @@ -73,6 +72,9 @@ diskfs_start_disk_pager (struct user_pager_info *upi, /* Set up the signal preemptor to catch faults on the disk image. */ preemptor.first = (vm_address_t) *image; preemptor.last = ((vm_address_t) *image + size); + sigemptyset (&preemptor.signals); + sigaddset (&preemptor.signals, SIGSEGV); + sigaddset (&preemptor.signals, SIGBUS); hurd_preempt_signals (&preemptor); /* We have the mapping; we no longer need the send right. */ diff --git a/libpager/pager-memcpy.c b/libpager/pager-memcpy.c index caaf6f2..2ef42a7 100644 --- a/libpager/pager-memcpy.c +++ b/libpager/pager-memcpy.c @@ -208,9 +208,14 @@ pager_memcpy (struct pager *pager, memory_object_t memobj, window_size = 0; if (sigsetjmp (buf, 1) == 0) - hurd_catch_signal (sigmask (SIGSEGV) | sigmask (SIGBUS), - window, window + window_size, - &do_copy, (sighandler_t) &fault); + { + sigset_t mask; + sigemptyset (&mask); + sigaddset (&mask, SIGSEGV); + sigaddset (&mask, SIGBUS); + hurd_catch_signal (mask, window, window + window_size, + &do_copy, (sighandler_t) &fault); + } if (! err) assert_backtrace (n == 0); diff --git a/libstore/memobj.c b/libstore/memobj.c index ea2d7b9..e98e1b2 100644 --- a/libstore/memobj.c +++ b/libstore/memobj.c @@ -113,9 +113,14 @@ memobj_memcpy (memory_object_t memobj, return 0; if (sigsetjmp (buf, 1) == 0) - hurd_catch_signal (sigmask (SIGSEGV) | sigmask (SIGBUS), - window, window + windowsize, - ©, (sighandler_t) &fault); + { + sigset_t mask; + sigemptyset (&mask); + sigaddset (&mask, SIGSEGV); + sigaddset (&mask, SIGBUS); + hurd_catch_signal (mask, window, window + windowsize, + ©, (sighandler_t) &fault); + } if (window) munmap ((caddr_t) window, windowsize); diff --git a/startup/startup.c b/startup/startup.c index 862572c..27af818 100644 --- a/startup/startup.c +++ b/startup/startup.c @@ -826,9 +826,12 @@ main (int argc, char **argv, char **envp) /* All programs we start should ignore job control stop signals. That way Posix.1 B.2.2.2 is satisfied where it says that programs not run under job control shells are protected. */ - default_ints[INIT_SIGIGN] = (sigmask (SIGTSTP) - | sigmask (SIGTTIN) - | sigmask (SIGTTOU)); + sigset_t sigmask; + sigemptyset (&sigmask); + sigaddset (&sigmask, SIGTSTP); + sigaddset (&sigmask, SIGTTIN); + sigaddset (&sigmask, SIGTTOU); + default_ints[INIT_SIGIGN] = sigmask; default_ports[INIT_PORT_BOOTSTRAP] = startup; run ("/hurd/proc", default_ports, &proctask, proc_insert_ports); -- 2.39.2