[MPlayer-dev-eng] Re: amd64 -sws 0 fix (iow: playing with NX bit)

Reimar =?UTF8?Q?D=F6ffinger?= Reimar.Doeffinger at stud.uni-karlsruhe.de
Mon Jan 24 13:31:05 CET 2005


On Mon, Jan 24, 2005 at 03:07:06AM +0100, Aurelien Jacobs wrote:
> On Fri, 21 Jan 2005 21:40:34 +0100
> Alex Beregszaszi <alex at fsn.hu> wrote:
> > > > trivial diff to disable NX bit via mprotect().
> > > 
> > > Very nice ! That's exactly what I was looking for.
> > > But your code has a small problem. The pointer you pass to mprotect
> > > is not aligned on a PAGESIZE (which is required by mprotect).
> > 
> > What about aligning the funnycode stuff ? so no non-appropriate part of
> > the memory would be set to exec enable
> 
> Right ! That would be more secure.
> I first wanted to achieve this trivially by using
> __attribute__((aligned(PAGESIZE))) but it seems that the linker don't
> accept too high alignment values.
> So I finally used a memalign() block to store the funny code.
> This patch is now better.

How about just using anonymous mmap instead of malloc+mprotect?
According to my understandig of its manpage it should work...

Greetings,
Reimar D?ffinger




More information about the MPlayer-dev-eng mailing list