Re: [Qemu-devel] [PATCH] elf-ops.h: fix int overflow in load_elf()

2019-09-10 Thread Alex Bennée
Stefano Garzarella writes: > On Tue, Sep 10, 2019 at 10:50:30AM +0100, Alex Bennée wrote: >> >> Stefano Garzarella writes: >> >> > This patch fixes a possible integer overflow when we calculate >> > the total size of ELF segments loaded. >> > >> > Reported-by: Coverity (CID 1405299) >> > Signe

Re: [Qemu-devel] [PATCH] elf-ops.h: fix int overflow in load_elf()

2019-09-10 Thread Stefano Garzarella
On Tue, Sep 10, 2019 at 10:50:30AM +0100, Alex Bennée wrote: > > Stefano Garzarella writes: > > > This patch fixes a possible integer overflow when we calculate > > the total size of ELF segments loaded. > > > > Reported-by: Coverity (CID 1405299) > > Signed-off-by: Stefano Garzarella > > --- >

Re: [Qemu-devel] [PATCH] elf-ops.h: fix int overflow in load_elf()

2019-09-10 Thread Stefano Garzarella
On Tue, Sep 10, 2019 at 10:54:25AM +0100, Peter Maydell wrote: > On Tue, 10 Sep 2019 at 10:50, Alex Bennée wrote: > > Seem sensible enough (although gah, I hate these glue bits). Would the > > large amount of goto fail logic be something that could be cleaned up > > with the automatic cleanup func

Re: [Qemu-devel] [PATCH] elf-ops.h: fix int overflow in load_elf()

2019-09-10 Thread Peter Maydell
On Tue, 10 Sep 2019 at 10:50, Alex Bennée wrote: > Seem sensible enough (although gah, I hate these glue bits). Would the > large amount of goto fail logic be something that could be cleaned up > with the automatic cleanup functions we recently mentioned in > CODING_STYLE.rst? Probably not, becau

Re: [Qemu-devel] [PATCH] elf-ops.h: fix int overflow in load_elf()

2019-09-10 Thread Daniel P . Berrangé
On Tue, Sep 10, 2019 at 10:50:30AM +0100, Alex Bennée wrote: > > Stefano Garzarella writes: > > > This patch fixes a possible integer overflow when we calculate > > the total size of ELF segments loaded. > > > > Reported-by: Coverity (CID 1405299) > > Signed-off-by: Stefano Garzarella > > --- >

Re: [Qemu-devel] [PATCH] elf-ops.h: fix int overflow in load_elf()

2019-09-10 Thread Alex Bennée
Stefano Garzarella writes: > This patch fixes a possible integer overflow when we calculate > the total size of ELF segments loaded. > > Reported-by: Coverity (CID 1405299) > Signed-off-by: Stefano Garzarella > --- > Now we are limited to INT_MAX, should load_elf() returns ssize_t > to support

Re: [Qemu-devel] [PATCH] elf-ops.h: fix int overflow in load_elf()

2019-09-10 Thread Stefano Garzarella
On Tue, Sep 10, 2019 at 10:37:28AM +0100, Peter Maydell wrote: > On Tue, 10 Sep 2019 at 10:08, Stefano Garzarella wrote: > > > > This patch fixes a possible integer overflow when we calculate > > the total size of ELF segments loaded. > > > > Reported-by: Coverity (CID 1405299) > > Signed-off-by:

Re: [Qemu-devel] [PATCH] elf-ops.h: fix int overflow in load_elf()

2019-09-10 Thread Peter Maydell
On Tue, 10 Sep 2019 at 10:08, Stefano Garzarella wrote: > > This patch fixes a possible integer overflow when we calculate > the total size of ELF segments loaded. > > Reported-by: Coverity (CID 1405299) > Signed-off-by: Stefano Garzarella > --- > Now we are limited to INT_MAX, should load_elf()

[Qemu-devel] [PATCH] elf-ops.h: fix int overflow in load_elf()

2019-09-10 Thread Stefano Garzarella
This patch fixes a possible integer overflow when we calculate the total size of ELF segments loaded. Reported-by: Coverity (CID 1405299) Signed-off-by: Stefano Garzarella --- Now we are limited to INT_MAX, should load_elf() returns ssize_t to support bigger ELFs? --- include/hw/elf_ops.h | 6 ++