Port-xen archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: NX bit and a.out



On 13.06.2010 09:56, Brian Marcotte wrote:
It looks like the recent patches to enable the NX bit on Xen ports has
broken a.out binaries.

I confirmed that forcing PG_NX to 0 in sys/arch/i386/include/pte.h allows
a.out programs to work.

Here is a ktrace from a small program.
[snip]
   1028      0 mpage.old CALL  mmap(0,0xe0d0,5,4,3,0,0,0)
   1028      0 mpage.old RET   mmap -1149304832/0xbb7f0000
   1028      0 mpage.old CALL  mmap(0xbb7fd000,0x1000,3,0x14,3,0,0xd000,0)
   1028      0 mpage.old RET   mmap -1149251584/0xbb7fd000
   1028      0 mpage.old CALL  mmap(0xbb7fe000,0xd0,3,0x1014,0xffffffff,0,0,0)
   1028      0 mpage.old RET   mmap -1149247488/0xbb7fe000
   1028      0 mpage.old PSIG  SIGSEGV SIG_DFL: code=SEGV_ACCERR, 
addr=0xbb7fd0e8, trap=6)
   1028      0 mpage.old NAMI  "mpage.old.core"

Hmm, quick glance, it looks like it requests a map with PROT_EXEC (0xe0d0 bytes), mmap() returns address 0xbb7f0000, then it remaps 0xbb7fd000 => 0xbb7fd000 as just RW, losing execute right in the way.

I'll have a look, thanks for reporting.

--
Jean-Yves Migeon
jeanyves.migeon%free.fr@localhost


Home | Main Index | Thread Index | Old Index