[PATCH-for-5.0 v2 0/4] qga: Restrict guest-file-read count to 10 MB to avoid crashes

Philippe Mathieu-Daudé posted 4 patches 4 years ago
Test docker-mingw@fedora passed
Test docker-quick@centos7 passed
Test FreeBSD passed
Test checkpatch passed
Test asan passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20200331140638.16464-1-philmd@redhat.com
Maintainers: Michael Roth <mdroth@linux.vnet.ibm.com>
qga/qapi-schema.json  |  6 ++++--
qga/commands-common.h | 21 +++++++++++++++++++++
qga/commands-posix.c  | 29 +++++++----------------------
qga/commands-win32.c  | 35 ++++++++---------------------------
qga/commands.c        | 29 +++++++++++++++++++++++++++++
5 files changed, 69 insertions(+), 51 deletions(-)
create mode 100644 qga/commands-common.h
[PATCH-for-5.0 v2 0/4] qga: Restrict guest-file-read count to 10 MB to avoid crashes
Posted by Philippe Mathieu-Daudé 4 years ago
Fakhri Zulkifli reported BZ#1594054
https://bugzilla.redhat.com/show_bug.cgi?id=1594054

Dietmar Maurer noticed the fix from 807e2b6fce0 doesn't help
as error_setg() also calls malloc().

Daniel Berrangé suggested a clever fix, restrict the
guest-agent command size to avoid heap mayhem.

v1: https://www.mail-archive.com/qemu-devel@nongnu.org/msg691773.html

Philippe Mathieu-Daudé (4):
  Revert "prevent crash when executing guest-file-read with large count"
  qga: Extract guest_file_handle_find() to commands-common.h
  qga: Extract qmp_guest_file_read() to common commands.c
  qga: Restrict guest-file-read count to 10 MB to avoid crashes

 qga/qapi-schema.json  |  6 ++++--
 qga/commands-common.h | 21 +++++++++++++++++++++
 qga/commands-posix.c  | 29 +++++++----------------------
 qga/commands-win32.c  | 35 ++++++++---------------------------
 qga/commands.c        | 29 +++++++++++++++++++++++++++++
 5 files changed, 69 insertions(+), 51 deletions(-)
 create mode 100644 qga/commands-common.h

-- 
2.21.1