Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Aug 2020 18:26:19 +0000 (UTC)
From:      Brooks Davis <brooks@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r364087 - stable/12/sys/vm
Message-ID:  <202008101826.07AIQJ5i088560@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: brooks
Date: Mon Aug 10 18:26:18 2020
New Revision: 364087
URL: https://svnweb.freebsd.org/changeset/base/364087

Log:
  MFC r363966:
  
  Preserve ASLR vm_map flags across fork
  
  In the most common case (fork+execve) this doesn't matter, but further
  attempts to apply entropy would fail in (e.g.) a pre-fork server.
  
  Reported by:	Alfredo Mazzinghi
  Reviewed by:	kib, markj
  Obtained from:	CheriBSD
  Sponsored by:	DARPA
  Differential Revision:	https://reviews.freebsd.org/D25966

Modified:
  stable/12/sys/vm/vm_map.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/vm/vm_map.c
==============================================================================
--- stable/12/sys/vm/vm_map.c	Mon Aug 10 18:11:00 2020	(r364086)
+++ stable/12/sys/vm/vm_map.c	Mon Aug 10 18:26:18 2020	(r364087)
@@ -3932,6 +3932,7 @@ vmspace_fork(struct vmspace *vm1, vm_ooffset_t *fork_c
 	}
 
 	new_map->anon_loc = old_map->anon_loc;
+	new_map->flags |= old_map->flags & (MAP_ASLR | MAP_ASLR_IGNSTART);
 
 	old_entry = old_map->header.next;
 



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