Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Jul 2019 19:57:49 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r349892 - head/sys/kern
Message-ID:  <201907101957.x6AJvnXa085022@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: markj
Date: Wed Jul 10 19:57:48 2019
New Revision: 349892
URL: https://svnweb.freebsd.org/changeset/base/349892

Log:
  Inherit P2_PROTMAX_{ENABLE,DISABLE} across fork().
  
  Thus, when using proccontrol(1) to disable implicit application of
  PROT_MAX within a process, child processes will inherit this setting.
  
  Discussed with:	kib
  MFC with:	r349609
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/sys/kern/kern_fork.c

Modified: head/sys/kern/kern_fork.c
==============================================================================
--- head/sys/kern/kern_fork.c	Wed Jul 10 19:32:50 2019	(r349891)
+++ head/sys/kern/kern_fork.c	Wed Jul 10 19:57:48 2019	(r349892)
@@ -465,7 +465,8 @@ do_fork(struct thread *td, struct fork_req *fr, struct
 	 */
 	p2->p_flag = P_INMEM;
 	p2->p_flag2 = p1->p_flag2 & (P2_ASLR_DISABLE | P2_ASLR_ENABLE |
-	    P2_ASLR_IGNSTART | P2_NOTRACE | P2_NOTRACE_EXEC | P2_TRAPCAP);
+	    P2_ASLR_IGNSTART | P2_NOTRACE | P2_NOTRACE_EXEC |
+	    P2_PROTMAX_ENABLE | P2_PROTMAX_DISABLE | P2_TRAPCAP);
 	p2->p_swtick = ticks;
 	if (p1->p_flag & P_PROFIL)
 		startprofclock(p2);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201907101957.x6AJvnXa085022>