[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH, v2] mmap: add check if requested memory area fits t
From: |
Kirill A. Shutemov |
Subject: |
[Qemu-devel] [PATCH, v2] mmap: add check if requested memory area fits target address space |
Date: |
Mon, 27 Oct 2008 19:48:11 +0200 |
Signed-off-by: Kirill A. Shutemov <address@hidden>
---
linux-user/mmap.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/linux-user/mmap.c b/linux-user/mmap.c
index 6677014..b420065 100644
--- a/linux-user/mmap.c
+++ b/linux-user/mmap.c
@@ -388,6 +388,11 @@ abi_long target_mmap(abi_ulong start, abi_ulong len, int
prot,
end = start + len;
real_end = HOST_PAGE_ALIGN(end);
+ 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) {
--
1.6.0.2.GIT
- [Qemu-devel] [PATCH] mremap(): handle MREMAP_FIXED and MREMAP_MAYMOVE correctly, (continued)
- [Qemu-devel] [PATCH] mremap(): handle MREMAP_FIXED and MREMAP_MAYMOVE correctly, Kirill A. Shutemov, 2008/10/13
- [Qemu-devel] [PATCH] shmat(): use mmap_find_vma to find free memory area, Kirill A. Shutemov, 2008/10/13
- [Qemu-devel] [PATCH] mmap: add check if requested memory area fits target address space, Kirill A. Shutemov, 2008/10/17
- [Qemu-devel] [PATCH] linux-user, x86: use target_mmap() to allocate idt, gdt and ldt tables, Kirill A. Shutemov, 2008/10/17
- Re: [Qemu-devel] [PATCH] mmap: add check if requested memory area fits target address space, andrzej zaborowski, 2008/10/27
- Re: [Qemu-devel] [PATCH] mmap: add check if requested memory area fits target address space, Kirill A. Shutemov, 2008/10/27
- Re: [Qemu-devel] [PATCH] mmap: add check if requested memory area fits target address space, Andreas Schwab, 2008/10/27
- Re: [Qemu-devel] [PATCH] mmap: add check if requested memory area fits target address space, Kirill A. Shutemov, 2008/10/27
- Re: [Qemu-devel] [PATCH] mmap: add check if requested memory area fits target address space, andrzej zaborowski, 2008/10/27
- Re: [Qemu-devel] [PATCH] mmap: add check if requested memory area fits target address space, Kirill A. Shutemov, 2008/10/27
- [Qemu-devel] [PATCH, v2] mmap: add check if requested memory area fits target address space,
Kirill A. Shutemov <=
- Re: [Qemu-devel] [PATCH] mremap(): handle MREMAP_FIXED and MREMAP_MAYMOVE correctly, Vince Weaver, 2008/10/14
- Re: [Qemu-devel] [PATCH] mremap(): handle MREMAP_FIXED and MREMAP_MAYMOVE correctly, Kirill A. Shutemov, 2008/10/14
- Re: [Qemu-devel] [PATCH] Rewrite mmap_find_vma() to work fine on 64-bit hosts with 32-bit targets, Vince Weaver, 2008/10/26
- [Qemu-devel] [PATCH, v2] Rewrite mmap_find_vma() to work fine on 64-bit hosts with 32-bit targets, Kirill A. Shutemov, 2008/10/27
- Re: [Qemu-devel] [PATCH] Implement shm* syscalls + Implement sem* syscalls, Martin Mohring, 2008/10/16
- Re: [Qemu-devel] [PATCH] Implement shm* syscalls + Implement sem* syscalls, Kirill A. Shutemov, 2008/10/17
- Re: [Qemu-devel] [PATCH] Implement shm* syscalls + Implement sem* syscalls, Martin Mohring, 2008/10/17
- Re: [Qemu-devel] [PATCH] Implement shm* syscalls + Implement sem* syscalls, Kirill A. Shutemov, 2008/10/17
- [Qemu-devel] Re: [PATCH] Fix and cleanup IPCOP_sem* ipc calls handling, Kirill A. Shutemov, 2008/10/24
- Re: [Qemu-devel] [PATCH] Implement msg* syscalls, Aurelien Jarno, 2008/10/13