qemu-trivial
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2] hw/elf_ops.h: switch to ssize_t for elf loader return typ


From: Stefano Garzarella
Subject: Re: [PATCH v2] hw/elf_ops.h: switch to ssize_t for elf loader return type
Date: Fri, 15 Oct 2021 09:23:20 +0200

On Thu, Oct 14, 2021 at 09:43:25PM +0200, Luc Michel wrote:
Until now, int was used as the return type for all the ELF
loader related functions. The returned value is the sum of all loaded
program headers "MemSize" fields.

Because of the overflow check in elf_ops.h, trying to load an ELF bigger
than INT_MAX will fail. Switch to ssize_t to remove this limitation.

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Luc Michel <lmichel@kalray.eu>
---
v2:
 - Turn load_elf ret local variable to ssize_t [Stefano]
 - Add Phil's R-B
---
include/hw/elf_ops.h | 27 ++++++++++----------
include/hw/loader.h  | 60 ++++++++++++++++++++++----------------------
hw/core/loader.c     | 60 +++++++++++++++++++++++---------------------
3 files changed, 75 insertions(+), 72 deletions(-)

Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]