public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mike McCormack <mike@codeweavers.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: linux-kernel@vger.kernel.org
Subject: Re: WINE + NX (No eXecute) support for x86, 2.6.7-rc2-bk2
Date: Sun, 06 Jun 2004 17:29:40 +0900	[thread overview]
Message-ID: <40C2D5F4.4020803@codeweavers.com> (raw)
In-Reply-To: <20040606052615.GA14988@elte.hu>


Hi Ingo,

Ingo Molnar wrote:

> there are multiple methods in FC1 to turn this off:
> 
> - FC1 has PT_GNU_STACK support and all binaries that have no
>   PT_GNU_STACK program header will have the stock Linux VM layout. 
>   (including executable stack/heap) So by stripping the PT_GNU_STACK 
>   header from the wine binary you get this effect.

As far as we can tell, this alone does not stop the kernel from loading 
stuff at the addresses we need.  Even without PT_GNU_STACK ld-linux.so.2 
and libc are loaded below 0x01000000, which is the region that Wine 
assumes is free.  I think this may be due to prelinking...

We (Codeweavers) build Wine on a Redhat 6.2 based machine, so 
PT_GNU_STACK is not added to the binaries.  They still don't work on 
Fedora Core 1.

> - you get the same effect by setting the personality to PER_LINUX32 via:
> 
> 	personality(PER_LINUX32);
> 
>   this is a NOP on stock x86 Linux, and turns off exec-shield on FC1.

 From the Wine project's POV, there are two problems with that solution:

1) it's not backwards compatible with older binaries

2) it's distribution specific, so other distributions could come up
    with a new method of doing the same thing.

> all these methods were present in FC1 from day 1 on. In fact we
> specifically targetted Wine (and similar applications) with these
> methods to make it easy for them to be built under FC1. (of course
> existing binaries of Wine worked and work fine because they dont have
> PT_GNU_STACK.)

The first thing we knew about exec-shield was when stuff started 
breaking. Perhaps we could work a little more closely when there's a 
possibility that Wine could break due to a new kernel feature?

Ideally the solution to the problem should be backward compatible, and 
not require any change to older binaries for them to work.

>>We developed a hack to work around this problem by creating a staticly
>>linked binary to reserve memory then load ld-linux.so.2 and a
>>dynamically executable into memory manually and run start them.
> 
> 
> while this should work too - why not one of the methods above?

It would be better to argue that with Alexandre Julliard, because he's 
the guy that chooses the solutions.  My guess is for the reasons I 
explained above.

Mike

  reply	other threads:[~2004-06-06  7:20 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-06  6:09 WINE + NX (No eXecute) support for x86, 2.6.7-rc2-bk2 Mike McCormack
2004-06-06  5:26 ` Ingo Molnar
2004-06-06  8:29   ` Mike McCormack [this message]
2004-06-06  7:32     ` Arjan van de Ven
2004-06-08  9:20       ` Jakub Jelinek
2004-06-08 11:15         ` Mike McCormack
2004-06-08 10:32           ` Ingo Molnar
2004-06-08 12:01             ` Mike McCormack
2004-06-09  1:40             ` John Reiser
2004-06-09  2:27               ` Paul Jackson
2004-06-06  7:32 ` Christoph Hellwig
2004-06-06  9:13   ` Mike McCormack
2004-06-06  8:10     ` Christoph Hellwig
2004-06-06  9:37       ` Mike McCormack
2004-06-06  8:39         ` Christoph Hellwig
2004-06-06  8:43           ` Christoph Hellwig
2004-06-06 10:20             ` Mike McCormack
2004-06-06 11:17             ` Felipe Alfaro Solana
2004-06-07  4:20         ` Horst von Brand
2004-06-07 14:19       ` Ingo Molnar
2004-06-08 21:50         ` Robert White
2004-06-08 21:57           ` Robert White
2004-06-09 16:53           ` Jesse Pollard
2004-06-09 20:53             ` Robert White
2004-06-10 13:35               ` Jesse Pollard
2004-06-10 21:13                 ` Robert White
2004-06-11  9:50                   ` Marc Bevand
2004-06-09 17:14           ` Jesper Juhl
2004-06-09 18:02             ` Evaldo Gardenali
2004-06-09 19:58             ` Felipe Alfaro Solana
2004-06-10 18:07             ` Stefanos Harhalakis
2004-06-06 11:38     ` David Woodhouse
2004-06-06 15:58       ` Mike McCormack
2004-06-07  8:49       ` David Howells
     [not found] <23Y4Y-6F5-1@gated-at.bofh.it>
     [not found] ` <240qb-8ir-7@gated-at.bofh.it>
     [not found]   ` <240Tc-gV-5@gated-at.bofh.it>
     [not found]     ` <2412S-pU-3@gated-at.bofh.it>
     [not found]       ` <24vX0-81P-7@gated-at.bofh.it>
2004-06-07 17:40         ` Andi Kleen
2004-06-08  9:42           ` Eric W. Biederman
     [not found]         ` <24WNz-4pO-3@gated-at.bofh.it>
2004-06-10 18:57           ` Bill Davidsen
2004-06-10 21:33             ` Robert White

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=40C2D5F4.4020803@codeweavers.com \
    --to=mike@codeweavers.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox