From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: "Eric Blake" <eblake@redhat.com>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Fam Zheng" <famz@redhat.com>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Paolo Bonzini" <pbonzini@redhat.com>
Cc: "Philippe Mathieu-Daudé" <f4bug@amsat.org>,
qemu-devel@nongnu.org, qemu-trivial@nongnu.org
Subject: [Qemu-trivial] [PATCH for 2.10 00/35] fix bugs reported by Clang Static Analyzer
Date: Mon, 24 Jul 2017 15:27:16 -0300 [thread overview]
Message-ID: <20170724182751.18261-1-f4bug@amsat.org> (raw)
Hi,
This series is the result of having fun with Clang's Static Analyzer during
the week-end (see https://clang-analyzer.llvm.org/).
No need to delay the first batch for -rc0.
Patch 1 was in another series (delayed for 2.11), it would be nice to have it
in 2.10.
I built a docker image based on debian/unstable to use bleeding code, the
Dockerfile is provided at the end of this series as RFC for people wanted
to give a try (also include 'dockershell' script and a fix in ./configure).
These RFC patches (33-35) are not expected to enter 2.10.
I used the following commands:
$ make docker-image-debian-bleeding-dev
$ ./scripts/dockershell debian-bleeding-dev
$ mkdir -p build
$ cd build
$ ../configure --host-cc=clang-5.0 --cc=clang-5.0 --cxx=clang++-5.0 \
--disable-docs --enable-debug
$ scan-build-5.0 -o testresults --keep-going -maxloop 2 -no-failure-reports \
-analyzer-config stable-report-filename=true \
-disable-checker alpha.clone.CloneChecker \
-enable-checker alpha.core.CastSize \
-enable-checker alpha.core.Conversion \
-enable-checker alpha.core.IdenticalExpr \
-enable-checker alpha.core.SizeofPtr \
-disable-checker alpha.deadcode.UnreachableCode \
-enable-checker alpha.security.ArrayBoundV2 \
-enable-checker alpha.security.MallocOverflow \
-enable-checker alpha.unix.cstring.BufferOverlap \
-enable-checker alpha.unix.cstring.OutOfBounds \
-disable-checker deadcode.DeadStores \
-disable-checker optin.performance.Padding \
-enable-checker optin.portability.UnixAPI \
-disable-checker security.insecureAPI.getpw \
-disable-checker security.insecureAPI.gets \
-enable-checker security.insecureAPI.strcpy \
-disable-checker unix.Vfork \
make -k -j4
Regards,
Phil.
Philippe Mathieu-Daudé (35):
tests: add missing dependency to build QTEST_QEMU_BINARY
loader: check get_image_size() return value
thunk: check nb_fields is valid before continuing
ivshmem: fix incorrect error handling in ivshmem_recv_msg()
nbd: fix memory leak in nbd_opt_go()
qcow2: remove inconsistent check
qcow2: fix null pointer dereference
qcow2: fix null pointer dereference
ui/vnc: fix leak of SocketAddress **
net/eth: fix incorrect check of iov_to_buf() return value
i2c/exynos4210: correctly check i2c_recv() return value
vfio/platform: fix use of freed memory
vfio/pci: fix use of freed memory
vfio/ccw: fix incorrect malloc() size
usb: correctly handle Zero Length Packets
usb/dev-mtp: fix use of uninitialized values
usb/dev-mtp: fix use of uninitialized values
usb/dev-mtp: fix use of uninitialized values
usb/dev-mtp: fix use of uninitialized variable
arm/boot: fix undefined instruction on secondary smp cpu bootloader
arm/sysbus-fdt: fix null pointer dereference
arm/vexpress: fix potential memory leak
m68k/translate: fix incorrect copy/paste
linux-user/sh4: fix incorrect memory write
linux-user: extract is_error() out of syscall.c
linux-user: use is_error() to avoid warnings and make the code clearer
syscall: fix dereference of undefined pointer
syscall: check dup/dup2/dup3() errors, return EBADFD/EINVAL if
required
syscall: fix out-of-bound memory access
syscall: fix use of uninitialized values
syscall: replace strcpy() by g_strlcpy()
timer/pxa2xx: silent warning about out-of-bound memory access
configure: clang does not support -Wexpansion-to-defined
docker: add debian 'bleeding' image with gcc7 and clang5
script to run docker image
block/qcow2-bitmap.c | 4 +-
block/qcow2-refcount.c | 4 +-
configure | 6 +-
hw/arm/boot.c | 2 +-
hw/arm/sysbus-fdt.c | 11 ++-
hw/arm/vexpress.c | 5 +-
hw/core/loader.c | 4 +-
hw/i2c/exynos4210_i2c.c | 8 +-
hw/misc/ivshmem.c | 5 +-
hw/timer/pxa2xx_timer.c | 2 +-
hw/usb/dev-mtp.c | 60 +++++++++-----
hw/usb/redirect.c | 2 +-
hw/vfio/ccw.c | 2 +-
hw/vfio/pci.c | 11 ++-
hw/vfio/platform.c | 2 +-
linux-user/elfload.c | 2 +-
linux-user/flatload.c | 15 ++--
linux-user/qemu.h | 5 ++
linux-user/syscall.c | 45 +++++++----
nbd/client.c | 8 +-
net/eth.c | 4 +-
scripts/dockershell | 30 +++++++
target/m68k/translate.c | 3 +-
tests/Makefile.include | 2 +-
.../docker/dockerfiles/debian-bleeding-dev.docker | 94 ++++++++++++++++++++++
thunk.c | 5 +-
ui/vnc.c | 36 ++++-----
27 files changed, 279 insertions(+), 98 deletions(-)
create mode 100755 scripts/dockershell
create mode 100644 tests/docker/dockerfiles/debian-bleeding-dev.docker
--
2.13.3
next reply other threads:[~2017-07-24 18:28 UTC|newest]
Thread overview: 75+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-24 18:27 Philippe Mathieu-Daudé [this message]
2017-07-24 18:27 ` [Qemu-trivial] [PATCH for 2.10 01/35] tests: add missing dependency to build QTEST_QEMU_BINARY Philippe Mathieu-Daudé
2017-07-24 18:27 ` [Qemu-trivial] [PATCH for 2.10 02/35] loader: check get_image_size() return value Philippe Mathieu-Daudé
2017-07-24 18:38 ` Eric Blake
2017-07-24 20:59 ` [Qemu-trivial] [Qemu-devel] " Alistair Francis
2017-07-24 18:27 ` [Qemu-trivial] [PATCH for 2.10 03/35] thunk: check nb_fields is valid before continuing Philippe Mathieu-Daudé
2017-07-24 18:37 ` Eric Blake
2017-07-26 22:48 ` Philippe Mathieu-Daudé
2017-07-24 21:16 ` [Qemu-trivial] [Qemu-devel] " Peter Maydell
2017-07-24 18:27 ` [Qemu-trivial] [PATCH for 2.10 05/35] nbd: fix memory leak in nbd_opt_go() Philippe Mathieu-Daudé
2017-07-24 18:41 ` Eric Blake
2017-07-24 18:27 ` [Qemu-trivial] [PATCH for 2.10 06/35] qcow2: remove inconsistent check Philippe Mathieu-Daudé
2017-07-24 18:42 ` Eric Blake
2017-07-25 15:36 ` [Qemu-trivial] [Qemu-devel] " Paolo Bonzini
2017-07-24 18:27 ` [Qemu-trivial] [PATCH for 2.10 07/35] qcow2: fix null pointer dereference Philippe Mathieu-Daudé
2017-07-24 18:46 ` Eric Blake
2017-07-25 1:44 ` Philippe Mathieu-Daudé
2017-07-24 18:27 ` [Qemu-trivial] [PATCH for 2.10 08/35] " Philippe Mathieu-Daudé
2017-07-24 18:52 ` Eric Blake
2017-07-24 18:27 ` [Qemu-trivial] [PATCH for 2.10 09/35] ui/vnc: fix leak of SocketAddress ** Philippe Mathieu-Daudé
2017-07-25 8:37 ` [Qemu-trivial] [Qemu-devel] " Daniel P. Berrange
2017-07-24 18:27 ` [Qemu-trivial] [PATCH for 2.10 10/35] net/eth: fix incorrect check of iov_to_buf() return value Philippe Mathieu-Daudé
2017-07-26 9:51 ` Dmitry Fleytman
2017-07-24 18:27 ` [Qemu-trivial] [PATCH for 2.10 12/35] vfio/platform: fix use of freed memory Philippe Mathieu-Daudé
2017-07-25 15:37 ` [Qemu-trivial] [Qemu-devel] " Paolo Bonzini
2017-07-26 17:43 ` [Qemu-trivial] " Alex Williamson
2017-07-24 18:27 ` [Qemu-trivial] [PATCH for 2.10 13/35] vfio/pci: " Philippe Mathieu-Daudé
2017-07-25 15:38 ` [Qemu-trivial] [Qemu-devel] " Paolo Bonzini
2017-07-24 18:27 ` [Qemu-trivial] [PATCH for 2.10 14/35] vfio/ccw: fix incorrect malloc() size Philippe Mathieu-Daudé
2017-07-25 7:20 ` Cornelia Huck
2017-07-24 18:27 ` [Qemu-trivial] [PATCH for 2.10 15/35] usb: correctly handle Zero Length Packets Philippe Mathieu-Daudé
2018-05-29 14:22 ` Philippe Mathieu-Daudé
2018-05-30 6:16 ` Gerd Hoffmann
2017-07-24 18:27 ` [Qemu-trivial] [PATCH for 2.10 19/35] usb/dev-mtp: fix use of uninitialized variable Philippe Mathieu-Daudé
2017-07-24 18:27 ` [Qemu-trivial] [PATCH for 2.10 20/35] arm/boot: fix undefined instruction on secondary smp cpu bootloader Philippe Mathieu-Daudé
2017-07-24 21:06 ` Peter Maydell
2017-07-26 23:00 ` [Qemu-trivial] [Qemu-devel] " Philippe Mathieu-Daudé
2017-07-24 18:27 ` [Qemu-trivial] [PATCH for 2.10 22/35] arm/vexpress: fix potential memory leak Philippe Mathieu-Daudé
2017-07-24 21:11 ` Peter Maydell
2017-07-24 21:45 ` Philippe Mathieu-Daudé
2017-07-24 18:27 ` [Qemu-trivial] [PATCH for 2.10 23/35] m68k/translate: fix incorrect copy/paste Philippe Mathieu-Daudé
2017-07-24 18:54 ` Laurent Vivier
2017-07-24 19:01 ` Richard Henderson
2017-07-24 19:19 ` [Qemu-trivial] [Qemu-devel] " Philippe Mathieu-Daudé
2017-07-24 19:20 ` Laurent Vivier
2017-07-24 18:27 ` [Qemu-trivial] [PATCH for 2.10 24/35] linux-user/sh4: fix incorrect memory write Philippe Mathieu-Daudé
2017-07-24 18:59 ` Laurent Vivier
2017-07-24 18:27 ` [Qemu-trivial] [PATCH for 2.10 25/35] linux-user: extract is_error() out of syscall.c Philippe Mathieu-Daudé
2017-07-24 19:14 ` Laurent Vivier
2017-07-24 18:27 ` [Qemu-trivial] [PATCH for 2.10 26/35] linux-user: use is_error() to avoid warnings and make the code clearer Philippe Mathieu-Daudé
2017-07-24 19:16 ` Laurent Vivier
2018-05-29 14:25 ` [Qemu-trivial] [Qemu-devel] " Philippe Mathieu-Daudé
2018-05-29 15:19 ` Laurent Vivier
2017-07-24 18:27 ` [Qemu-trivial] [PATCH for 2.10 27/35] syscall: fix dereference of undefined pointer Philippe Mathieu-Daudé
2017-07-24 19:33 ` Laurent Vivier
2017-07-25 5:34 ` Philippe Mathieu-Daudé
2017-07-24 21:26 ` [Qemu-trivial] [Qemu-devel] " Peter Maydell
2017-07-25 7:25 ` Laurent Vivier
2017-07-24 18:27 ` [Qemu-trivial] [PATCH for 2.10 29/35] syscall: fix out-of-bound memory access Philippe Mathieu-Daudé
2017-07-24 19:41 ` Laurent Vivier
2017-07-24 18:27 ` [Qemu-trivial] [PATCH for 2.10 30/35] syscall: fix use of uninitialized values Philippe Mathieu-Daudé
2017-07-24 19:51 ` Laurent Vivier
2017-07-24 18:27 ` [Qemu-trivial] [PATCH for 2.10 31/35] syscall: replace strcpy() by g_strlcpy() Philippe Mathieu-Daudé
2017-07-24 19:28 ` Laurent Vivier
2018-05-29 14:19 ` Philippe Mathieu-Daudé
2018-05-29 15:22 ` Laurent Vivier
2017-07-24 18:27 ` [Qemu-trivial] [PATCH for 2.10 32/35] timer/pxa2xx: silent warning about out-of-bound memory access Philippe Mathieu-Daudé
2017-07-24 21:01 ` [Qemu-trivial] [Qemu-devel] " Peter Maydell
2017-07-24 21:51 ` Philippe Mathieu-Daudé
2017-07-24 18:27 ` [Qemu-trivial] [RFC PATCH for 2.10 35/35] script to run docker image Philippe Mathieu-Daudé
2017-07-25 14:12 ` Alex Bennée
2017-07-25 14:41 ` Philippe Mathieu-Daudé
2017-07-25 15:03 ` Alex Bennée
2017-07-25 15:17 ` Philippe Mathieu-Daudé
2017-07-24 21:27 ` [Qemu-trivial] [PATCH for 2.10 00/35] fix bugs reported by Clang Static Analyzer Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170724182751.18261-1-f4bug@amsat.org \
--to=f4bug@amsat.org \
--cc=alex.bennee@linaro.org \
--cc=eblake@redhat.com \
--cc=famz@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).