[haiku-bugs] Re: [Haiku] #8233: Patch for pthread_attr_getguardsize

  • From: "hamish" <trac@xxxxxxxxxxxx>
  • Date: Fri, 06 Apr 2012 01:19:18 -0000

#8233: Patch for pthread_attr_getguardsize
   Reporter:  unitedroad  |      Owner:  bonefish
       Type:              |     Status:  assigned
  enhancement             |  Milestone:  R1
   Priority:  normal      |    Version:  R1/Development
  Component:              |   Keywords:  pthread, pthread_attr_getguardsize
  System/POSIX            |   Blocking:
 Resolution:              |   Platform:  All
 Blocked By:              |
Has a Patch:  1           |

Comment (by hamish):

 Replying to [comment:12 bonefish]:
 > otherwise after `fork()`ing one could write in the guard range

 Hmm. As it stands now, after a `fork()` the guard pages of the parent
 thread's stack become writeable. I'm guessing this is because
 `vm_copy_on_write_area()` doesn't take into account the guard size
 (http://cgit.haiku-os.org/haiku/tree/src/system/kernel/vm/vm.cpp#n2304) of
 the existing cache.

 However even when `vm_copy_on_write_area()` does take the guard size into
 account, the guard region logic in `VMAnonymousCache::Fault()` is only
 considered if overcommiting is on (which it isn't for the copy cache). Is
 there any good reason why this is so?

Ticket URL: <http://dev.haiku-os.org/ticket/8233#comment:13>
Haiku <http://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: