Check stack segment correctly.
[jmk] --rw-rw-r-- M 320859 glenda sys 15144 Oct 27 00:24 sys/src/9/port/sysproc.c
/n/sourcesdump/2005/1027/plan9/sys/src/9/port/sysproc.c:754,761 -
/n/sourcesdump/2005/1028/plan9/sys/src/9/port/sysproc.c:754,763
error(Ebadarg);
found:
- /* Check we are not detaching the current stack segment */
- if((ulong)arg >= s->base && (ulong)arg < s->top) {
+ /*
+ * Check we are not detaching the initial stack segment.
+ */
+ if(s == up->seg[SSEG]){
qunlock(&s->lk);
error(Ebadarg);
}
|