SharedUnixLibrary and the System Heap

Matt Edgar matt at
Tue Mar 28 15:03:24 PST 2006

Alex Waugh wrote:

>>>Do you mean memory allocated by OS_Module 6, executing module code
>>>from user mode, the module private word, or something else? Those are
>>>the only things I can think of that may be accessed from user mode in
>>>the SUL.
>>I have not spent much time tracking this down, but probably all of the 
>>above are issues.
> Accessing the private word could probably be sorted out fairly easily.

Yes, switch to SVC before writing to it (was the suggestion up for 

> OS_Module allocated memory could be worked around in a backwards
> compatible manner e.g. by SUL maintaining a heap in a DA to allocate
> from.

Although this could be (haven't thought it through) a useful step, I'm 
not *sure* it fits the scope of the currently considered changes 
(because I don't know SUL well enough).

> Executing module code from user mode could not not be prevented
> without breaking backwards compatibility, and may well have large
> issues even if you didn't care about backwards compatibility.

The executing module code bit isn't the root problem, it was that the 
module code concerned is writing to memory which would be desireable not 
to be writable from user mode. In fact, if we sorted out levels of 
protection, then encouraging more (appropriate) module code to be 
executed in USR might be a change to consider.

I know it would be nice to have some more well defined/safer memory 
usage (that's the point of this change) but compatibility is important 
too, so one carefully considered step at a time!


More information about the gcc mailing list