qemu-e2k/qga
Philippe Mathieu-Daudé f62ebb6384 Revert "prevent crash when executing guest-file-read with large count"
As noted by Daniel Berrangé in [*], the fix from commit 807e2b6fce
which replaced malloc() by try_malloc() is not enough, the process
can still run out of memory a few line later:

 346     buf = g_try_malloc0(count + 1);
 347     if (!buf) {
 348         error_setg(errp,
 349                    "failed to allocate sufficient memory "
 350                    "to complete the requested service");
 351         return NULL;
 352     }
 353     is_ok = ReadFile(fh, buf, count, &read_count, NULL);
 354     if (!is_ok) {
 355         error_setg_win32(errp, GetLastError(), "failed to read file");
 356         slog("guest-file-read failed, handle %" PRId64, handle);
 357     } else {
 358         buf[read_count] = 0;
 359         read_data = g_new0(GuestFileRead, 1);
                         ^^^^^^

Instead we are going to put a low hard limit on 'count' in the next
commits. This reverts commit 807e2b6fce.

[*] https://lists.gnu.org/archive/html/qemu-devel/2018-06/msg03471.html

Suggested-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2020-04-15 09:15:53 -05:00
..
installer qga: Installer: Wait for installation to finish 2020-03-24 11:32:19 -05:00
vss-win32 qga-win: Handle VSS_E_PROVIDER_ALREADY_REGISTERED error 2020-03-24 11:32:19 -05:00
Makefile.objs qapi: Generate command registration stuff into separate files 2020-01-14 11:01:58 +01:00
channel-posix.c socket: Add backlog parameter to socket_listen 2019-09-03 23:24:42 +02:00
channel-win32.c qga: Fix a memory leak 2020-03-09 13:36:15 +01:00
channel.h qga: add systemd socket activation support 2017-03-06 00:54:18 -06:00
commands-posix.c qga/commands-posix: fix use after free of local_err 2020-04-04 14:15:24 +02:00
commands-win32.c Revert "prevent crash when executing guest-file-read with large count" 2020-04-15 09:15:53 -05:00
commands.c qga: Fix undefined C behavior 2020-03-24 11:32:19 -05:00
guest-agent-command-state.c qga: use local path for local headers 2018-06-01 19:20:38 +03:00
guest-agent-core.h Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
main.c qemu-ga: document vsock-listen in the man page 2020-03-24 11:32:19 -05:00
qapi-schema.json qga/qapi-schema.json: minor format fixups for rST 2020-02-15 11:41:49 +01:00
service-win32.c qga: Remove unnecessary glib.h includes 2016-06-07 18:19:24 +03:00
service-win32.h qga-win: changing --retry-path option behavior 2018-10-31 09:04:20 -05:00
vss-win32.c qga-win: add support for qmp_guest_fsfreeze_freeze_list 2018-10-30 16:48:49 -05:00
vss-win32.h qga-win: add support for qmp_guest_fsfreeze_freeze_list 2018-10-30 16:48:49 -05:00