Re: WINE + NX (No eXecute) support for x86, 2.6.7-rc2-bk2

From: Mike McCormack
Date: Tue Jun 08 2004 - 05:08:15 EST



Really the most safe way for Wine is to create a PT_LOAD segment with
p_flags 0 covering the whole area below the executable. The kernel first
maps the executable, then the dynamic linker, so no matter what address
are ld.so and shared libraries prelinked to, they will not be mapped to the
area Wine reserves.

I did not investigate this, but others who did think that it is not possible to create a segment that is reserve only so that does not unnecessarily consume virtual memory. Apparently ELF allows it, but Linux doesn't.

Secondly the amount of memory we want to reserve depends upon the PE executable that we want to load, so varies. If we reserve only what memory we need, when possible shared libraries can be loaded at their prefered load address, and benefit from prelinking.

Making Wine a PIE is also a possible solution (at least in FC2 for
non-prelinked PIEs kernel doesn't honor ld.so's prelinked address), but
then you cannot be sure the kernel doesn't choose the addresses Wine wishes
to reserve while randomizing.

We are using a staticly linked binary (preloader) with a fixed load address at the moment, which reserves memory first, then loads ld-linux.so.2 and wine as the kernel would.

Mike
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/