DragonFly commits List (threaded) for 2009-04
DragonFly BSD
DragonFly commits List (threaded) for 2009-04
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

DragonFly- master lib/libthread_xu/thread thr_init.c thr_stack.c

From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 23 Apr 2009 14:46:22 -0700 (PDT)

commit 2035b67992ac162a5968a22584ef29d2f53f93e2
Author: Matthew Dillon <dillon@apollo.backplane.com>
Date:   Thu Apr 23 13:05:24 2009 -0700

    Fix libthread_xu's use of MAP_STACK.  Guards were not being setup properly.
    MAP_STACK mappings do not immediately extend down to their base, so calling
    mprotect() on the base is basically a NOP.  Instead of calling mprotect() we
    call mmap() with MAP_FIXED to force the guard.
    Properly use MAP_FIXED when setting up the primary guard on the original
    user stack.  The address specified in the mmap() is only a hint when MAP_FIXED
    is not used, and will not properly map the anonymous area.  Also, new kernels
    do not allow non-MAP_STACK mappings to override MAP_STACK mappings and the
    user stack area is a MAP_STACK mapping, so use of MAP_FIXED is mandatory here.

Summary of changes:
 lib/libthread_xu/thread/thr_init.c  |    5 ++-
 lib/libthread_xu/thread/thr_stack.c |   36 ++++++++++++++++++++++------------
 2 files changed, 26 insertions(+), 15 deletions(-)


DragonFly BSD source repository

[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]