git: kernel - Fix serious bug in MAP_STACK, deprecate auto-grow semantics

Matthew Dillon dillon at crater.dragonflybsd.org
Thu May 2 23:18:05 PDT 2019


commit d6924570fb487b28d73396f15725fb0b111082dc
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Thu May 2 23:03:32 2019 -0700

    kernel - Fix serious bug in MAP_STACK, deprecate auto-grow semantics
    
    * When MAP_STACK is used without MAP_TRYFIXED, the address the kernel
      determines for the stack was *NOT* being returned to userland.  Instead,
      userland always got only the hint address.
    
    * This fixes ruby MAP_STACK use cases and possibly more.
    
    * Deprecate MAP_STACK auto-grow semantics.  All user mmap() calls with
      MAP_STACK are now converted to normal MAP_ANON mmaps.  The kernel will
      continue to create an auto-grow stack segment for the primary user stack
      in exec(), allowing older pthread libraries to continue working, but this
      feature is deprecated and will be removed in a future release.

Summary of changes:
 sys/kern/kern_exec.c |  2 +-
 sys/vm/vm_map.c      | 20 ++++++++++----------
 sys/vm/vm_map.h      |  2 +-
 sys/vm/vm_mmap.c     | 33 ++++++++++++++++++++++++++++++---
 4 files changed, 42 insertions(+), 15 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/d6924570fb487b28d73396f15725fb0b111082dc


-- 
DragonFly BSD source repository



More information about the Commits mailing list