diff options
author | 2015-01-15 10:04:26 +0000 | |
---|---|---|
committer | 2015-01-15 10:04:26 +0000 | |
commit | a47732fe6f1027224d74956bd449e1a469bea044 (patch) | |
tree | 07c51d210ec5bf9475c471980ccf3e63c22d2775 /sys/kern/kern_exec.c | |
parent | sync ssh-keysign, ssh-keygen and some dependencies to the new (diff) | |
download | wireguard-openbsd-a47732fe6f1027224d74956bd449e1a469bea044.tar.xz wireguard-openbsd-a47732fe6f1027224d74956bd449e1a469bea044.zip |
Map the sigcode page copy-on-write. This allows userland to put breakpoints
in the signal trampoline. Solves some long-standing issues with debugging
signal handlers in GDB.
ok deraadt@
Diffstat (limited to 'sys/kern/kern_exec.c')
-rw-r--r-- | sys/kern/kern_exec.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index cad14a48ed5..cfddf50f4ac 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_exec.c,v 1.153 2014/12/17 06:58:11 guenther Exp $ */ +/* $OpenBSD: kern_exec.c,v 1.154 2015/01/15 10:04:26 kettenis Exp $ */ /* $NetBSD: kern_exec.c,v 1.75 1996/02/09 18:59:28 christos Exp $ */ /*- @@ -848,7 +848,8 @@ exec_sigcode_map(struct process *pr, struct emul *e) uao_reference(e->e_sigobject); if (uvm_map(&pr->ps_vmspace->vm_map, &pr->ps_sigcode, round_page(sz), e->e_sigobject, 0, 0, UVM_MAPFLAG(PROT_READ | PROT_EXEC, - PROT_READ | PROT_EXEC, MAP_INHERIT_SHARE, MADV_RANDOM, 0))) { + PROT_READ | PROT_WRITE | PROT_EXEC, MAP_INHERIT_SHARE, + MADV_RANDOM, UVM_FLAG_COPYONW))) { uao_detach(e->e_sigobject); return (ENOMEM); } |