Skip to content

qga: Restrict guest-file-read count to 10 MB to avoid crashes

Philippe Mathieu-Daudé qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest4 patches 7 repliesIn review

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4Revert "prevent crash when executing guest-file-read with large count"qga/commands-win32.c+1 -72 replies
2/4qga: Extract guest_file_handle_find() to commands-common.hqga/commands-common.h qga/commands-posix.c qga/commands-win32.c+26 -60 replies
3/4qga: Extract qmp_guest_file_read() to common commands.cqga/commands-common.h qga/commands-posix.c qga/commands-win32.c +1 more+34 -360 replies
4/4qga: Restrict guest-file-read count to 10 MB to avoid crashesqga/commands.c qga/qapi-schema.json+9 -35 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

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

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/[email protected]/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
Signature · 1 line
2.21.1