www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/03/19/21:30:31

Message-Id: <9803200230.AA22825@gcef.gc.maricopa.edu>
Date: Thu, 19 Mar 1998 19:30:09 -0700 (MST)
From: "Joshua James Turpen" <44699 AT ef DOT gc DOT maricopa DOT edu>
To: djgpp AT delorie DOT com
Subject: Does GCC & libc assume SS == DS?

Is it safe to write code that has SS != DS?  I was hoping to be able to
allocate a descriptor, set it's base address to somewhere in my DS
(malloc'd ptr), and then set it's limit to the size of my new stack, to
catch stack faults. 

I need to do this (or something like it) for the LWP package, becuase it
currently can't catch stack faults.  

This could be done by allocating more space than I need, and then doing an
mprotect at both ends of the space (to catch stack overflow/underflow),
but a wild pointer could jump completely past the protected regions.  Is the
descriptor method a possible alternative?


Josh
44699 AT ef DOT gc DOT maricopa DOT edu

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019