Gonzalo Tornaria wrote:
On Mon, Mar 29, 2010 at 11:04 AM, Dr. David Kirkby
<[email protected]> wrote:
When I try the same program on sage.math, it dumps core there too. So I
don't know if sage.math has protection of the stack enabled. If it does,
then it is strange that SELinux has problems, whereas sage.math does not.

The stack is not executable by default (on NX hardware, I assume).

You can make your program work by adding something like this:

       mprotect((void*)((long)&a & ~0xfff), 0x1000,
PROT_READ|PROT_WRITE|PROT_EXEC);

before the call to fnptr(), which will make the page where a lives executable.

I don't think SELinux is installed on sage.math.

Gonzalo


I'm just puzzled why SELinux is indicating problems with code trying to execute the stack, whereas there are no such complaints on sage.math, despite the fact attempting to execute the stacks dumps core on sage.math. It makes me wonder if there is a bug in SELinux.

Perhaps some methods of checking for execution of the stack are more equal than others!


Dave

--
To post to this group, send an email to [email protected]
To unsubscribe from this group, send an email to 
[email protected]
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

To unsubscribe from this group, send email to sage-devel+unsubscribegooglegroups.com or 
reply to this email with the words "REMOVE ME" as the subject.

Reply via email to