All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefano Bonifazi <stefboombastic@gmail.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [PATCH] fix qruncom compilation problems
Date: Fri, 10 Dec 2010 22:43:01 +0100	[thread overview]
Message-ID: <4D029EE5.40202@gmail.com> (raw)
In-Reply-To: <4D01EA70.1040906@redhat.com>

On 12/10/2010 09:53 AM, Paolo Bonzini wrote:
> On 12/09/2010 06:29 PM, Stefano Bonifazi wrote:
>> how can one think that addresses around zero are free for a mapping??
>
> Addresses around zero are always free, because if they weren't you 
> couldn't detect NULL pointer dereferences reliably.
>
> mmap-ing at zero thus is a tricky operation, because it removes the 
> possibility to detect NULL pointer dereferences.  What's worse, such 
> ability would be lost even for _kernel_ dereferences of NULL, thus 
> opening a large security hole for privilege-escalation or kernel 
> exploits.  So, mmap-ing addresses close to zero is restricted to root.
>
> Paolo

Hi!
Thank you! Very clear explanation! :)

- So why can't I simply change the following:
> vm86_mem = mmap((void *)0x00000000, 0x110000,
>                     PROT_WRITE | PROT_READ | PROT_EXEC,
>                     MAP_FIXED|MAP_ANON | MAP_PRIVATE, -1, 0);
> page_set_flags(0x00000000, 0x110000,
>                    PAGE_WRITE | PAGE_READ | PAGE_EXEC | PAGE_VALID);
into something like:
>> vm86_mem = mmap((void *)0x00000000, 0x110000,
>>                     PROT_WRITE | PROT_READ | PROT_EXEC,
>>                     MAP_ANON | MAP_PRIVATE, -1, 0);
>> page_set_flags(vm86_mem, 0x110000+vm86_mem,
>>                    PAGE_WRITE | PAGE_READ | PAGE_EXEC | PAGE_VALID);
?


- Any luck with the tcg fatal error? I am trying to understand how tcg 
works for fixing the error.. but it is so complicated! :)
Thank You again!
Best Regards!
Stefano B.

  reply	other threads:[~2010-12-10 21:43 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-08 11:39 [Qemu-devel] Compiling tests/qruncom.c Stefano Bonifazi
2010-12-08 12:49 ` [Qemu-devel] [PATCH] fix qruncom compilation problems Paolo Bonzini
2010-12-08 21:43   ` [Qemu-devel] " Stefano Bonifazi
2010-12-09  7:16     ` Paolo Bonzini
2010-12-09 17:29       ` Stefano Bonifazi
2010-12-10  8:53         ` Paolo Bonzini
2010-12-10 21:43           ` Stefano Bonifazi [this message]
     [not found]             ` <4D02A030.6080400@redhat.com>
2010-12-11 14:42               ` [Qemu-devel] " Stefano Bonifazi
2010-12-13  8:27                 ` [Qemu-devel] " Paolo Bonzini
2010-12-09  3:32   ` [Qemu-devel] " Isaku Yamahata
2010-12-09  7:16     ` Paolo Bonzini

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=4D029EE5.40202@gmail.com \
    --to=stefboombastic@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.