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é <f4...@amsat.org>
Signed-off-by: Luc Michel <lmic...@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 <sgarz...@redhat.com>


Reply via email to