diff options
author | Fabiano Rosas <farosas@suse.de> | 2024-03-11 20:33:35 -0300 |
---|---|---|
committer | Peter Xu <peterx@redhat.com> | 2024-03-12 15:22:23 -0400 |
commit | c827fafcaad3e8b3dcf7eeb5944b03f6b63dfc44 (patch) | |
tree | 75857aa72e6c73f3d4c34172c7d5becc7fa34719 /system/physmem.c | |
parent | 4760cedc61328e47bf7f1fabceb9937facfa4cdd (diff) | |
download | qemu-c827fafcaad3e8b3dcf7eeb5944b03f6b63dfc44.zip qemu-c827fafcaad3e8b3dcf7eeb5944b03f6b63dfc44.tar.gz qemu-c827fafcaad3e8b3dcf7eeb5944b03f6b63dfc44.tar.bz2 |
migration: Fix error handling after dup in file migration
The file migration code was allowing a possible -1 from a failed call
to dup() to propagate into the new QIOFileChannel::fd before checking
for validity. Coverity doesn't like that, possibly due to the the
lseek(-1, ...) call that would ensue before returning from the channel
creation routine.
Use the newly introduced qio_channel_file_dupfd() to properly check
the return of dup() before proceeding.
Fixes: CID 1539961
Fixes: CID 1539965
Fixes: CID 1539960
Fixes: 2dd7ee7a51 ("migration/multifd: Add incoming QIOChannelFile support")
Fixes: decdc76772 ("migration/multifd: Add mapped-ram support to fd: URI")
Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: "Daniel P. Berrangé" <berrange@redhat.com>
Link: https://lore.kernel.org/r/20240311233335.17299-3-farosas@suse.de
Signed-off-by: Peter Xu <peterx@redhat.com>
Diffstat (limited to 'system/physmem.c')
0 files changed, 0 insertions, 0 deletions