[MPlayer-dev-eng] Re: amd64 -sws 0 fix (iow: playing with NX bit)
aurel at gnuage.org
Mon Jan 24 03:07:06 CET 2005
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.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
More information about the MPlayer-dev-eng