commit_msg
stringlengths 1
24.2k
| commit_hash
stringlengths 2
84
⌀ | project
stringlengths 2
40
| source
stringclasses 4
values | labels
int64 0
1
| repo_url
stringlengths 26
70
⌀ | commit_url
stringlengths 74
118
⌀ | commit_date
stringlengths 25
25
⌀ |
---|---|---|---|---|---|---|---|
osdep.h: Prohibit disabling assert() in supported builds
We already have several files that knowingly require assert()
to work, sometimes because refactoring the code for proper
error handling has not been tackled yet; there are probably
other files that have a similar situation but with no comments
documenting the same. In fact, we have places in migration
that handle untrusted input with assertions, where disabling
the assertions risks a worse security hole than the current
behavior of losing the guest to SIGABRT when migration fails
because of the assertion. Promote our current per-file
safety-valve to instead be project-wide, and expand it to also
cover glib's g_assert().
Note that we do NOT want to encourage 'assert(side-effects);'
(that is a bad practice that prevents copy-and-paste of code to
other projects that CAN disable assertions; plus it costs
unnecessary reviewer mental cycles to remember whether a project
special-cases the crippling of asserts); and we would LIKE to
fix migration to not rely on asserts (but that takes a big code
audit). But in the meantime, we DO want to send a message
that anyone that disables assertions has to tweak code in order
to compile, making it obvious that they are taking on additional
risk that we are not going to support. At the same time, leave
comments mentioning NDEBUG in files that we know still need to
be scrubbed, so there is at least something to grep for.
It would be possible to come up with some other mechanism for
doing runtime checking by default, but which does not abort
the program on failure, while leaving side effects in place
(unlike how crippling assert() avoids even the side effects),
perhaps under the name q_verify(); but it was not deemed worth
the effort (developers should not have to learn a replacement
when the standard C macro works just fine, and it would be a lot
of churn for little gain). The patch specifically uses #error
rather than #warn so that a user is forced to tweak the header
to acknowledge the issue, even when not using a -Werror
compilation.
Signed-off-by: Eric Blake <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Thomas Huth <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
| 262a69f4282e44426c7a132138581d400053e0a1 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/262a69f4282e44426c7a132138581d400053e0a1 | 2017-09-19 16:20:49+02:00 |
vga: stop passing pointers to vga_draw_line* functions
Instead pass around the address (aka offset into vga memory).
Add vga_read_* helper functions which apply vbe_size_mask to
the address, to make sure the address stays within the valid
range, similar to the cirrus blitter fixes (commits ffaf857778
and 026aeffcb4).
Impact: DoS for privileged guest users. qemu crashes with
a segfault, when hitting the guard page after vga memory
allocation, while reading vga memory for display updates.
Fixes: CVE-2017-13672
Cc: P J P <[email protected]>
Reported-by: David Buchanan <[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
Message-id: [email protected]
| 3d90c6254863693a6b13d918d2b8682e08bbc681 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/3d90c6254863693a6b13d918d2b8682e08bbc681 | 2017-09-01 13:52:43+02:00 |
qcow: fix memory leaks related to encryption
Fix leak of the 'encryptopts' string, which was mistakenly
declared const.
Fix leak of QemuOpts entry which should not have been deleted
from the opts array.
Reported by: coverity
Signed-off-by: Daniel P. Berrange <[email protected]>
Message-id: [email protected]
Reviewed-by: Eric Blake <[email protected]>
Signed-off-by: Max Reitz <[email protected]>
| 0696ae2c9236a3589f5eaf5b00c12868b6f30a17 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/0696ae2c9236a3589f5eaf5b00c12868b6f30a17 | 2017-07-25 16:33:31+02:00 |
target/arm: fix TCG temp leak in aarch64 rev16
Fix a TCG temporary leak in the new aarch64 rev16 handling.
Signed-off-by: Emilio G. Cota <[email protected]>
Reviewed-by: Peter Maydell <[email protected]>
Signed-off-by: Peter Maydell <[email protected]>
| e4256c3cbf7eefebc0bc6e1f472c47c6dd20b996 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/e4256c3cbf7eefebc0bc6e1f472c47c6dd20b996 | 2017-07-24 17:59:28+01:00 |
target/alpha: Fix temp leak in gen_call_pal
Tested-by: Emilio G. Cota <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
| f401c0321f3b6483a5929265db809005993b1167 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/f401c0321f3b6483a5929265db809005993b1167 | 2017-07-18 18:42:00-10:00 |
target/alpha: Fix temp leak in gen_mtpr
Tested-by: Emilio G. Cota <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
| a4535b8e3ef2b41e0e7d42293db912d44ad812f0 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/a4535b8e3ef2b41e0e7d42293db912d44ad812f0 | 2017-07-18 18:41:58-10:00 |
target/sh4: Tidy misc illegal insn checks
Now that we have a do_illegal label, use goto in order
to self-document the forcing of the exception.
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Aurelien Jarno <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
Message-Id: <[email protected]>
[aurel32: fix whitespace issues]
Signed-off-by: Aurelien Jarno <[email protected]>
| 93dc9c89640bd4aa5e49d672209b5509e3afa7e8 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/93dc9c89640bd4aa5e49d672209b5509e3afa7e8 | 2017-07-18 23:39:17+02:00 |
vvfat: initialize memory after allocating it
This prevents some host to guest memory content leaks.
Fixes: https://bugs.launchpad.net/qemu/+bug/1599539
Signed-off-by: Hervé Poussineau <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
| f80256b7eebfbe20683b3a2b2720ad9991313761 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/f80256b7eebfbe20683b3a2b2720ad9991313761 | 2017-07-18 15:14:36+02:00 |
spapr: fix memory leak in spapr_core_pre_plug()
In case of error, we must ensure the dynamically allocated base_core_type
is freed, like it is done everywhere else in this function.
This is a regression introduced in QEMU 2.9 by commit 8149e2992f78.
Signed-off-by: Greg Kurz <[email protected]>
Signed-off-by: David Gibson <[email protected]>
| df8658de43db242ea82183d75cc957c2b0fa013a | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/df8658de43db242ea82183d75cc957c2b0fa013a | 2017-07-17 15:07:05+10:00 |
vmgenid-test: use boot-sector infrastructure
There's no requirement for RSDP to be installed last
by the firmware, so in rare cases vmgen id test hits
a race: RSDP is there but VM GEN ID isn't.
To fix, switch to common boot sector infrastructure.
Cc: Laszlo Ersek <[email protected]>
Cc: Peter Maydell <[email protected]>
Cc: Ben Warren <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
Reviewed-by: Ben Warren <[email protected]>
Message-id: [email protected]
Signed-off-by: Peter Maydell <[email protected]>
| 4871b51b9241b10f4fd8e04bbb21577886795e25 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/4871b51b9241b10f4fd8e04bbb21577886795e25 | 2017-07-14 17:03:03+01:00 |
slirp: Handle error returns from sosendoob()
sosendoob() can return a failure code, but all its callers ignore it.
This is OK in sbappend(), as the comment there states -- we will try
again later in sowrite(). Add a (void) cast to tell Coverity so.
In sowrite() we do need to check the return value -- we should handle
a write failure in sosendoob() the same way we handle a write failure
for the normal data.
Signed-off-by: Peter Maydell <[email protected]>
Reviewed-by: Dr. David Alan Gilbert <[email protected]>
Signed-off-by: Samuel Thibault <[email protected]>
| 75cb298d905030fca897ea1d80e409c7f7e3e5ea | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/75cb298d905030fca897ea1d80e409c7f7e3e5ea | 2017-07-15 14:28:25+02:00 |
hid: Reset kbd modifiers on reset
When resetting the keyboard, we need to reset not just the pending keystrokes,
but also any pending modifiers. Otherwise there's a race when we're getting
reset while running an escape sequence (modifier 0x100).
Cc: [email protected]
Signed-off-by: Alexander Graf <[email protected]>
Message-id: [email protected]
Signed-off-by: Gerd Hoffmann <[email protected]>
| 51dbea77a29ea46173373a6dad4ebd95d4661f42 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/51dbea77a29ea46173373a6dad4ebd95d4661f42 | 2017-06-23 11:50:05+02:00 |
spapr: introduce the XIVE_EXPLOIT option in CAS
On POWER9, the Client Architecture Support (CAS) negotiation process
determines whether the guest operates in XIVE Legacy compatibility
(the former POWER8 interrupt model) or in XIVE exploitation mode (the
newer POWER9 interrupt model).
Bit 7 of Byte 23 of vector 5 is used for this purpose.
Signed-off-by: Cédric Le Goater <[email protected]>
Signed-off-by: David Gibson <[email protected]>
| f2b14e3a9f2e6c6c35a90dd282ea55e8bcb61b8d | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/f2b14e3a9f2e6c6c35a90dd282ea55e8bcb61b8d | 2017-07-11 11:04:02+10:00 |
pseries: Correct panic behaviour for pseries machine type
The pseries machine type doesn't usually use the 'pvpanic' device as such,
because it has a firmware/hypervisor facility with roughly the same
purpose. The 'ibm,os-term' RTAS call notifies the hypervisor that the
guest has crashed.
Our implementation of this call was sending a GUEST_PANICKED qmp event;
however, it was not doing the other usual panic actions, making its
behaviour different from pvpanic for no good reason.
To correct this, we should call qemu_system_guest_panicked() rather than
directly sending the panic event.
Signed-off-by: David Gibson <[email protected]>
Reviewed-by: Thomas Huth <[email protected]>
| 2c5534776b375bbaff3896420e41cb981d40e2bc | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/2c5534776b375bbaff3896420e41cb981d40e2bc | 2017-06-08 14:38:18+10:00 |
usb: don't wakeup during coldplug
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1452512
Signed-off-by: Gerd Hoffmann <[email protected]>
Message-id: [email protected]
| 26022652c6fd067b9fa09280f5a6d6284a21c73f | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/26022652c6fd067b9fa09280f5a6d6284a21c73f | 2017-05-29 14:18:09+02:00 |
stream: fix crash in stream_start() when block_job_create() fails
The code that tries to reopen a BlockDriverState in stream_start()
when the creation of a new block job fails crashes because it attempts
to dereference a pointer that is known to be NULL.
This is a regression introduced in a170a91fd3eab6155da39e740381867e,
likely because the code was copied from stream_complete().
Cc: [email protected]
Reported-by: Kashyap Chamarthy <[email protected]>
Signed-off-by: Alberto Garcia <[email protected]>
Tested-by: Kashyap Chamarthy <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
| 525989a50a70ea0ffa2b1cdf56279765bb2b7de0 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/525989a50a70ea0ffa2b1cdf56279765bb2b7de0 | 2017-05-26 16:48:21+02:00 |
usb-redir: fix stack overflow in usbredir_log_data
Don't reinvent a broken wheel, just use the hexdump function we have.
Impact: low, broken code doesn't run unless you have debug logging
enabled.
Reported-by: 李强 <[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
Message-id: [email protected]
| bd4a683505b27adc1ac809f71e918e58573d851d | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/bd4a683505b27adc1ac809f71e918e58573d851d | 2017-05-12 12:26:40+02:00 |
audio: release capture buffers
AUD_add_capture() allocates two buffers which are never released.
Add the missing calls to AUD_del_capture().
Impact: Allows vnc clients to exhaust host memory by repeatedly
starting and stopping audio capture.
Fixes: CVE-2017-8309
Cc: P J P <[email protected]>
Cc: Huawei PSIRT <[email protected]>
Reported-by: "Jiangxin (hunter, SCC)" <[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
Reviewed-by: Prasad J Pandit <[email protected]>
Message-id: [email protected]
| 3268a845f41253fb55852a8429c32b50f36f349a | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/3268a845f41253fb55852a8429c32b50f36f349a | 2017-05-04 08:31:48+02:00 |
target/openrisc: Implement full vmstate serialization
Previously serialization did not persist the tlb, timer, pic and other
key state items. This meant snapshotting and restoring a running os
would crash. After adding these I am able to take snapshots of a
running linux os and restore at a later time.
I am currently not trying to maintain capatibility with older versions
as I do not believe this really worked before or anyone used it.
Signed-off-by: Stafford Horne <[email protected]>
| acf57591c01cd0b1667e4f0ed2176d59cb5827aa | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/acf57591c01cd0b1667e4f0ed2176d59cb5827aa | 2017-05-04 09:39:14+09:00 |
console: add same surface replace pre-condition
Catch an invalid state early, before a potential use-after-free. This is
mainly useful for documentation purposes.
Signed-off-by: Marc-André Lureau <[email protected]>
Message-id: [email protected]
Signed-off-by: Gerd Hoffmann <[email protected]>
| 6905b93447a42e606dfd126b90f75f4cd3c6fe94 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/6905b93447a42e606dfd126b90f75f4cd3c6fe94 | 2017-04-24 10:12:28+02:00 |
spapr: fix buffer-overflow
Running postcopy-test with ASAN produces the following error:
QTEST_QEMU_BINARY=ppc64-softmmu/qemu-system-ppc64 tests/postcopy-test
...
=================================================================
==23641==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x7f1556600000 at pc 0x55b8e9d28208 bp 0x7f1555f4d3c0 sp 0x7f1555f4d3b0
READ of size 8 at 0x7f1556600000 thread T6
#0 0x55b8e9d28207 in htab_save_first_pass /home/elmarco/src/qq/hw/ppc/spapr.c:1528
#1 0x55b8e9d2939c in htab_save_iterate /home/elmarco/src/qq/hw/ppc/spapr.c:1665
#2 0x55b8e9beae3a in qemu_savevm_state_iterate /home/elmarco/src/qq/migration/savevm.c:1044
#3 0x55b8ea677733 in migration_thread /home/elmarco/src/qq/migration/migration.c:1976
#4 0x7f15845f46c9 in start_thread (/lib64/libpthread.so.0+0x76c9)
#5 0x7f157d9d0f7e in clone (/lib64/libc.so.6+0x107f7e)
0x7f1556600000 is located 0 bytes to the right of 2097152-byte region [0x7f1556400000,0x7f1556600000)
allocated by thread T0 here:
#0 0x7f159bb76980 in posix_memalign (/lib64/libasan.so.3+0xc7980)
#1 0x55b8eab185b2 in qemu_try_memalign /home/elmarco/src/qq/util/oslib-posix.c:106
#2 0x55b8eab186c8 in qemu_memalign /home/elmarco/src/qq/util/oslib-posix.c:122
#3 0x55b8e9d268a8 in spapr_reallocate_hpt /home/elmarco/src/qq/hw/ppc/spapr.c:1214
#4 0x55b8e9d26e04 in ppc_spapr_reset /home/elmarco/src/qq/hw/ppc/spapr.c:1261
#5 0x55b8ea12e913 in qemu_system_reset /home/elmarco/src/qq/vl.c:1697
#6 0x55b8ea13fa40 in main /home/elmarco/src/qq/vl.c:4679
#7 0x7f157d8e9400 in __libc_start_main (/lib64/libc.so.6+0x20400)
Thread T6 created by T0 here:
#0 0x7f159bae0488 in __interceptor_pthread_create (/lib64/libasan.so.3+0x31488)
#1 0x55b8eab1d9cb in qemu_thread_create /home/elmarco/src/qq/util/qemu-thread-posix.c:465
#2 0x55b8ea67874c in migrate_fd_connect /home/elmarco/src/qq/migration/migration.c:2096
#3 0x55b8ea66cbb0 in migration_channel_connect /home/elmarco/src/qq/migration/migration.c:500
#4 0x55b8ea678f38 in socket_outgoing_migration /home/elmarco/src/qq/migration/socket.c:87
#5 0x55b8eaa5a03a in qio_task_complete /home/elmarco/src/qq/io/task.c:142
#6 0x55b8eaa599cc in gio_task_thread_result /home/elmarco/src/qq/io/task.c:88
#7 0x7f15823e38e6 (/lib64/libglib-2.0.so.0+0x468e6)
SUMMARY: AddressSanitizer: heap-buffer-overflow /home/elmarco/src/qq/hw/ppc/spapr.c:1528 in htab_save_first_pass
index seems to be wrongly incremented, unless I miss something that
would be worth a comment.
Signed-off-by: Marc-André Lureau <[email protected]>
Signed-off-by: David Gibson <[email protected]>
| 24ec2863b147aadd8cbd63f87ad0467210164304 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/24ec2863b147aadd8cbd63f87ad0467210164304 | 2017-03-29 11:35:02+11:00 |
rbd: Fix to cleanly reject -drive without pool or image
qemu_rbd_open() neglects to check pool and image are present. Missing
image is caught by rbd_open(), but missing pool crashes. Reproducer:
$ qemu-system-x86_64 -nodefaults -drive driver=rbd,id=rbd,image=i,...
terminate called after throwing an instance of 'std::logic_error'
what(): basic_string::_M_construct null not valid
Aborted (core dumped)
where ... is a working server.0.{host,port} configuration.
Doesn't affect -drive with file=..., because qemu_rbd_parse_filename()
always sets both pool and image.
Doesn't affect -blockdev, because pool and image are mandatory in the
QAPI schema.
Fix by adding the missing checks.
Signed-off-by: Markus Armbruster <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Reviewed-by: Max Reitz <[email protected]>
Reviewed-by: Jeff Cody <[email protected]>
Message-id: [email protected]
Signed-off-by: Jeff Cody <[email protected]>
| f51c363c2ba97af02fedaeb7eaad68f433007382 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/f51c363c2ba97af02fedaeb7eaad68f433007382 | 2017-03-28 09:53:16-04:00 |
user-exec: handle synchronous signals from QEMU gracefully
When "tcg: enable thread-per-vCPU" (commit 3725794) was merged the
lifetime of current_cpu was changed. Previously a broken linux-user
call might abort() which can eventually escalate into a SIGSEGV which
would then crash qemu as it attempted to deref a NULL current_cpu.
After commit 3725794 it would attempt to fixup state and re-start the
run-loop and much hilarity (i.e. a looping lockup) would ensue from
jumping into a stale jmp_env.
As we can actually tell if we are in the run-loop from looking at the
cpu->running flag we should catch this badness first and abort()
cleanly rather than try to soldier on. There is a theoretical race
between the flag being set and sigsetjmp refreshing the jump buffer
but we can try really hard to not introduce crashes into that code.
[LV: setgroups03 fails on powerpc LTP]
Reported-by: Laurent Vivier <[email protected]>
Signed-off-by: Alex Bennée <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Reviewed-by: Paolo Bonzini <[email protected]>
| 02bed6bd5f45819f1557a4b04db300a72383ecdb | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/02bed6bd5f45819f1557a4b04db300a72383ecdb | 2017-03-28 10:50:35+01:00 |
parallels: fix default options parsing
parallels block driver is completely broken since commit
commit 75cdcd1553e74b5edc58aed23e3b2da8dabb1876
Author: Markus Armbruster <[email protected]>
Date: Tue Feb 21 21:14:08 2017 +0100
option: Fix checking of sizes for overflow and trailing crap
Right now even simple
qemu-io -c "read 512 64k" 1.hds
ends up with
Unexpected error in parse_option_size() at util/qemu-option.c:188:
Parameter 'prealloc-size' expects a non-negative number below 2^64
Aborted (core dumped)
The cure is simple - we should use 'M' as a suffix in default option value
instead of 'MiB'.
Signed-off-by: Edgar Kaziahmedov <[email protected]>
Signed-off-by: Denis V. Lunev <[email protected]>
Message-id: [email protected]
CC: Markus Armbruster <[email protected]>
CC: Stefan Hajnoczi <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>
| ff5bbe56c6f9a74c2d77389a21d5d2368458c939 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/ff5bbe56c6f9a74c2d77389a21d5d2368458c939 | 2017-03-21 10:02:36+00:00 |
scripts/dump-guest-memory.py: fix int128_get64 on recent gcc
The Int128 is no longer a struct, reaching a python exception:
Python Exception <class 'gdb.error'> Attempt to extract a component of a value that is not a (null).:
Replace struct access with a cast to uint64[] instead.
Fixes:
https://bugzilla.redhat.com/show_bug.cgi?id=1427466
Signed-off-by: Marc-André Lureau <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
| 9b4b157ef6edc5cf060aef3402bdece7f581b5a2 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/9b4b157ef6edc5cf060aef3402bdece7f581b5a2 | 2017-03-14 13:26:36+01:00 |
qxl: clear guest_cursor on QXL_CURSOR_HIDE
Make sure we don't leave guest_cursor pointing into nowhere. This might
lead to (rare) live migration failures, due to target trying to restore
the cursor from the stale pointer.
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1421788
Reported-by: Dr. David Alan Gilbert <[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
Reviewed-by: Marc-André Lureau <[email protected]>
Message-id: [email protected]
| dbb5fb8d3519130559b10fa4e1395e4486c633f8 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/dbb5fb8d3519130559b10fa4e1395e4486c633f8 | 2017-03-09 09:47:26+01:00 |
qapi: Improve how keyval input visitor reports unexpected dicts
Incorrect option
-blockdev node-name=foo,driver=file,filename=foo.img,aio.unmap=on
is rejected with "Invalid parameter type for 'aio', expected: string".
To make sense of this, you almost have to translate it into the
equivalent QMP command
{ "execute": "blockdev-add", "arguments": { "node-name": "foo", "driver": "file", "filename": "foo.img", "aio": { "unmap": true } } }
Improve the error message to "Parameters 'aio.*' are unexpected".
Take care not to confuse the case "unexpected nested parameters"
(i.e. the object is a QDict or QList) with the case "non-string scalar
parameter". The latter is a misuse of the visitor, and should perhaps
be an assertion. Note that test-qobject-input-visitor exercises this
misuse in test_visitor_in_int_keyval(), test_visitor_in_bool_keyval()
and test_visitor_in_number_keyval().
Signed-off-by: Markus Armbruster <[email protected]>
Reviewed-by: Kevin Wolf <[email protected]>
Message-Id: <[email protected]>
| 31478f26ab4ed82d35b763bbf259810d0c8b44e1 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/31478f26ab4ed82d35b763bbf259810d0c8b44e1 | 2017-03-07 16:07:47+01:00 |
tests: fix e1000-test leak
Spotted by ASAN.
Signed-off-by: Marc-André Lureau <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
| 8829e16f5ef7034ab730370ba34ce2c835da17c4 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/8829e16f5ef7034ab730370ba34ce2c835da17c4 | 2017-03-01 11:51:28+04:00 |
sheepdog: Report errors in pseudo-filename more usefully
Errors in the pseudo-filename are all reported with the same laconic
"Can't parse filename" message.
Add real error reporting, such as:
$ qemu-system-x86_64 --drive driver=sheepdog,filename=sheepdog:///
qemu-system-x86_64: --drive driver=sheepdog,filename=sheepdog:///: missing file path in URI
$ qemu-system-x86_64 --drive driver=sheepdog,filename=sheepgod:///vdi
qemu-system-x86_64: --drive driver=sheepdog,filename=sheepgod:///vdi: URI scheme must be 'sheepdog', 'sheepdog+tcp', or 'sheepdog+unix'
$ qemu-system-x86_64 --drive driver=sheepdog,filename=sheepdog+unix:///vdi?socke=sheepdog.sock
qemu-system-x86_64: --drive driver=sheepdog,filename=sheepdog+unix:///vdi?socke=sheepdog.sock: unexpected query parameters
The code to translate legacy syntax to URI fails to escape URI
meta-characters. The new error messages are misleading then. Replace
them by the old "Can't parse filename" message. "Internal error"
would be more honest. Anyway, no worse than before. Also add a FIXME
comment.
Signed-off-by: Markus Armbruster <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Kevin Wolf <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
| 36bcac16fdd6ecb75314db06171f54dcd400ab8c | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/36bcac16fdd6ecb75314db06171f54dcd400ab8c | 2017-03-07 14:53:28+01:00 |
tests: fix leaks in test-io-channel-command
No need for strdup, fix leaks when socat is missing.
Spotted by ASAN.
Signed-off-by: Marc-André Lureau <[email protected]>
Signed-off-by: Daniel P. Berrange <[email protected]>
| e3d90312b3748431ca7c1ecb10cd4614f32f0ae3 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/e3d90312b3748431ca7c1ecb10cd4614f32f0ae3 | 2017-02-28 10:36:32+00:00 |
9pfs: local: rename: use renameat
The local_rename() callback is vulnerable to symlink attacks because it
uses rename() which follows symbolic links in all path elements but the
rightmost one.
This patch simply transforms local_rename() into a wrapper around
local_renameat() which is symlink-attack safe.
This partly fixes CVE-2016-9602.
Signed-off-by: Greg Kurz <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
| d2767edec582558f1e6c52e1dd9370d62e2b30fc | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/d2767edec582558f1e6c52e1dd9370d62e2b30fc | 2017-02-28 11:21:15+01:00 |
9pfs: local: remove: don't follow symlinks
The local_remove() callback is vulnerable to symlink attacks because it
calls:
(1) lstat() which follows symbolic links in all path elements but the
rightmost one
(2) remove() which follows symbolic links in all path elements but the
rightmost one
This patch converts local_remove() to rely on opendir_nofollow(),
fstatat(AT_SYMLINK_NOFOLLOW) to fix (1) and unlinkat() to fix (2).
This partly fixes CVE-2016-9602.
Signed-off-by: Greg Kurz <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
| a0e640a87210b1e986bcd4e7f7de03beb3db0a4a | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/a0e640a87210b1e986bcd4e7f7de03beb3db0a4a | 2017-02-28 11:21:15+01:00 |
util/cutils: Rewrite documentation of qemu_strtol() & friends
Fixes the following documentation bugs:
* Fails to document that null @nptr is safe.
* Fails to document that we return -EINVAL when no conversion could be
performed (commit 47d4be1).
* Confuses long long with int64_t, and unsigned long long with
uint64_t.
* Claims the unsigned conversions can underflow. They can't.
While there, mark problematic assumptions that int64_t is long long,
and uint64_t is unsigned long long with FIXME comments.
Signed-off-by: Markus Armbruster <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-Id: <[email protected]>
| 4295f879becfbbb9f4330489311586b96915d920 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/4295f879becfbbb9f4330489311586b96915d920 | 2017-02-23 20:35:35+01:00 |
vvfat: Use opened node as backing file
We should not try to assign a not yet opened node as the backing file,
because as soon as the permission system is added it will fail. The
just added bdrv_new_open_driver() function is the right tool to open a
file with an internal driver, use it.
In case anyone wonders whether that magic fake backing file to trigger a
special action on 'commit' actually works today: No, not for me. One
reason is that we've been adding a raw format driver on top for several
years now and raw doesn't support commit. Other reasons include that the
backing file isn't writable and the driver doesn't support reopen, and
it's also size 0 and the driver doesn't support bdrv_truncate. All of
these are easily fixable, but then 'commit' ended up in an infinite loop
deep in the vvfat code for me, so I thought I'd best leave it alone. I'm
not really sure what it was supposed to do anyway.
Signed-off-by: Kevin Wolf <[email protected]>
Reviewed-by: Max Reitz <[email protected]>
| a8a4d15c1c34d3cec704fb64eba4a3745a140a97 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/a8a4d15c1c34d3cec704fb64eba4a3745a140a97 | 2017-02-24 16:09:23+01:00 |
vnc: do not disconnect on EAGAIN
When qemu vnc server is trying to send large update to clients,
there might be a situation when system responds with something
like EAGAIN, indicating that there's no system memory to send
that much data (depending on the network speed, client and server
and what is happening). In this case, something like this happens
on qemu side (from strace):
sendmsg(16, {msg_name(0)=NULL,
msg_iov(1)=[{"\244\"..., 729186}],
msg_controllen=0, msg_flags=0}, 0) = 103950
sendmsg(16, {msg_name(0)=NULL,
msg_iov(1)=[{"lz\346"..., 1559618}],
msg_controllen=0, msg_flags=0}, 0) = -1 EAGAIN
sendmsg(-1, {msg_name(0)=NULL,
msg_iov(1)=[{"lz\346"..., 1559618}],
msg_controllen=0, msg_flags=0}, 0) = -1 EBADF
qemu closes the socket before the retry, and obviously it gets EBADF
when trying to send to -1.
This is because there WAS a special handling for EAGAIN, but now it doesn't
work anymore, after commit 04d2529da27db512dcbd5e99d0e26d333f16efcc, because
now in all error-like cases we initiate vnc disconnect.
This change were introduced in qemu 2.6, and caused numerous grief for many
people, resulting in their vnc clients reporting sporadic random disconnects
from vnc server.
Fix that by doing the disconnect only when necessary, i.e. omitting this
very case of EAGAIN.
Hopefully the existing condition (comparing with QIO_CHANNEL_ERR_BLOCK)
is sufficient, as the original code (before the above commit) were
checking for other errno values too.
Apparently there's another (semi?)bug exist somewhere here, since the
code tries to write to fd# -1, it probably should check if the connection
is open before. But this isn't important.
Signed-off-by: Michael Tokarev <[email protected]>
Reviewed-by: Daniel P. Berrange <[email protected]>
Message-id: [email protected]
Fixes: 04d2529da27db512dcbd5e99d0e26d333f16efcc
Cc: Daniel P. Berrange <[email protected]>
Cc: Gerd Hoffmann <[email protected]>
Cc: [email protected]
Signed-off-by: Gerd Hoffmann <[email protected]>
| 537848ee62195fc06c328b1cd64f4218f404a7f1 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/537848ee62195fc06c328b1cd64f4218f404a7f1 | 2017-02-08 14:59:36+01:00 |
io: stop incrementing reference in qio_task_get_source
Incrementing the reference in qio_task_get_source is
not necessary, since we're not running concurrently
with any other code touching the QIOTask. This
minimizes chances of further memory leaks.
Reviewed-by: Eric Blake <[email protected]>
Signed-off-by: Daniel P. Berrange <[email protected]>
| 937470bb5470825e781ae50e92ff973a6b54d80f | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/937470bb5470825e781ae50e92ff973a6b54d80f | 2017-01-23 15:32:18+00:00 |
serial: fix memory leak in serial exit
The serial_exit_core function doesn't free some resources.
This can lead memory leak when hotplug and unplug. This
patch avoid this.
Signed-off-by: Li Qiang <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
| 8409dc884a201bf74b30a9d232b6bbdd00cb7e2b | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/8409dc884a201bf74b30a9d232b6bbdd00cb7e2b | 2017-01-16 17:52:35+01:00 |
tests: fix linking test-char on win32
test.char.exe fails to link:
qemu-char.o: In function `win_chr_free':
/home/elmarco/src/qemu/qemu-char.c:2149: undefined reference to `qemu_del_polling_cb'
/home/elmarco/src/qemu/qemu-char.c:2151: undefined reference to `qemu_del_polling_cb'
qemu-char.o: In function `win_stdio_thread':
/home/elmarco/src/qemu/qemu-char.c:2568: undefined reference to `qemu_del_wait_object'
qemu-char.o: In function `qemu_chr_open_stdio':
/home/elmarco/src/qemu/qemu-char.c:2661: undefined reference to `qemu_add_wait_object'
/home/elmarco/src/qemu/qemu-char.c:2646: undefined reference to
`qemu_add_wait_object'
...
It needs main-loop.o symbols, among others. Linking with
$(test-block-obj-y) brings what's necessary. We could try to eventually
strip to the minimum if needed.
Signed-off-by: Marc-André Lureau <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
| 7a00875183c8edcbbee5540e97fab6c7f82a2a43 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/7a00875183c8edcbbee5540e97fab6c7f82a2a43 | 2017-01-27 18:07:58+01:00 |
virtio-gpu: Fix memory leak in virtio_gpu_load()
Coverity points out that if we fail in the "creating resources"
loop in virtio_gpu_load() we will leak various resources (CID 1356431).
Failing a VM load is going to leave the simulation in a complete mess,
but we can tidy up to the point that a full system reset should
get us back to sanity.
Signed-off-by: Peter Maydell <[email protected]>
Message-id: [email protected]
Signed-off-by: Gerd Hoffmann <[email protected]>
| c84f0f25db2eaab101665ddb60c1ddf1decce76a | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/c84f0f25db2eaab101665ddb60c1ddf1decce76a | 2017-01-11 09:19:05+01:00 |
virtio-gpu-3d: fix memory leak in resource attach backing
If the virgl_renderer_resource_attach_iov function fails the
'res_iovs' will be leaked. Add check of the return value to
free the 'res_iovs' when failing.
Signed-off-by: Li Qiang <[email protected]>
Reviewed-by: Marc-André Lureau <[email protected]>
Message-id: [email protected]
Signed-off-by: Gerd Hoffmann <[email protected]>
| 33243031dad02d161225ba99d782616da133f689 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/33243031dad02d161225ba99d782616da133f689 | 2017-01-03 15:47:21+01:00 |
virtio-gpu: call cleanup mapping function in resource destroy
If the guest destroy the resource before detach banking, the 'iov'
and 'addrs' field in resource is not freed thus leading memory
leak issue. This patch avoid this.
Signed-off-by: Li Qiang <[email protected]>
Reviewed-by: Marc-André Lureau <[email protected]>
Message-id: [email protected]
Signed-off-by: Gerd Hoffmann <[email protected]>
| b8e23926c568f2e963af39028b71c472e3023793 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/b8e23926c568f2e963af39028b71c472e3023793 | 2017-01-03 15:47:16+01:00 |
migration: fix compiler warning on uninitialized variable
Some older GCC versions (e.g. 4.4.7) report a warning on an
uninitialized variable for 'request', even though all possible code
paths that reference 'request' will be initialized. To appease
these versions, initialize the variable to 0.
Reported-by: Mark Cave-Ayland <[email protected]>
Signed-off-by: Jeff Cody <[email protected]>
Reviewed-by: zhanghailiang <[email protected]>
Message-id: 259818682e41b95ae60f1423b87954a3fe377639.1477950393.git.jcody@redhat.com
Signed-off-by: Peter Maydell <[email protected]>
| 02ba9265e8d65f24d0cdca158d96e0b0451f6b71 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/02ba9265e8d65f24d0cdca158d96e0b0451f6b71 | 2016-11-01 09:31:53+00:00 |
s390x/pci: Check memory region dispatching callbacks
The instructions PCI STORE, PCI LOAD and PCI STORE BLOCK
use calls to memory_region_dispatch_write() and
memory_region_dispatch_read() but do not test the return value.
Furthermore, the instruction PCI STORE BLOCK sets up a PGM_ADDRESSING
exception when the operand 3 is not within the designated PCI address
space instead of a PGM_OPERAND exception.
Let's setup a PGM_OPERAND exception in all of these failure cases.
Signed-off-by: Pierre Morel <[email protected]>
Signed-off-by: Cornelia Huck <[email protected]>
| 88ee13c7b656e5504613b527f3a51591e9afae69 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/88ee13c7b656e5504613b527f3a51591e9afae69 | 2016-10-31 10:02:09+01:00 |
colo-proxy: fix memory leak
Fix memory leak in colo-compare.c and filter-rewriter.c
Report by Coverity and add some comments.
Signed-off-by: Zhang Chen <[email protected]>
Reviewed-by: zhanghailiang <[email protected]>
Signed-off-by: Jason Wang <[email protected]>
| 2061c14c9bea67f8f1fc6bc7acb33c903a0586c1 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/2061c14c9bea67f8f1fc6bc7acb33c903a0586c1 | 2016-10-26 09:58:02+08:00 |
qapi: fix memory leak in bdrv_image_info_specific_dump
The 'obj' result of the visitor was not properly freed, like done in
other places doing a similar job.
Signed-off-by: Pino Toscano <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
| 3ac2f2f765a0bc18dfb18c38a522e6123289ffc1 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/3ac2f2f765a0bc18dfb18c38a522e6123289ffc1 | 2016-10-24 17:54:03+02:00 |
char: introduce CharBackend
This new structure is meant to keep the details associated with a char
driver usage. On initialization, it gets a tag from the mux backend.
It can change its handlers thanks to qemu_chr_fe_set_handlers().
This structure is introduced so that all frontend will be moved to hold
and use a CharBackend. This will allow to better track char usage and
allocation, and help prevent some memory leaks or corruption.
Signed-off-by: Marc-André Lureau <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
| 94a40fc56036b5058b0b194d9e372a22e65ce7be | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/94a40fc56036b5058b0b194d9e372a22e65ce7be | 2016-10-24 15:27:20+02:00 |
trace: remove the TraceEventID and TraceEventVCPUID enums
The TraceEventID and TraceEventVCPUID enums constants are
no longer actually used for anything critical.
The TRACE_EVENT_COUNT limit is used to determine the size
of the TraceEvents array, and can be removed if we just
NULL terminate the array instead.
The TRACE_VCPU_EVENT_COUNT limit is used as a magic value
for marking non-vCPU events, and also for declaring the
size of the trace dstate mask in the CPUState struct.
The former usage can be replaced by a dedicated constant
TRACE_EVENT_VCPU_NONE, defined as (uint32_t)-1. For the
latter usage, we can simply define a constant for the
number of VCPUs, avoiding the need for the full enum.
The only other usages of the enum values can be replaced
by accesing the id/vcpu_id fields via the named TraceEvent
structs.
Reviewed-by: Lluís Vilanova <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Signed-off-by: Daniel P. Berrange <[email protected]>
Message-id: [email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>
| ef4c9fc8542e06b1d567172c04b0c0377c7ab0c5 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/ef4c9fc8542e06b1d567172c04b0c0377c7ab0c5 | 2016-10-12 09:35:54+02:00 |
trace: give each trace event a named TraceEvent struct
Currently we only expose a TraceEvent array, which must
be indexed via the TraceEventID enum constants. This
changes the generator to expose a named TraceEvent
instance for each event, with an _EVENT suffix.
Reviewed-by: Lluís Vilanova <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Signed-off-by: Daniel P. Berrange <[email protected]>
Message-id: [email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>
| 79218be42b835cbc7bd1b0fbd07d115add6e7605 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/79218be42b835cbc7bd1b0fbd07d115add6e7605 | 2016-10-12 09:35:54+02:00 |
char: use a fixed idx for child muxed chr
mux_chr_update_read_handler() is adding a new mux_cnt each time
mux_chr_update_read_handler() is called, it's not possible to actually
update the "child" chr callbacks that were set previously. This may lead
to crashes if the "child" chr is destroyed:
valgrind x86_64-softmmu/qemu-system-x86_64 -chardev
stdio,mux=on,id=char0 -mon chardev=char0,mode=control,default
when quitting:
==4306== Invalid read of size 8
==4306== at 0x8061D3: json_lexer_destroy (json-lexer.c:385)
==4306== by 0x7E39F8: json_message_parser_destroy (json-streamer.c:134)
==4306== by 0x3447F6: monitor_qmp_event (monitor.c:3908)
==4306== by 0x480153: mux_chr_send_event (qemu-char.c:630)
==4306== by 0x480694: mux_chr_event (qemu-char.c:734)
==4306== by 0x47F1E9: qemu_chr_be_event (qemu-char.c:205)
==4306== by 0x481207: fd_chr_close (qemu-char.c:1114)
==4306== by 0x481659: qemu_chr_close_stdio (qemu-char.c:1221)
==4306== by 0x486F07: qemu_chr_free (qemu-char.c:4146)
==4306== by 0x486F97: qemu_chr_delete (qemu-char.c:4154)
==4306== by 0x487E66: qemu_chr_cleanup (qemu-char.c:4678)
==4306== by 0x495A98: main (vl.c:4675)
==4306== Address 0x28439e90 is 112 bytes inside a block of size 240 free'd
==4306== at 0x4C2CD5A: free (vg_replace_malloc.c:530)
==4306== by 0x1E4CBF2D: g_free (in /usr/lib64/libglib-2.0.so.0.4800.2)
==4306== by 0x344DE9: monitor_cleanup (monitor.c:4058)
==4306== by 0x495A93: main (vl.c:4674)
==4306== Block was alloc'd at
==4306== at 0x4C2BBAD: malloc (vg_replace_malloc.c:299)
==4306== by 0x1E4CBE18: g_malloc (in /usr/lib64/libglib-2.0.so.0.4800.2)
==4306== by 0x344BF8: monitor_init (monitor.c:4021)
==4306== by 0x49063C: mon_init_func (vl.c:2417)
==4306== by 0x7FC6DE: qemu_opts_foreach (qemu-option.c:1116)
==4306== by 0x4954E0: main (vl.c:4473)
Instead, keep the "child" chr associated with a particular idx so its
handlers can be updated and removed to avoid the crash.
Signed-off-by: Marc-André Lureau <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
| 949055a2549afc4cde06b7972072c7288bb43722 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/949055a2549afc4cde06b7972072c7288bb43722 | 2016-10-04 10:00:26+02:00 |
qcow2: avoid memcpy(dst, NULL, len)
Section "7.1.4 Use of library functions" in the C99 standard says:
If an argument to a function has an invalid value (such as [...]
a null pointer [...]) [...] the behavior is undefined.
Additionally the "searching and sorting" functions are specified as
requiring valid pointer values as described in 7.1.4.
This patch fixes the following sanitizer errors:
block/qcow2.c:1807:41: runtime error: null pointer passed as argument 2, which is declared to never be null
block/qcow2-cluster.c:86:26: runtime error: null pointer passed as argument 2, which is declared to never be null
Reported-by: Peter Maydell <[email protected]>
Reviewed-by: Kevin Wolf <[email protected]>
Message-id: [email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>
| 0647d47cc184da587c76743546b6af6dfdb8f1da | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/0647d47cc184da587c76743546b6af6dfdb8f1da | 2016-09-13 11:00:55+01:00 |
tests: fix test-cutils leaks
Spotted thanks to ASAN.
Signed-off-by: Marc-André Lureau <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
| d6f723b513a0c3c4e58343b7c52a2f9850861fa0 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/d6f723b513a0c3c4e58343b7c52a2f9850861fa0 | 2016-09-08 17:57:32+04:00 |
tests: fix test-qga leaks
Signed-off-by: Marc-André Lureau <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
| 1e2713384c58037ad44f716c31c08daca18862c5 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/1e2713384c58037ad44f716c31c08daca18862c5 | 2016-09-08 17:57:32+04:00 |
ppc: Speed up dcbz
Use tlb_vaddr_to_host to do a fast path single translate for
the whole cache line. Also make the reservation check match
the entire range.
Signed-off-by: Benjamin Herrenschmidt <[email protected]>
Signed-off-by: David Gibson <[email protected]>
| c9f82d013be0d8d9c5d9f51bb76e337a0a5a5cac | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/c9f82d013be0d8d9c5d9f51bb76e337a0a5a5cac | 2016-09-07 12:40:11+10:00 |
virtio-input: free config list
Clear the list when finalizing. The list is created during realize with
virtio_input_idstr_config() and later by further calls to
virtio_input_init_config() and virtio_input_add_config().
This leak can be reproduced with device-introspect-test -p
/x86_64/device/introspect/concrete.
Signed-off-by: Marc-André Lureau <[email protected]>
Reviewed-by: Gerd Hoffmann <[email protected]>
| 0137a557aac07480ff8447ef372f0581af5ee65a | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/0137a557aac07480ff8447ef372f0581af5ee65a | 2016-08-08 00:00:28+04:00 |
char: free the tcp connection data when closing
Make sure the connection data got freed when closing the chardev, to
avoid leaks. Introduce tcp_chr_free_connection() to clean all connection
related data, and move some tcp_chr_close() clean-ups there.
(while at it, set write_msgfds_num to 0 when clearing array in
tcp_set_msgfds())
Signed-off-by: Marc-André Lureau <[email protected]>
Reviewed-by: Paolo Bonzini <[email protected]>
| 5b498459b441f4639fd4c39c35345637bfc6c16c | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/5b498459b441f4639fd4c39c35345637bfc6c16c | 2016-08-08 00:00:11+04:00 |
spapr: Correctly set query_hotpluggable_cpus hook based on machine version
Prior to c8721d3 "spapr: Error out when CPU hotplug is attempted on older
pseries machines", attempting to use query-hotpluggable-cpus on pseries-2.6
and earlier machine types would SEGV.
That change fixed that, but due to some unexpected interactions in init
order and a brown-paper-bag worthy failure to test, it accidentally
disabled query-hotpluggable-cpus for all pseries machine types, including
the current one which should allow it.
In fact, query_hotpluggable_cpus needs to be non-NULL when and only when
the dr_cpu_enabled flag in sPAPRMachineClass is set, which makes
dr_cpu_enabled itself redundant.
This patch removes dr_cpu_enabled, instead directly setting
query_hotpluggable_cpus from the machine class_init functions, and using
that to determine the availability of CPU hotplug when necessary.
Signed-off-by: David Gibson <[email protected]>
| 3c0c47e3464f3c54bd3f1cc6d4da2cbf7465e295 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/3c0c47e3464f3c54bd3f1cc6d4da2cbf7465e295 | 2016-08-08 09:45:03+10:00 |
io: remove mistaken call to object_ref on QTask
The QTask struct is just a standalone struct, not a QOM Object,
so calling object_ref() on it is not appropriate. This results
in mangling the 'destroy' field in the QTask struct, causing
the later call to qtask_free() to try to call the function
at address 0x1, with predictably segfault happy results.
There is in fact no need for ref counting with QTask, as the
call to qtask_abort() or qtask_complete() will automatically
free associated memory.
This fixes the crash shown in
https://bugs.launchpad.net/qemu/+bug/1589923
Reviewed-by: Eric Blake <[email protected]>
Signed-off-by: Daniel P. Berrange <[email protected]>
| bc35d51077b33e68a0ab10a057f352747214223f | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/bc35d51077b33e68a0ab10a057f352747214223f | 2016-08-03 10:28:50+01:00 |
i2c: fix migration regression introduced by broadcast support
QEMU fails migration with following error:
qemu-system-x86_64: Missing section footer for i2c_bus
qemu-system-x86_64: load of migration failed: Invalid argument
when migrating from:
qemu-system-x86_64-v2.6.0 -m 256M rhel72.img -M pc-i440fx-2.6
to
qemu-system-x86_64-v2.7.0-rc0 -m 256M rhel72.img -M pc-i440fx-2.6
Regression is added by commit 2293c27f (i2c: implement broadcast write)
Fix it by dropping 'broadcast' VMState introduced by 2293c27f and
reuse broadcast 0x00 address as broadcast flag in bus->saved_address.
Then if there were ongoing broadcast at migration time, set
bus->saved_address to it and at i2c_slave_post_load() time check
for it instead of transfering and using 'broadcast' VMState.
As result of reusing existing saved_address VMState, no compat
glue will be needed to keep forward/backward compatiblity. which
makes fix much less intrusive.
Signed-off-by: Igor Mammedov <[email protected]>
Message-Id: <[email protected]>
Reviewed-by: Dr. David Alan Gilbert <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
| 71ae65e552fc6e03572e430009b98b80b40f1c4d | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/71ae65e552fc6e03572e430009b98b80b40f1c4d | 2016-08-03 18:44:56+02:00 |
Revert e5dfc5e8e("Move README to markdown")
checkpatch.pl and other scripts fail without README. Revert
the rename for now; we may add README.md as a symlink later.
This reverts commit e5dfc5e8e715c572aea44ac4d96c43941d4741c7.
Signed-off-by: Pranith Kumar <[email protected]>
Reviewed-by: Stefan Weil <[email protected]>
Message-id: [email protected]
[PMM: tweaked commit message a little]
Signed-off-by: Peter Maydell <[email protected]>
| b95aae121b966ef6cd0781a6610c6902b272c542 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/b95aae121b966ef6cd0781a6610c6902b272c542 | 2016-07-21 10:46:41+01:00 |
spapr: fix core unplug crash
If the host has 8 threads/core and the guest is started with:
-smp cores=1,threads=4,maxcpus=12
It is possible to crash QEMU by doing:
(qemu) device_add host-spapr-cpu-core,core-id=16,id=foo
(qemu) device_del foo
Segmentation fault
This happens because spapr_core_unplug() assumes cpu_dt_id == core_id.
As long as cpu_dt_id is derived from the non-table cpu_index, this is
only true when you plug cores with contiguous ids.
It is safer to be consistent: the DR connector was created with an
index that is immediately written to cc->core_id, and spapr_core_plug()
also relies on cc->core_id.
Let's use it also in spapr_core_unplug().
Signed-off-by: Greg Kurz <[email protected]>
Reviewed-by: Bharata B Rao <[email protected]>
Signed-off-by: David Gibson <[email protected]>
| 44d691f7d9b6ebab102a31aa87fe59da8f7feff9 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/44d691f7d9b6ebab102a31aa87fe59da8f7feff9 | 2016-07-18 10:40:27+10:00 |
block/qdev: Allow node name for drive properties
If a node name instead of a BlockBackend name is specified as the driver
for a guest device, an anonymous BlockBackend is created now.
The order of operations in release_drive() must be reversed in order to
avoid a use-after-free bug because now blk_detach_dev() frees the last
reference if an anonymous BlockBackend is used.
usb-storage uses a hack where it forwards its BlockBackend as a property
to another device that it internally creates. This hack must be updated
so that it doesn't drop its original BB before it can be passed to the
other device. This used to work because we always had the monitor
reference around, but with node-names the device reference is the only
one now.
Signed-off-by: Kevin Wolf <[email protected]>
Reviewed-by: Max Reitz <[email protected]>
| 8daea510951dd309a44cea8de415c685c43851cf | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/8daea510951dd309a44cea8de415c685c43851cf | 2016-07-13 13:28:00+02:00 |
qemu-img: Don't leak errors when outputting JSON
If our JSON output ever encounters an error, we would just silently
leak the error object. Instead, assert that our usage won't fail.
Signed-off-by: Eric Blake <[email protected]>
Message-Id: <[email protected]>
Reviewed-by: Markus Armbruster <[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
| 911ee36d411ee9b3540855642b53219b6a974992 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/911ee36d411ee9b3540855642b53219b6a974992 | 2016-07-06 10:52:04+02:00 |
qapi: Fix memleak in string visitors on int lists
Commit 7f8f9ef1 introduced the ability to store a list of
integers as a sorted list of ranges, but when merging ranges,
it leaks one or more ranges. It was also using range_get_last()
incorrectly within range_compare() (a range is a start/end pair,
but range_get_last() is for start/len pairs), and will also
mishandle a range ending in UINT64_MAX (remember, we document
that no range covers 2**64 bytes, but that ranges that end on
UINT64_MAX have end < begin).
The whole merge algorithm was rather complex, and included
unnecessary passes over data within glib functions, and enough
indirection to make it hard to easily plug the data leaks.
Since we are already hard-coding things to a list of ranges,
just rewrite the thing to open-code the traversal and
comparisons, by making the range_compare() helper function give
us an answer that is easier to use, at which point we avoid the
need to pass any callbacks to g_list_*(). Then by reusing
range_extend() instead of duplicating effort with range_merge(),
we cover the corner cases correctly.
Drop the now-unused range_merge() and ranges_can_merge().
Doing this lets test-string-{input,output}-visitor pass under
valgrind without leaks.
Signed-off-by: Eric Blake <[email protected]>
Message-Id: <[email protected]>
Reviewed-by: Markus Armbruster <[email protected]>
[Comment hoisted out of loop]
Signed-off-by: Markus Armbruster <[email protected]>
| db486cc334aafd3dbdaf107388e37fc3d6d3e171 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/db486cc334aafd3dbdaf107388e37fc3d6d3e171 | 2016-06-30 15:28:54+02:00 |
ppc: Fix POWER7 and POWER8 exception definitions
We were initializing unused ones and missing some
Signed-off-by: Benjamin Herrenschmidt <[email protected]>
Reviewed-by: David Gibson <[email protected]>
[clg: fixed checkpatch.pl errors ]
Signed-off-by: Cédric Le Goater <[email protected]>
Signed-off-by: David Gibson <[email protected]>
| f03a1af581b926118d619ad1acc3304ad84d5e5b | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/f03a1af581b926118d619ad1acc3304ad84d5e5b | 2016-06-23 12:43:25+10:00 |
ppc: Add P7/P8 Power Management instructions
This adds the ISA 2.06 and later power management instructions
(doze, nap, sleep and rvwinkle) and associated wakeup cause testing
in LPCR
Signed-off-by: Benjamin Herrenschmidt <[email protected]>
[clg: fixed checkpatch.pl errors ]
Signed-off-by: Cédric Le Goater <[email protected]>
Reviewed-by: David Gibson <[email protected]>
Signed-off-by: David Gibson <[email protected]>
| 7778a575c7055276afdd01737e9d1029a65f923d | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/7778a575c7055276afdd01737e9d1029a65f923d | 2016-06-23 12:43:54+10:00 |
block: use safe iteration over AioContext notifiers
It's possible that an AioContext notifier user was close to finishing
when .detach_aio_context() or .attached_aio_context() is called. In
that case they may call bdrv_remove_aio_context_notifier() during the
callback.
Use safe iteration to avoid crashing when the notifier list is modified
during iteration. We must not only handle the case where the current
aio notifier is removed during a callback but also the one where any
other aio notifier is removed.
The next patch adds an AioContext notifier for block jobs and they
really could be terminating just as .detach_aio_context() is invoked.
Signed-off-by: Stefan Hajnoczi <[email protected]>
Reviewed-by: Paolo Bonzini <[email protected]>
Reviewed-by: Fam Zheng <[email protected]>
Message-id: [email protected]
| e8a095dadb70e2ea6d5169d261920db3747bfa45 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/e8a095dadb70e2ea6d5169d261920db3747bfa45 | 2016-06-20 14:25:41+01:00 |
nbd: Detect servers that send unexpected error values
Add some debugging to flag servers that are not compliant to
the NBD protocol. This would have flagged the server bug
fixed in commit c0301fcc.
Signed-off-by: Eric Blake <[email protected]>
Reviewed-by: Alex Bligh <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
| f3c32fce3688fe1f13ceb0777faa1fc19d66d1fc | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/f3c32fce3688fe1f13ceb0777faa1fc19d66d1fc | 2016-06-16 18:39:05+02:00 |
qemu-img bench: Fix uninitialised writethrough mode
If no -t option is specified, bool writethrough stayed uninitialised.
Initialise it as false, which makes cache=writeback the default cache
mode.
Signed-off-by: Kevin Wolf <[email protected]>
Reviewed-by: Max Reitz <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
| 604e86136266d104210a74be4c82643300c74e69 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/604e86136266d104210a74be4c82643300c74e69 | 2016-06-16 15:19:55+02:00 |
linux-user: pause() should not pause if signal pending
Fix races between signal handling and the pause syscall by
reimplementing it using block_signals() and sigsuspend().
(Using safe_syscall(pause) would also work, except that the
pause syscall doesn't exist on all architectures.)
Signed-off-by: Timothy Edward Baldwin <[email protected]>
Message-id: 1441497448-32489-28-git-send-email-T.E.Baldwin99@members.leeds.ac.uk
[PMM: tweaked commit message]
Reviewed-by: Peter Maydell <[email protected]>
Signed-off-by: Peter Maydell <[email protected]>
Signed-off-by: Riku Voipio <[email protected]>
| f59ec606104ade2443179231fc7a3cb98683ac85 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/f59ec606104ade2443179231fc7a3cb98683ac85 | 2016-06-07 16:39:07+03:00 |
xen/blkif: avoid double access to any shared ring request fields
Commit f9e98e5d7a ("xen/blkif: Avoid double access to
src->nr_segments") didn't go far enough: src->operation is also being
used twice. And nothing was done to prevent the compiler from using the
source side of the copy done by blk_get_request() (granted that's very
unlikely).
Move the barrier()s up, and add another one to blk_get_request().
Note that for completing XSA-155, the barrier() getting added to
blk_get_request() would suffice, and hence the changes to xen_blkif.h
are more like just cleanup. And since, as said, the unpatched code
getting compiled to something vulnerable is very unlikely (and not
observed in practice), this isn't being viewed as a new security issue.
Signed-off-by: Jan Beulich <[email protected]>
Reviewed-by: Stefano Stabellini <[email protected]>
Signed-off-by: Stefano Stabellini <[email protected]>
| 4837a1a51638ef1719bf8149591a57e7207db41a | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/4837a1a51638ef1719bf8149591a57e7207db41a | 2016-06-13 14:32:28+01:00 |
vga: fix banked access bounds checking (CVE-2016-3710)
vga allows banked access to video memory using the window at 0xa00000
and it supports a different access modes with different address
calculations.
The VBE bochs extentions support banked access too, using the
VBE_DISPI_INDEX_BANK register. The code tries to take the different
address calculations into account and applies different limits to
VBE_DISPI_INDEX_BANK depending on the current access mode.
Which is probably effective in stopping misprogramming by accident.
But from a security point of view completely useless as an attacker
can easily change access modes after setting the bank register.
Drop the bogus check, add range checks to vga_mem_{readb,writeb}
instead.
Fixes: CVE-2016-3710
Reported-by: Qinghao Tang <[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
| 3bf1817079bb0d80c0d8a86a7c7dd0bfe90eb82e | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/3bf1817079bb0d80c0d8a86a7c7dd0bfe90eb82e | 2016-05-02 16:02:59+02:00 |
cuda: fix off-by-one error in SET_TIME command
With the new framework the cuda_cmd_set_time command directly receive
the data, without the command byte. Therefore the time is stored at
in_data[0], not at in_data[1].
This fixes the "hwclock --systohc" command in a guest.
Cc: Hervé Poussineau <[email protected]>
Cc: David Gibson <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
Reviewed-by: Hervé Poussineau <[email protected]>
[this fixes a regression introduced by e647317 "cuda: port SET_TIME
command to new framework"]
Signed-off-by: David Gibson <[email protected]>
| ed3d807b0a577c4f825b25f3281fe54ce89202db | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/ed3d807b0a577c4f825b25f3281fe54ce89202db | 2016-04-19 11:39:23+10:00 |
replay: fix error message
This patch fixes error message in saving loop of the asynchronous events queue.
Signed-off-by: Pavel Dovgalyuk <[email protected]>
[ kwolf: Fixed format string to use PRId64 instead of %d ]
Signed-off-by: Kevin Wolf <[email protected]>
| 95b4aed5fd0bec00e2c3f754c86fec5ba7a83a20 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/95b4aed5fd0bec00e2c3f754c86fec5ba7a83a20 | 2016-03-30 12:12:15+02:00 |
qemu-iotests: iotests: fail hard if not run via "check"
Running an iotests-based Python test directly might appear to work,
but may fail in subtle ways and is insecure:
- It creates files with predictable file names in a world-writable
location (/var/tmp).
- Tests expect the environment to be set up by check. E.g. 041 and 055
may take the wrong code paths if QEMU_DEFAULT_MACHINE is not
set. This can lead to false negatives.
Instead fail hard and tell the user we want to be run via "check".
The actual environment expected by the tests is currently only defined
by the implementation of "check". We use two of the environment
variables set by "check" as indication of whether we're being run via
"check". Anyone writing their own test runner (replacing "check") will
need to replicate the full environment (in a broader sense, not just
environment variables) provided by "check" anyway, including setting
the two environment variables we check. Whereas a regular developer
just trying to invoke the tests usually won't have both of these
defined in their environment so we can catch their mistake and give
out useful advice.
Signed-off-by: Sascha Silbe <[email protected]>
Reviewed-by: Bo Tu <[email protected]>
Message-id: [email protected]
Signed-off-by: Max Reitz <[email protected]>
| 5a8fabf3333c8b445f514377a4292ad0354fd35c | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/5a8fabf3333c8b445f514377a4292ad0354fd35c | 2016-05-12 15:33:24+02:00 |
trace: separate MMIO tracepoints from TB-access tracepoints
Memory accesses to code which has previously been translated into a TB show up
in the MMIO path, so that they may invalidate the TB. It's extremely confusing
to mix those in with device MMIOs, so split them into their own tracepoint.
Signed-off-by: Hollis Blanchard <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Message-id: [email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>
| f2d089425d43735b5369f70f3a36b712440578e5 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/f2d089425d43735b5369f70f3a36b712440578e5 | 2016-03-14 09:34:30+00:00 |
vhost-user: verify that number of queues is less than MAX_QUEUE_NUM
Fix QEMU crash when -netdev vhost-user,queues=n is passed with number
of queues greater than MAX_QUEUE_NUM.
Signed-off-by: Ilya Maximets <[email protected]>
Reviewed-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
Acked-by: Jason Wang <[email protected]>
| fff4e48ed54cc39e5942921df91300646ad37707 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/fff4e48ed54cc39e5942921df91300646ad37707 | 2016-03-11 14:55:15+02:00 |
xics: report errors with the QEMU Error API
Using the return value to report errors is error prone:
- xics_alloc() returns -1 on error but spapr_vio_busdev_realize() errors
on 0
- xics_alloc_block() returns the unclear value of ics->offset - 1 on error
but both rtas_ibm_change_msi() and spapr_phb_realize() error on 0
This patch adds an errp argument to xics_alloc() and xics_alloc_block() to
report errors. The return value of these functions is a valid IRQ number
if errp is NULL. It is undefined otherwise.
The corresponding error traces get promotted to error messages. Note that
the "can't allocate IRQ" error message in spapr_vio_busdev_realize() also
moves to xics_alloc(). Similar error message consolidation isn't really
applicable to xics_alloc_block() because callers have extra context (device
config address, MSI or MSIX).
This fixes the issues mentioned above.
Based on previous work from Brian W. Hart.
Signed-off-by: Greg Kurz <[email protected]>
Signed-off-by: David Gibson <[email protected]>
| a005b3ef50439b5bc6b2eb0b5bda8e8c7c2368bf | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/a005b3ef50439b5bc6b2eb0b5bda8e8c7c2368bf | 2016-02-28 16:19:02+11:00 |
ohci: allocate timer only once.
Allocate timer once, at init time, instead of allocating/freeing
it all the time when starting/stopping the bus. Simplifies the
code, also fixes bugs (memory leak) due to missing checks whenever
the time is already allocated or not.
Cc: Prasad J Pandit <[email protected]>
Reported-by: Zuozhi Fzz <[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
| fa1298c2d623522eda7b4f1f721fcb935abb7360 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/fa1298c2d623522eda7b4f1f721fcb935abb7360 | 2016-02-23 11:13:18+01:00 |
linux-user: correct timerfd_create syscall numbers
x86, m68k, ppc, sh4 and sparc failed to enable timerfd, because they
didn't have timerfd_create system call defined. Instead QEMU
defined timerfd syscall. Checking with kernel sources, it appears
kernel developers reused timerfd syscall number with timerfd_create,
presumably since no userspace called the old syscall number.
Reported-by: Laurent Vivier <[email protected]>
Reviewed-by: Laurent Vivier <[email protected]>
Signed-off-by: Riku Voipio <[email protected]>
| 93a92d3bd649cd315db47b9fb5dcb6af657cc22c | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/93a92d3bd649cd315db47b9fb5dcb6af657cc22c | 2016-02-23 21:25:10+02:00 |
net/filter: fix nf->netdev_id leak
Cc: Jason Wang <[email protected]>
Cc: [email protected]
Signed-off-by: Li Zhijian <[email protected]>
Signed-off-by: Jason Wang <[email protected]>
| 671f66f87fbf6cc6a3879f3055f16347b1db91e9 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/671f66f87fbf6cc6a3879f3055f16347b1db91e9 | 2016-01-11 11:01:34+08:00 |
net: pcnet: add check to validate receive data size(CVE-2015-7504)
In loopback mode, pcnet_receive routine appends CRC code to the
receive buffer. If the data size given is same as the buffer size,
the appended CRC code overwrites 4 bytes after s->buffer. Added a
check to avoid that.
Reported by: Qinghao Tang <[email protected]>
Cc: [email protected]
Reviewed-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Prasad J Pandit <[email protected]>
Signed-off-by: Jason Wang <[email protected]>
| 837f21aacf5a714c23ddaadbbc5212f9b661e3f7 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/837f21aacf5a714c23ddaadbbc5212f9b661e3f7 | 2015-12-07 21:43:48+08:00 |
xlnx-ep108: Fix minimum RAM check
The minimum RAM check logic for the Xiilnx EP108 was off by one,
which caused a false positive. Correct the logic to only print
warnings when the RAM is below 0x8000000.
Signed-off-by: Alistair Francis <[email protected]>
Message-id: fba8112ca7b01efd72553332b8045ecf107b7662.1448021100.git.alistair.francis@xilinx.com
Signed-off-by: Peter Maydell <[email protected]>
| 5b4a047fbe8ceb68ad1a78d51f0fadbe2bb12af7 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/5b4a047fbe8ceb68ad1a78d51f0fadbe2bb12af7 | 2015-11-24 14:12:15+00:00 |
configure: use appropriate code fragment for -fstack-protector checks
The check for stack-protector support consisted in compiling and linking
the test program below (output by function write_c_skeleton()) with the
compiler flag -fstack-protector-strong first and then with
-fstack-protector-all if the first one failed to work:
int main(void) { return 0; }
This caused false positives when using certain toolchains in which the
compiler accepted -fstack-protector-strong but no support was provided
by the C library, since for this stack-protector variant the compiler
emits canary code only for functions that meet specific conditions
(local arrays, memory references to local variables, etc.) and the code
fragment under test included none of them (hence no stack protection
code generated, no link failure).
This fix changes the test program used for -fstack-protector checks to
include a function that meets conditions which cause the compiler to
generate canary code in all variants.
Signed-off-by: Rodrigo Rebello <[email protected]>
Reviewed-by: Markus Armbruster <[email protected]>
Signed-off-by: Michael Tokarev <[email protected]>
| fccd35a04640a728f979e6d72b2c7d02c05549f0 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/fccd35a04640a728f979e6d72b2c7d02c05549f0 | 2015-12-04 09:39:55+03:00 |
qapi: Plug leaks in test-qmp-*
Make valgrind happy with the current state of the tests, so that
it is easier to see if future patches introduce new memory problems
without being drowned in noise. Many of the leaks were due to
calling a second init without tearing down the data from an earlier
visit. But since teardown is already idempotent, and we already
register teardown as part of input_visitor_test_add(), it is nicer
to just make init() safe to call multiple times than it is to have
to make all tests call teardown.
Another common leak was forgetting to clean up an error object,
after testing that an error was raised.
Another leak was in test_visitor_in_struct_nested(), failing to
clean the base member of UserDefTwo. Cleaning that up left
check_and_free_str() as dead code (since using the qapi_free_*
takes care of recursion, and we don't want double frees).
A final leak was in test_visitor_out_any(), which was reassigning
the qobj local variable to a subset of the overall structure
needing freeing; it did not result in a use-after-free, but
was not cleaning up all the qdict.
test-qmp-event and test-qmp-commands were already clean.
Signed-off-by: Eric Blake <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
| b18f1141d0afa00de11a8e079f4f5305c9e36893 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/b18f1141d0afa00de11a8e079f4f5305c9e36893 | 2015-11-09 16:45:05+01:00 |
ehci: clear suspend bit on detach
When a device is detached, clear the suspend bit (PORTSC_SUSPEND)
in the port status register.
The specs are not *that* clear what is supposed to happen in case
a suspended device is unplugged. But the enable bit (PORTSC_PED)
is cleared, and the specs mention setting suspend with enable being
unset is undefined behavior. So clearing them both looks reasonable,
and it actually fixes the reported bug.
https://bugzilla.redhat.com/show_bug.cgi?id=1268879
Cc: Hans de Goede <[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
Reviewed-by: Hans de Goede <[email protected]>
Message-id: [email protected]
| cbf82fa01e6fd4ecb234b235b10ffce548154a95 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/cbf82fa01e6fd4ecb234b235b10ffce548154a95 | 2015-11-03 11:55:51+01:00 |
xen-platform: Ensure xen is enabled when initializing
The xen-platform code crashes on reset if the xen backend is not
initialized, because it calls xc_hvm_set_mem_type(). Ensure xen-platform
won't be created without initializing the xen backend.
The assert can't be triggered by the user because the device is not
hotpluggable, and the only code creating it (at pc_xen_hvm_init())
already checks xen_enabled().
Signed-off-by: Eduardo Habkost <[email protected]>
Reviewed-by: Stefano Stabellini <[email protected]>
Signed-off-by: Stefano Stabellini <[email protected]>
| dbb7405d8caad0814ceddd568cb49f163a847561 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/dbb7405d8caad0814ceddd568cb49f163a847561 | 2015-10-19 10:16:01+00:00 |
qmp: Fix device-list-properties not to crash for abstract device
Broken in commit f4eb32b "qmp: show QOM properties in
device-list-properties", v2.1.
Cc: [email protected]
Signed-off-by: Markus Armbruster <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Reviewed-by: Andreas Färber <[email protected]>
Message-Id: <[email protected]>
| edb1523d90415cb79f60f83b4028ef3820d15612 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/edb1523d90415cb79f60f83b4028ef3820d15612 | 2015-10-09 15:25:57+02:00 |
virtio-net: correctly drop truncated packets
When packet is truncated during receiving, we drop the packets but
neither discard the descriptor nor add and signal used
descriptor. This will lead several issues:
- sg mappings are leaked
- rx will be stalled if a lots of packets were truncated
In order to be consistent with vhost, fix by discarding the descriptor
in this case.
Cc: Michael S. Tsirkin <[email protected]>
Signed-off-by: Jason Wang <[email protected]>
Reviewed-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
| 0cf33fb6b49a19de32859e2cdc6021334f448fb3 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/0cf33fb6b49a19de32859e2cdc6021334f448fb3 | 2015-10-01 16:16:52+03:00 |
qapi-visit: Convert to QAPISchemaVisitor, fixing bugs
Fixes flat unions to visit the base's base members (the previous
commit merely added them to the struct). Same test case.
Patch's effect on visit_type_UserDefFlatUnion():
static void visit_type_UserDefFlatUnion_fields(Visitor *m, UserDefFlatUnion **obj, Error **errp)
{
Error *err = NULL;
+ visit_type_int(m, &(*obj)->integer, "integer", &err);
+ if (err) {
+ goto out;
+ }
visit_type_str(m, &(*obj)->string, "string", &err);
if (err) {
goto out;
Test cases updated for the bug fix.
Fixes alternates to generate a visitor for their implicit enumeration
type. None of them are currently used, obviously. Example:
block-core.json's BlockdevRef now generates
visit_type_BlockdevRefKind().
Code is generated in a different order now, and therefore has got a
few new forward declarations. Doesn't matter.
The guard QAPI_VISIT_BUILTIN_VISITOR_DECL is renamed to
QAPI_VISIT_BUILTIN.
The previous commit's two ugly special cases exist here, too. Mark
both TODO.
Signed-off-by: Markus Armbruster <[email protected]>
Reviewed-by: Daniel P. Berrange <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
| 441cbac0c7e641780decbc674a9a68c6a5200f71 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/441cbac0c7e641780decbc674a9a68c6a5200f71 | 2015-09-21 09:56:40+02:00 |
rtl8139: Fix receive buffer overflow check
rtl8139_do_receive() tries to check for the overflow condition
by making sure that packet_size + 8 does not exceed the
available buffer space. The issue here is that RxBuffAddr,
used to calculate available buffer space, is aligned to a
a 4 byte boundry after every update. So it is possible that
every packet ends up being slightly padded when written
to the receive buffer. This padding is not taken into
account when checking for overflow and we may end up missing
the overflow condition can causing buffer overwrite.
This patch takes alignment into consideration when
checking for overflow condition.
Signed-off-by: Vladislav Yasevich <[email protected]>
Reviewed-by: Jason Wang <[email protected]>
Message-id: [email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>
| fabdcd3392f16fc666b1d04fc1bbe5f1dbbf10a4 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/fabdcd3392f16fc666b1d04fc1bbe5f1dbbf10a4 | 2015-09-02 13:42:31+01:00 |
block/mirror: limit qiov to IOV_MAX elements
If mirror has more free buffers than IOV_MAX, preadv(2)/pwritev(2)
EINVAL failures may be encountered.
It is possible to trigger this by setting granularity to a low value
like 8192.
This patch stops appending chunks once IOV_MAX is reached.
The spurious EINVAL failure can be reproduced with a qcow2 image file
and the following QMP invocation:
qmp.command('drive-mirror', device='virtio0', target='/tmp/r7.s1',
granularity=8192, sync='full', mode='absolute-paths',
format='raw')
While the guest is running dd if=/dev/zero of=/var/tmp/foo oflag=direct
bs=4k.
Cc: Jeff Cody <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>
Reviewed-by: Paolo Bonzini <[email protected]>
Message-id: [email protected]
Signed-off-by: Jeff Cody <[email protected]>
| cae98cb87d269c33d23b2bccd79bb8d99a60d811 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/cae98cb87d269c33d23b2bccd79bb8d99a60d811 | 2015-08-06 04:41:09-04:00 |
qxl: Fix new function name for spice-server library
The new spice-server function to limit the number of monitors (0.12.6)
changed while development from spice_qxl_set_monitors_config_limit to
spice_qxl_max_monitors (accepted upstream).
By mistake I post patch with former name.
This patch fix the function name.
Signed-off-by: Frediano Ziglio <[email protected]>
Acked-by: Christophe Fergeau <[email protected]>
Acked-by: Martin Kletzander <[email protected]>
Signed-off-by: Marc-André Lureau <[email protected]>
| a52b2cbf218d52f9e357961acb271a98a2bdff71 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/a52b2cbf218d52f9e357961acb271a98a2bdff71 | 2015-07-22 16:38:42+02:00 |
virtio-blk-dataplane: delete bottom half before the AioContext is freed
Other uses of aio_bh_new are safe as long as all scheduled bottom
halves are run before an iothread is destroyed, which bdrv_drain will
ensure:
- archipelago_finish_aiocb: BH deletes itself
- inject_error: BH deletes itself
- blkverify_aio_bh: BH deletes itself
- abort_aio_request: BH deletes itself
- curl_aio_readv: BH deletes itself
- gluster_finish_aiocb: BH deletes itself
- bdrv_aio_rw_vector: BH deletes itself
- bdrv_co_maybe_schedule_bh: BH deletes itself
- iscsi_schedule_bh, iscsi_co_generic_cb: BH deletes itself
- laio_attach_aio_context: deleted in laio_detach_aio_context,
called through bdrv_detach_aio_context before deleting the iothread
- nfs_co_generic_cb: BH deletes itself
- null_aio_common: BH deletes itself
- qed_aio_complete: BH deletes itself
- rbd_finish_aiocb: BH deletes itself
- dma_blk_cb: BH deletes itself
- virtio_blk_dma_restart_cb: BH deletes itself
- qemu_bh_new: main loop AioContext is never destroyed
- test-aio.c: bh_delete_cb deletes itself, otherwise deleted in
the same function that calls aio_bh_new
Reported-by: Cornelia Huck <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
Message-id: [email protected]
Message-Id: <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>
| fed105e2756dde98efa5e80baca02ae516dd1e51 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/fed105e2756dde98efa5e80baca02ae516dd1e51 | 2015-07-29 10:02:06+01:00 |
hw/core: rebase sysbus_get_fw_dev_path() to g_strdup_printf()
This is done mainly for improving readability, and in preparation for the
next patch, but Markus pointed out another bonus for the string being
returned:
"No arbitrary length limit. Before the patch, it's 39 characters, and the
code breaks catastrophically when qdev_fw_name() is longer: the second
snprintf() is called with its first argument pointing beyond path[], and
its second argument underflowing to a huge size."
Cc: [email protected]
Signed-off-by: Laszlo Ersek <[email protected]>
Tested-by: Marcel Apfelbaum <[email protected]>
Reviewed-by: Marcel Apfelbaum <[email protected]>
Reviewed-by: Markus Armbruster <[email protected]>
Reviewed-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
| 5ba03e2dd785362026917e4cc8a1fd2c64e8e62c | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/5ba03e2dd785362026917e4cc8a1fd2c64e8e62c | 2015-06-19 12:17:49+02:00 |
raw-posix: Fix .bdrv_co_get_block_status() for unaligned image size
Image files with an unaligned image size have a final hole that starts
at EOF, i.e. in the middle of a sector. Currently, *pnum == 0 is
returned when checking the status of this sector. In qemu-img, this
triggers an assertion failure.
In order to fix this, one type for the sector that contains EOF must be
found. Treating a hole as data is safe, so this patch rounds the
calculated number of data sectors up, so that a partial sector at EOF is
treated as a full data sector.
This fixes https://bugzilla.redhat.com/show_bug.cgi?id=1229394
Signed-off-by: Kevin Wolf <[email protected]>
Message-id: [email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>
| f4a769abaa51badea666093077c50c568c35de17 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/f4a769abaa51badea666093077c50c568c35de17 | 2015-06-12 13:58:33+01:00 |
fw_cfg: fix FW_CFG_BOOT_DEVICE update on ppc and sparc
On ppc, sparc, and sparc64, the value of the FW_CFG_BOOT_DEVICE 16bit
fw_cfg entry is repeatedly modified from a series of callbacks, which
currently results in the previous value's dynamically allocated memory
being leaked.
This patch switches updating to the new fw_cfg_modify_i16() call, which
does not cause memory leaks.
Signed-off-by: Gabriel Somlo <[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
| 48779e501810c5046ff8af7b9cf9c99bec2928a1 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/48779e501810c5046ff8af7b9cf9c99bec2928a1 | 2015-06-10 08:00:37+02:00 |
hw/ppc/e500.c: Fix memory leak
Signed-off-by: Shannon Zhao <[email protected]>
Signed-off-by: Shannon Zhao <[email protected]>
Signed-off-by: Michael Tokarev <[email protected]>
| f19377bf234a3359b0a03844822e97de80ad4f30 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/f19377bf234a3359b0a03844822e97de80ad4f30 | 2015-06-03 14:21:24+03:00 |
vl: fix memory leak spotted by valgrind
valgrind complains about:
==9276== 13 bytes in 1 blocks are definitely lost in loss record 1,046 of 3,673
==9276== at 0x4C2845D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==9276== by 0x2EAFBB: malloc_and_trace (vl.c:2556)
==9276== by 0x64C770E: g_malloc (in /usr/lib64/libglib-2.0.so.0.3600.3)
==9276== by 0x4A28BD: addr_to_string (vnc.c:123)
==9276== by 0x4A29AD: vnc_socket_local_addr (vnc.c:139)
==9276== by 0x4A9AFE: vnc_display_local_addr (vnc.c:3240)
==9276== by 0x2EF4FE: main (vl.c:4321)
Signed-off-by: Shannon Zhao <[email protected]>
Signed-off-by: Shannon Zhao <[email protected]>
Signed-off-by: Michael Tokarev <[email protected]>
| bd4baf6eebff75c7e0c67a729d1bdb5b0b36fe72 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/bd4baf6eebff75c7e0c67a729d1bdb5b0b36fe72 | 2015-06-03 14:21:24+03:00 |
fdc: Fix MSR.RQM flag
The RQM bit in MSR should be set whenever the guest is supposed to
access the FIFO, and it should be cleared in all other cases. This is
important so the guest can't continue writing/reading the FIFO beyond
the length that it's suppossed to access (see CVE-2015-3456).
Commit e9077462 fixed the CVE by adding code that avoids the buffer
overflow; however it doesn't correct the wrong behaviour of the floppy
controller which should already have cleared RQM.
Currently, RQM stays set all the time and during all phases while a
command is being processed. This is error-prone because the command has
to explicitly clear the flag if it doesn't need data (and indeed, the
two buggy commands that are the culprits for the CVE just forgot to do
that).
This patch clears RQM immediately as soon as all bytes that are expected
have been received. If the the FIFO is used in the next phase, the flag
has to be set explicitly there.
It also clear RQM after receiving all bytes even if the phase transition
immediately sets it again. While it's technically not necessary at the
moment because the state between clearing and setting RQM is not
observable by the guest, this is more explicit and matches how real
hardware works. It will actually become necessary in qemu once
asynchronous code paths are introduced.
This alone should have been enough to fix the CVE, but now we have two
lines of defense - even better.
Signed-off-by: Kevin Wolf <[email protected]>
Reviewed-by: John Snow <[email protected]>
Message-id: [email protected]
Signed-off-by: John Snow <[email protected]>
| 6cc8a11c84ddc18c64fc88d54c8e9dca24ada489 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/6cc8a11c84ddc18c64fc88d54c8e9dca24ada489 | 2015-06-02 13:34:44-04:00 |
tap-solaris: Convert tap_open() to Error
Fixes inappropriate use of syslog().
Not fixed: leaks on error paths, suspicious non-fatal errors. FIXMEs
added instead.
Signed-off-by: Markus Armbruster <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Message-id: [email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>
| 576c6eb6700d241c9d4a6883d25720c7bbaaeccd | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/576c6eb6700d241c9d4a6883d25720c7bbaaeccd | 2015-05-27 10:34:07+01:00 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.