Linux emulation on FreeBSD AMD64

Kostik Belousov kostikbel at gmail.com
Sun Nov 4 09:14:56 PST 2007


On Sun, Nov 04, 2007 at 02:35:18PM +0100, Roman Divacky wrote:
> On Sun, Nov 04, 2007 at 03:23:15PM +0200, Valery V.Chikalov wrote:
> > Roman Divacky ??????????:
> > > 
> > > I am a little confused.. you are saying that
> > > 
> > > 1) oracle calls m* on 0x50000000 with PROT_EXEC but fbsd does not set it on the map
> > > 
> > > or
> > > 
> > > 2) oracle does not set this protection at all and the OS is supposed to have set on default?
> > > 
> > > roman
> > 
> > 
> > rather 3) I cant find function which oracle calls to manage memory at
> > 0x50000000, this is why I ask for help.
> > I can only state that linux_mprotect dont called with addr at 0x50000000.
> > 
> > Nov  4 12:40:14 tiger kernel: mprotect: addr:55c00000, len:4096, prot:1,
> > bsdprot:5, ret:0
> > Nov  4 12:40:14 tiger kernel: mprotect: addr:55c81000, len:4096, prot:1,
> > bsdprot:5, ret:0
> > 
> > This are only addresses which are arguments for linux_mprotect.
> > I have suspected linux_mmap_common but it not called either.
> 
> the protection can be set from mmap(), can you see if there is a mmap call with 0x50....0 ?


SysV shm is mapped by the shmat(2) syscall. linux compat implementation,
linux_shmat(), calls shmat() (this shall be fixed to use kern_shmat).

Look for the VM_PROT_READ_IS_EXEC in the sys/kern/sysv_shm.c. I think that
would explain both reason for the fault and missing mmap() calls.

It should be fixed by acting as if VM_PROT_READ_IS_EXEC is enabled if
kern_shmat() is called from linux_shmat(). This might cause some
problems when shared segment is being attached both by freebsd and
linux processes.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-emulation/attachments/20071104/b6796eab/attachment.pgp


More information about the freebsd-emulation mailing list