linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: 'Rich Felker' <dalias@libc.org>,
	Gabriel Krisman Bertazi <krisman@collabora.com>
Cc: "libc-alpha@sourceware.org" <libc-alpha@sourceware.org>,
	Florian Weimer <fw@deneb.enyo.de>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Paul Gofman <gofmanp@gmail.com>
Subject: RE: Kernel prctl feature for syscall interception and emulation
Date: Thu, 19 Nov 2020 17:57:06 +0000	[thread overview]
Message-ID: <d3734f734fbb4c3bacc8234be39f31be@AcuMS.aculab.com> (raw)
In-Reply-To: <20201119173938.GJ534@brightrain.aerifal.cx>

> > The Windows code is not completely loaded at initialization time.  It
> > also has dynamic libraries loaded later.  yes, wine knows the memory
> > regions, but there is no guarantee there is a small number of segments
> > or that the full picture is known at any given moment.
> 
> Yes, I didn't mean it was known statically at init time (although
> maybe it can be; see below) just that all the code doing the loading
> is under Wine's control (vs having system dynamic linker doing stuff
> it can't reliably see, which is the case with host libraries).

Since wine must itself make the mmap() system calls that make memory
executable can't it arrange for windows code and linux code to be
above/below some critical address?

IIRC 32bit windows has the user/kernel split at 2G, so all the
linux code could be shoe-horned into the top 1GB.

A similar boundary could be picked for 64bit code.

This would probably require flags to mmap() to map above/below
the specified address (is there a flag for the 2G boundary
these days - wine used to do very horrid things).
It might also need a special elf interpreter to load the
wine code itself high.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)


  reply	other threads:[~2020-11-19 17:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-18 18:57 Kernel prctl feature for syscall interception and emulation Gabriel Krisman Bertazi
2020-11-19 15:13 ` Rich Felker
2020-11-19 16:15   ` Gabriel Krisman Bertazi
2020-11-19 16:28     ` Rich Felker
2020-11-19 17:32       ` Gabriel Krisman Bertazi
2020-11-19 17:39         ` Rich Felker
2020-11-19 17:57           ` David Laight [this message]
2020-11-19 20:54             ` Paul Gofman
2020-11-19 21:19               ` Paul Gofman

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=d3734f734fbb4c3bacc8234be39f31be@AcuMS.aculab.com \
    --to=david.laight@aculab.com \
    --cc=dalias@libc.org \
    --cc=fw@deneb.enyo.de \
    --cc=gofmanp@gmail.com \
    --cc=krisman@collabora.com \
    --cc=libc-alpha@sourceware.org \
    --cc=linux-kernel@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).