[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: |
Andreas Schwab |
Subject: |
Re: [Qemu-devel] [PATCH] mmap: add check if requested memory area fits target address space |
Date: |
Mon, 27 Oct 2008 16:55:07 +0100 |
User-agent: |
Gnus/5.110009 (No Gnus v0.9) Emacs/22.2 (gnu/linux) |
"Kirill A. Shutemov" <address@hidden> writes:
> On Mon, Oct 27, 2008 at 02:08:52PM +0100, andrzej zaborowski wrote:
>> On 17/10/2008, Kirill A. Shutemov <address@hidden> wrote:
>> > 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 bc20f4b..9a2f355 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 > (abi_ulong) -1) {
>> > + errno = EINVAL;
>> > + goto fail;
>> > + }
>>
>> I'm being picky but this would prevent the last byte from being used?
>> :p (or the last page because len is aligned?)
>
> No, it returns error if start + len is more than 0xFFFFFFFF (32-bit
> target).
start + len is one past the last used address.
Andreas.
--
Andreas Schwab, SuSE Labs, address@hidden
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
- [Qemu-devel] [PATCH] Implement shm* syscalls, (continued)
- [Qemu-devel] [PATCH] Implement shm* syscalls, Kirill A. Shutemov, 2008/10/13
- [Qemu-devel] [PATCH] Fix fstatat64()/newfstatat() syscall implementation, Kirill A. Shutemov, 2008/10/13
- [Qemu-devel] [PATCH] Introduce --enable-binfmt-misc configure option, Kirill A. Shutemov, 2008/10/13
- [Qemu-devel] [PATCH] Rewrite mmap_find_vma() to work fine on 64-bit hosts with 32-bit targets, Kirill A. Shutemov, 2008/10/13
- [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 <=
- 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, 2008/10/27
- 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