On Thu, Oct 07, 2010 at 05:23:12PM +0200, WAROQUIERS Philippe wrote:
> >mmap(0x402001000, 4194304, PROT_READ|PROT_WRITE|PROT_EXEC,
> >MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, 0, 0) = -1 EPERM
> >(Operation not permitted)
> >getpid()                                = 27233
> >
> >This is probably due to grsecurity kernel but I am not sure
> >why, it has worked
> >before on a 32 bit system.
> According to the mmap manual on my system (red-hat 5.2),
> EPERM on mmap means:
>    PROT_EXEC asked but mapped file is on a file system mounted no-exec.
> 
> But the call above does not map a file.
> The documentation also says that if MAP_ANONYMOUS is given, the fd arg
> is ignored but that some implementations require fd to be -1 in this
> case
> and recommends that portable implementations gives -1.
> (it looks like valgrind does not follow this recommendation, but it is
> unclear
> if that is the cause of your problem). I guess it is easy to patch
> valgrind
> to give -1 instead of 0 for map_anonymous.
> 
> But the grsecurity features are probably the most probably guilty.
> 
> Philippe
> 
Yep. It seems that grsecurity has nowadays feature which prevents any RWX
mappings silently. Luckily paxctl -m disables that. Hope this helps anyone
else who runs into this. Although you need to do that for

Yep. It seems that grsecurity has nowadays feature which prevents any RWX
mappings silently. Luckily paxctl -m disables that. Hope this helps anyone
else who runs into this. Although you need to do that for

/usr/lib/valgrind/memcheck-amd64-linux

or equivalent, as it execve's this and it's the actual failing binary.

Aki Tuomi

Attachment: signature.asc
Description: Digital signature

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to