From 12ccc845a91305ba5e4498d3da9b4213a5080821 Mon Sep 17 00:00:00 2001 From: kettenis Date: Thu, 15 Jan 2015 16:31:19 +0000 Subject: [PATCH] Map the sigcode page with MAP_INHERIT_COPY to make sure it isn't shared ater a fork. ok deraadt@ --- sys/kern/kern_exec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index cfddf50f4ac..2f92dc9f7a1 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_exec.c,v 1.154 2015/01/15 10:04:26 kettenis Exp $ */ +/* $OpenBSD: kern_exec.c,v 1.155 2015/01/15 16:31:19 kettenis Exp $ */ /* $NetBSD: kern_exec.c,v 1.75 1996/02/09 18:59:28 christos Exp $ */ /*- @@ -848,7 +848,7 @@ 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_WRITE | PROT_EXEC, MAP_INHERIT_SHARE, + PROT_READ | PROT_WRITE | PROT_EXEC, MAP_INHERIT_COPY, MADV_RANDOM, UVM_FLAG_COPYONW))) { uao_detach(e->e_sigobject); return (ENOMEM); -- 2.20.1