[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] mmap: add check if requested memory area fits t
From: |
Edgar E. Iglesias |
Subject: |
Re: [Qemu-devel] [PATCH] mmap: add check if requested memory area fits target address space |
Date: |
Sat, 6 Dec 2008 20:46:10 +0100 |
User-agent: |
Mutt/1.5.16 (2007-06-09) |
On Wed, Dec 03, 2008 at 01:29:43PM +0200, Kirill A. Shutemov wrote:
> Signed-off-by: Kirill A. Shutemov <address@hidden>
> ---
> linux-user/mmap.c | 10 ++++++++++
> 1 files changed, 10 insertions(+), 0 deletions(-)
>
> diff --git a/linux-user/mmap.c b/linux-user/mmap.c
> index d96917d..52e2dc8 100644
> --- a/linux-user/mmap.c
> +++ b/linux-user/mmap.c
> @@ -389,6 +389,16 @@ abi_long target_mmap(abi_ulong start, abi_ulong len, int
> prot,
> end = start + len;
> real_end = HOST_PAGE_ALIGN(end);
>
> + /*
> + * Test if requested memory area fits target address space
> + * It can fail only on 64-bit host with 32-bit target.
> + * On any other target/host host mmap() handles this error correctly.
> + */
> + if ((unsigned long)start + len - 1 > (abi_ulong) -1) {
> + errno = EINVAL;
> + goto fail;
> + }
> +
> for(addr = real_start; addr < real_end; addr += TARGET_PAGE_SIZE) {
> flg = page_get_flags(addr);
> if (flg & PAGE_RESERVED) {
Acked-by: Edgar E. Iglesias <address@hidden>
- [Qemu-devel] [PATCH] mmap: add check if requested memory area fits target address space, (continued)
- [Qemu-devel] [PATCH] mmap: add check if requested memory area fits target address space, Kirill A. Shutemov, 2008/12/03
- [Qemu-devel] [PATCH] mremap(): handle MREMAP_FIXED and MREMAP_MAYMOVE correctly, Kirill A. Shutemov, 2008/12/03
- [Qemu-devel] [PATCH] Fix and cleanup IPCOP_sem* ipc calls handling, Kirill A. Shutemov, 2008/12/03
- [Qemu-devel] [PATCH] Implement sem* syscalls, Kirill A. Shutemov, 2008/12/03
- [Qemu-devel] [PATCH] Fix and cleanup IPCOP_shm* ipc calls handling, Kirill A. Shutemov, 2008/12/03
- [Qemu-devel] [PATCH] Implement shm* syscalls, Kirill A. Shutemov, 2008/12/03
- [Qemu-devel] [PATCH] shmat(): use mmap_find_vma to find free memory area, Kirill A. Shutemov, 2008/12/03
- Re: [Qemu-devel] [PATCH] mremap(): handle MREMAP_FIXED and MREMAP_MAYMOVE correctly, Edgar E. Iglesias, 2008/12/06
- Re: [Qemu-devel] [PATCH] mremap(): handle MREMAP_FIXED and MREMAP_MAYMOVE correctly, Kirill A. Shutemov, 2008/12/06
- Re: [Qemu-devel] [PATCH] mremap(): handle MREMAP_FIXED and MREMAP_MAYMOVE correctly, Aurelien Jarno, 2008/12/08
- Re: [Qemu-devel] [PATCH] mmap: add check if requested memory area fits target address space,
Edgar E. Iglesias <=
- Re: [Qemu-devel] [PATCH] mmap: add check if requested memory area fits target address space, Kirill A. Shutemov, 2008/12/06
- Re: [Qemu-devel] [PATCH] mmap: add check if requested memory area fits target address space, Aurelien Jarno, 2008/12/08
- Re: [Qemu-devel] [PATCH] Rewrite mmap_find_vma() to work fine on 64-bit hosts with 32-bit targets, Paul Brook, 2008/12/03
- Re: [Qemu-devel] [PATCH] Rewrite mmap_find_vma() to work fine on 64-bit hosts with 32-bit targets, Christoph Egger, 2008/12/03
- Re: [Qemu-devel] [PATCH] Rewrite mmap_find_vma() to work fine on 64-bit hosts with 32-bit targets, Paul Brook, 2008/12/03
- Re: [Qemu-devel] [PATCH] Rewrite mmap_find_vma() to work fine on 64-bit hosts with 32-bit targets, Kirill A. Shutemov, 2008/12/03
- Re: [Qemu-devel] [PATCH] Rewrite mmap_find_vma() to work fine on 64-bit hosts with 32-bit targets, Kirill A. Shutemov, 2008/12/08
- Re: [Qemu-devel] [PATCH] Rewrite mmap_find_vma() to work fine on 64-bit hosts with 32-bit targets, Martin Mohring, 2008/12/08
- Re: [Qemu-devel] [PATCH] Rewrite mmap_find_vma() to work fine on 64-bit hosts with 32-bit targets, Martin Mohring, 2008/12/08
- Re: [Qemu-devel] [PATCH] Rewrite mmap_find_vma() to work fine on 64-bit hosts with 32-bit targets, Kirill A. Shutemov, 2008/12/08