Skip to content

Commit 831436a

Browse files
committed
Also inherit PS_PROFILE on fork
This lets child processes disable/reenable profiling when they deemed appropriate. Currently the profil(0) in _mcleanup fails with EPERM for child processes. Input and ok deraadt@
1 parent da6f6cc commit 831436a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sys/kern/kern_fork.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: kern_fork.c,v 1.274 2025/08/01 13:32:53 jca Exp $ */
1+
/* $OpenBSD: kern_fork.c,v 1.275 2025/08/02 12:20:40 jca Exp $ */
22
/* $NetBSD: kern_fork.c,v 1.29 1996/02/09 18:59:34 christos Exp $ */
33

44
/*
@@ -252,7 +252,7 @@ process_new(struct proc *p, struct process *parent, int flags)
252252

253253
pr->ps_flags = parent->ps_flags &
254254
(PS_SUGID | PS_SUGIDEXEC | PS_PLEDGE | PS_EXECPLEDGE |
255-
PS_NOBTCFI | PS_WXNEEDED | PS_CHROOT);
255+
PS_NOBTCFI | PS_WXNEEDED | PS_CHROOT | PS_PROFILE);
256256
if (parent->ps_session->s_ttyvp != NULL)
257257
pr->ps_flags |= parent->ps_flags & PS_CONTROLT;
258258

0 commit comments

Comments
 (0)