Skip to content
Snippets Groups Projects
  • Tobias Koch's avatar
    56d19084
    linux-user/mmap.c: check range of mremap result in target address space · 56d19084
    Tobias Koch authored
    
    If mremap succeeds, an additional check is performed to ensure that the
    new address range fits into the target address space. This check was
    previously perfomed in host address space, with the upper bound fixed to
    abi_ulong.
    
    This patch replaces the static check with a call to `guest_range_valid`,
    performing the range check against the actual size of the target address
    space. It also moves the corresponding block to prevent it from being
    called incorrectly when the mapping itself fails.
    
    Signed-off-by: default avatarTobias Koch <tobias.koch@nonterra.com>
    Message-Id: <20201028213833.26592-1-tobias.koch@nonterra.com>
    Signed-off-by: default avatarLaurent Vivier <laurent@vivier.eu>
    56d19084
    History
    linux-user/mmap.c: check range of mremap result in target address space
    Tobias Koch authored
    
    If mremap succeeds, an additional check is performed to ensure that the
    new address range fits into the target address space. This check was
    previously perfomed in host address space, with the upper bound fixed to
    abi_ulong.
    
    This patch replaces the static check with a call to `guest_range_valid`,
    performing the range check against the actual size of the target address
    space. It also moves the corresponding block to prevent it from being
    called incorrectly when the mapping itself fails.
    
    Signed-off-by: default avatarTobias Koch <tobias.koch@nonterra.com>
    Message-Id: <20201028213833.26592-1-tobias.koch@nonterra.com>
    Signed-off-by: default avatarLaurent Vivier <laurent@vivier.eu>
mmap.c 24.78 KiB