qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Daniel P . Berrangé" <berrange@redhat.com>,
	"Markus Armbruster" <armbru@redhat.com>,
	"Michael Roth" <mdroth@linux.vnet.ibm.com>,
	"Fakhri Zulkifli" <mohdfakhrizulkifli@gmail.com>,
	"Dr . David Alan Gilbert" <dgilbert@redhat.com>,
	"Sameeh Jubran" <sjubran@redhat.com>,
	"Basil Salman" <basil@daynix.com>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>,
	"Dietmar Maurer" <dietmar@proxmox.com>
Subject: [PATCH-for-5.0 v2 0/4] qga: Restrict guest-file-read count to 10 MB to avoid crashes
Date: Tue, 31 Mar 2020 16:06:34 +0200	[thread overview]
Message-ID: <20200331140638.16464-1-philmd@redhat.com> (raw)

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



             reply	other threads:[~2020-03-31 14:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-31 14:06 Philippe Mathieu-Daudé [this message]
2020-03-31 14:06 ` [PATCH-for-5.0 v2 1/4] Revert "prevent crash when executing guest-file-read with large count" Philippe Mathieu-Daudé
2020-03-31 14:12   ` Daniel P. Berrangé
2020-03-31 14:15     ` Philippe Mathieu-Daudé
2020-03-31 14:06 ` [PATCH-for-5.0 v2 2/4] qga: Extract guest_file_handle_find() to commands-common.h Philippe Mathieu-Daudé
2020-03-31 14:06 ` [PATCH-for-5.0 v2 3/4] qga: Extract qmp_guest_file_read() to common commands.c Philippe Mathieu-Daudé
2020-03-31 14:06 ` [PATCH-for-5.0 v2 4/4] qga: Restrict guest-file-read count to 10 MB to avoid crashes Philippe Mathieu-Daudé
2020-03-31 14:15   ` Daniel P. Berrangé
2020-03-31 14:17     ` Philippe Mathieu-Daudé
2020-04-02 13:09   ` Markus Armbruster
2020-04-03  9:23     ` Daniel P. Berrangé
2020-04-03 12:07       ` Markus Armbruster

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=20200331140638.16464-1-philmd@redhat.com \
    --to=philmd@redhat.com \
    --cc=armbru@redhat.com \
    --cc=basil@daynix.com \
    --cc=berrange@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=dietmar@proxmox.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=mohdfakhrizulkifli@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=sjubran@redhat.com \
    /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).