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
ivshmem: fix memory_region_del_eventfd assertion failure We do not register ioeventfds unless the IVSHMEM_IOEVENTFD feature is set. The same feature must be checked before releasing the eventfds. Regression introduced by commit 563027c (ivshmem: use EventNotifier and memory API, 2012-07-05). Reported-by: Cam Macdonnell <[email protected]> Tested-by: Cam Macdonnell <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]> Signed-off-by: Anthony Liguori <[email protected]>
98609cd8fcf755c0ba7049d751353b8b2e243b65
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/98609cd8fcf755c0ba7049d751353b8b2e243b65
2012-08-23 20:19:59-05:00
qemu-ga: switch to the new error format on the wire IMPORTANT: this BREAKS qemu-ga compatibility for the error response. Instead of returning something like: { "error": { "class": "InvalidParameterValue", "data": {"name": "mode", "expected": "halt|powerdown|reboot" } } } qemu-ga now returns: { "error": { "class": "GenericError", "desc": "Parameter 'mode' expects halt|powerdown|reboot" } } Notice that this is also a bug fix, as qemu-ga wasn't returning the human message. Signed-off-by: Luiz Capitulino <[email protected]> Reviewed-by: Markus Armbruster <[email protected]>
93b91c59dbccde6e4d25661150c1529bd5ee4a06
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/93b91c59dbccde6e4d25661150c1529bd5ee4a06
2012-08-13 14:17:53-03:00
tests: Makefile: include dependency files Otherwise 'make check' won't recompile files that need to be recompiled because of header changes. To reproduce the bug, run: $ make check # succeeds $ echo B0RKED > hw/mc146818rtc_regs.h $ make check # is supposed to try to rebuild tests/rtc-test.o and fail Signed-off-by: Eduardo Habkost <[email protected]> Acked-by: Paolo Bonzini <[email protected]> Signed-off-by: Blue Swirl <[email protected]>
14117c7ba1f2b70a167cb8e4546ee5ec24af3cc9
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/14117c7ba1f2b70a167cb8e4546ee5ec24af3cc9
2012-07-28 09:13:49+00:00
qtest: fix infinite loop when QEMU aborts abruptly From Markus: Makes "make check" hang: QTEST_QEMU_BINARY=x86_64-softmmu/qemu-system-x86_64 gtester -k --verbose -m=quick tests/crash-test tests/rtc-test TEST: tests/crash-test... (pid=972) qemu-system-x86_64: Device needs media, but drive is empty [Nothing happens, wait a while, then hit ^C] make: *** [check-qtest-x86_64] Interrupt This was due to the fact that we weren't checked for errors when reading from the QMP socket. This patch adds appropriate error checking. Reported-by: Markus Armbruster <[email protected]> Signed-off-by: Anthony Liguori <[email protected]>
039380a8e18f618cdacf72486449c04dc1b70eef
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/039380a8e18f618cdacf72486449c04dc1b70eef
2012-06-27 16:26:59-05:00
tci: don't write zero for reloc in tci_out_label If tci_out_label is called in the context of tcg_gen_code_search_pc, we could be overwriting an already patched relocation with zero -- and not repatch it because the set_label is past search_pc, causing a QEMU crash when it tries to branch to a zero label. Not writing anything to the relocation area seems to be in line with what other backends do from the couple I looked at (x86, ppc). Signed-off-by: Scott Wood <[email protected]> Signed-off-by: Blue Swirl <[email protected]>
3c01ae0ea29915d165c384d0bd1cbafcf4364a4d
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/3c01ae0ea29915d165c384d0bd1cbafcf4364a4d
2012-06-24 12:19:24+00:00
monitor: Fix memory leak with readline completion Each string which is shown during readline completion in the QEMU monitor is allocated dynamically but currently never deallocated. Add the missing loop which calls g_free for the allocated strings. Signed-off-by: Stefan Weil <[email protected]> Reviewed-by: Stefan Hajnoczi <[email protected]>
fc9fa4bd0a295ac18808c4cd2cfac484bc4649d3
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/fc9fa4bd0a295ac18808c4cd2cfac484bc4649d3
2012-06-11 22:20:00+02:00
pci_bridge_dev: fix error path in pci_bridge_dev_initfn() Currently, we do not properly cleanup, if pci_bridge_dev_initfn fails to initialize properly. Make sure to call pci_bridge_exitfn() in the error path. Signed-off-by: Jason Baron <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]>
80aa796bf38b7ef21daa42673b4711510c450d8a
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/80aa796bf38b7ef21daa42673b4711510c450d8a
2012-06-11 22:55:13+03:00
Add API to get memory mapping without do paging crash does not need the virtual address and physical address mapping, and the mapping does not include the memory that is not referenced by the page table. crash does not use the virtual address, so we can create the mapping for all physical memory(virtual address is always 0). This patch provides a API to do this thing, and it will be used in the following patch. Signed-off-by: Wen Congyang <[email protected]> Signed-off-by: Luiz Capitulino <[email protected]>
2b05ab5229f880720ab6ca0e52577089889c10f9
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/2b05ab5229f880720ab6ca0e52577089889c10f9
2012-06-04 13:49:34-03:00
tcg/ppc: Do not overwrite lower address word on Darwin and AIX For targets where TARGET_LONG_BITS != 32, i.e. 64-bit guests, addr_reg is moved to r4. For hosts without TCG_TARGET_CALL_ALIGN_ARGS either data_reg2 or data_reg or a masked version thereof would overwrite r4. Place it in r5 instead, matching TCG_TARGET_CALL_ALIGN_ARGS hosts. This fixes immediate crashes of 64-bit guests observed on Darwin/ppc but not on Darwin/ppc64. Signed-off-by: Andreas Färber <[email protected]> Acked-by: malc <[email protected]> Acked-by: Alexander Graf <[email protected]> Signed-off-by: Anthony Liguori <[email protected]>
c1696d94c17b7fe03a2b103b1ba117fb0726a316
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/c1696d94c17b7fe03a2b103b1ba117fb0726a316
2012-05-09 13:59:18-05:00
Declare state directory in smb.conf The smb.conf generated by the userspace networking does not include a state directory directive. Samba therefore falls back to the default value. Since the user generally does not have write access to this path, smbd immediately crashes. The "state directory" option was added in Samba 3.4.0 (commit http://gitweb.samba.org/?p=samba.git;a=commit;h=7b02e05eb64f3ffd7aa1cf027d10a7343c0da757). This patch adds the missing option. Signed-off-by: Nikolaus Rath <[email protected]> Signed-off-by: Jan Kiszka <[email protected]>
276eda5735824dd6cf66e1f0951aa8af97354540
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/276eda5735824dd6cf66e1f0951aa8af97354540
2012-05-01 19:08:44-03:00
i82378/i82374: Do not create DMA controller twice This fixes a crash in PReP emulation when using DMA controller to access floppy drive. Signed-off-by: Hervé Poussineau <[email protected]> Signed-off-by: Andreas Färber <[email protected]>
049a9f7b946fe1d3ff97127f8905881dbb78cb00
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/049a9f7b946fe1d3ff97127f8905881dbb78cb00
2012-04-28 20:51:40+02:00
qcow2: Fix error handling in qcow2_alloc_cluster_offset If do_alloc_cluster_offset() fails, the error handling code tried to remove the request from the in-flight queue, to which it wasn't added yet, resulting in a NULL pointer dereference. m->nb_clusters really only becomes != 0 when the request is in the list. Signed-off-by: Kevin Wolf <[email protected]>
8dc0a5e7a06c059683f9c379c0a4b0bbc20d5c74
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/8dc0a5e7a06c059683f9c379c0a4b0bbc20d5c74
2012-04-19 16:03:27+02:00
linux-user: fix QEMU_STRACE=1 segfault While debugging some issues with QEMU_STRACE I stumbled over segmentation faults that were pretty reproducible. Turns out we tried to treat a normal return value as errno, resulting in an access over array boundaries for the resolution. Fix this by allowing failure to resolve invalid errnos into strings. Signed-off-by: Alexander Graf <[email protected]> Signed-off-by: Riku Voipio <[email protected]>
962b289ef35087fcd8764e4e29808d8ac90157f7
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/962b289ef35087fcd8764e4e29808d8ac90157f7
2012-02-02 17:51:20+02:00
qdev: accept both strings and integers for PCI addresses Visitors allow a limited form of polymorphism. Exploit it to support setting the non-legacy PCI address property both as a DD.F string and as an 8-bit integer. The 8-bit integer form is just too clumsy, it is unlikely that we will ever drop it. Signed-off-by: Paolo Bonzini <[email protected]>
768a9ebe188bd0a6172a9a4e64777d21fff7f014
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/768a9ebe188bd0a6172a9a4e64777d21fff7f014
2012-02-22 08:31:24+01:00
Revert "Handle SDL grabs failing (Mark McLoughlin)" This reverts commit 6bb816031f8bc0aafc3476e6dfa4293ee3a5f106. SDL_WM_GrabInput does not reliably bail out if grabbing is impossible. So if we get here, we already lost and will block. But this can no longer happen due to the check in sdl_grab_start. So this patch became obsolete. Conflicts: sdl.c Signed-off-by: Jan Kiszka <[email protected]> Signed-off-by: Anthony Liguori <[email protected]>
eaa2e027b73c9afca623d877c91150a94c83049d
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/eaa2e027b73c9afca623d877c91150a94c83049d
2012-02-01 14:45:02-06:00
Fix off-by-one in dirty bitmap functions Reported-by: Stefan Berger <[email protected]> Signed-off-by: Avi Kivity <[email protected]> Signed-off-by: Blue Swirl <[email protected]>
fd39941ac78fbe969e292eeb91415ec548bd97a6
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/fd39941ac78fbe969e292eeb91415ec548bd97a6
2012-01-29 14:53:55+00:00
hw/sd.c: Correct handling of APP_CMD status bit Fix some bugs in our implementation of the APP_CMD status bit: * the response to an ACMD should have APP_CMD set, not cleared * if an illegal ACMD is sent then the next command should be handled as a normal command This requires that we split "card is expecting an ACMD" from the state of the APP_CMD status bit (the latter indicates both "expecting ACMD" and "that was an ACMD"). Signed-off-by: Peter Maydell <[email protected]> Signed-off-by: Andrzej Zaborowski <[email protected]>
1d06cb7ab93f879ac25c9f5ef1d1ac8d97a42dfc
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/1d06cb7ab93f879ac25c9f5ef1d1ac8d97a42dfc
2011-12-21 05:01:46+01:00
qiov: prevent double free or use-after-free qemu_iovec_destroy does not clear the QEMUIOVector fully, and the data could thus be used after free or freed again. While I do not know any example in the tree, I observed this using virtio-scsi (and SCSI scatter/gather) when canceling DMA requests. Signed-off-by: Paolo Bonzini <[email protected]> Signed-off-by: Kevin Wolf <[email protected]>
bd83b3620517ef9f2079cfda465953e60263f623
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/bd83b3620517ef9f2079cfda465953e60263f623
2011-12-15 12:40:33+01:00
target-arm: Ignore attempts to set invalid modes in CPSR Ignore attempts to set the CPSR mode field to an invalid value. This is UNPREDICTABLE, but we should not cpu_abort() for things a malicious guest (or a confused user on the gdbstub interface) can provoke. Signed-off-by: Peter Maydell <[email protected]>
37064a8b6f9075e18b05bfc6d5264b138a224713
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/37064a8b6f9075e18b05bfc6d5264b138a224713
2012-01-05 15:49:06+00:00
block: add request tracking The block layer does not know about pending requests. This information is necessary for copy-on-read since overlapping requests must be serialized to prevent races that corrupt the image. The BlockDriverState gets a new tracked_request list field which contains all pending requests. Each request is a BdrvTrackedRequest record with sector_num, nb_sectors, and is_write fields. Note that request tracking is always enabled but hopefully this extra work is so small that it doesn't justify adding an enable/disable flag. Signed-off-by: Stefan Hajnoczi <[email protected]> Signed-off-by: Kevin Wolf <[email protected]>
dbffbdcfff69431b622866ac5ea78df74fdc02d4
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/dbffbdcfff69431b622866ac5ea78df74fdc02d4
2011-12-05 14:51:38+01:00
ccid: Fix buffer overrun in handling of VSC_ATR message ATR size exceeding the limit is diagnosed, but then we merrily use it anyway, overrunning card->atr[]. The message is read from a character device. Obvious security implications unless the other end of the character device is trusted. Spotted by Coverity. CVE-2011-4111. Signed-off-by: Markus Armbruster <[email protected]> Signed-off-by: Anthony Liguori <[email protected]>
7e62255a4b3e0e2ab84a3ec7398640e8ed58620a
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/7e62255a4b3e0e2ab84a3ec7398640e8ed58620a
2011-11-28 16:20:53-06:00
s390x: initialize virtio dev region When running the s390x virtio machine we can potentially use uninitialized memory for the virtio device backing ram. That can lead to weird breakge. So let's better initialize it to 0 properly. Reported-by: Andreas Färber <[email protected]> Signed-off-by: Alexander Graf <[email protected]> --- v1 -> v2: - use target_phys_addr_t
326384d5b6dcea69ca44695ee807f8b50234ab71
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/326384d5b6dcea69ca44695ee807f8b50234ab71
2011-11-14 17:47:27+01:00
ui: Plug memory leaks on parse_keyboard_layout() error path Spotted by Coverity. Signed-off-by: Markus Armbruster <[email protected]> Signed-off-by: Anthony Liguori <[email protected]>
f2d3476eba17486c42357ba25c36bd26e627d1d7
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/f2d3476eba17486c42357ba25c36bd26e627d1d7
2011-11-11 12:49:51-06:00
block: Make cache=unsafe flush to the OS cache=unsafe completely ignored bdrv_flush, because flushing the host disk costs a lot of performance. However, this means that qcow2 images (and potentially any other format) can lose data even after the guest has issued a flush if the qemu process crashes/is killed. In case of a host crash, data loss is certainly expected with cache=unsafe, but if just the qemu process dies this is a bit too unsafe. Now that we have two separate flush functions, we can choose to flush everythign to the OS, but don't enforce that it's physically written to the disk. Signed-off-by: Kevin Wolf <[email protected]>
ca716364f045da710ddef7fc6420bd6760e45b56
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/ca716364f045da710ddef7fc6420bd6760e45b56
2011-11-11 14:02:59+01:00
qemu-io: Handle create_iovec errors Callers of create_iovec() didn't check for failure and continued with uninitialised data in error cases. This patch adds checks to each call. Signed-off-by: Kevin Wolf <[email protected]>
f2360620fbebc24a0e2d58d0038ed3a007d28521
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/f2360620fbebc24a0e2d58d0038ed3a007d28521
2011-11-04 14:23:36+01:00
hw/tc58128.c: Remove unnecessary check for g_malloc failure Remove a check for g_malloc failing: this never happens. Also use g_malloc rather than g_malloc0 as we immediately memset the entire region and so zero-initialising it is pointless. Spotted by Coverity (see bug 887883). Signed-off-by: Peter Maydell <[email protected]> Signed-off-by: Anthony Liguori <[email protected]>
35914dc7240f7d81e22219217cfa826c2c383e7b
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/35914dc7240f7d81e22219217cfa826c2c383e7b
2011-11-11 12:49:53-06:00
loader: Fix read_targphys() to behave when read() fails Happily passes (size_t)-1 to rom_add_blob_fixed(), which promptly dies attempting to malloc that much. Spotted by Coverity. Bonus fix for ROMs larger than INT_MAX bytes: return ssize_t instead of int. Bug can't bite, because the only user load_aout() limits ROM size to an int value. Signed-off-by: Markus Armbruster <[email protected]> Signed-off-by: Blue Swirl <[email protected]>
725e14e91f80b6b2c07b75b66b7b042a9fa9340c
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/725e14e91f80b6b2c07b75b66b7b042a9fa9340c
2011-11-19 11:23:42+00:00
PPC: Fail configure when libfdt is not available We have several targets in the PPC tree now that basically require libfdt to function properly, namely the pseries and the e500 targets. This dependency will rather increase than decrease in the future, so I want to make sure that people building shiny new 1.0 actually have libfdt installed to get rid of a few ifdefs in the code. Warning: This patch will likely make configure fail for people who don't select their own --target-list, but don't have libfdt development packages installed. However, we really need this new dependency to move on. Signed-off-by: Alexander Graf <[email protected]> --- v1 -> v2: - no paranthesis - no fdt check for config_pseries - add . in error message
f90a9d02401eeeec18a122b61ccccb91244f321c
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/f90a9d02401eeeec18a122b61ccccb91244f321c
2011-10-30 20:03:26+01:00
fix memory leak in aio_write_f Haven't released memory of 'ctx' before return. Signed-off-by: Alex Jia <[email protected]> Signed-off-by: Kevin Wolf <[email protected]>
b1b1dad31f3a092e046b09795f4476705c4e564e
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/b1b1dad31f3a092e046b09795f4476705c4e564e
2011-10-21 17:34:12+02:00
qed: fix use-after-free during l2 cache commit QED's metadata caching strategy allows two parallel requests to race for metadata lookup. The first one to complete will populate the metadata cache and the second one will drop the data it just read in favor of the cached data. There is a use-after-free in qed_read_l2_table_cb() and qed_commit_l2_update() where l2_table->offset was used after the l2_table may have been freed due to a metadata lookup race. Fix this by keeping the l2_offset in a local variable and not reaching into the possibly freed l2_table. Reported-by: Amit Shah <[email protected]> Signed-off-by: Stefan Hajnoczi <[email protected]> Signed-off-by: Anthony Liguori <[email protected]>
e4fc8781db7c49b0c5ac5d24762e17c59dfe0871
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/e4fc8781db7c49b0c5ac5d24762e17c59dfe0871
2011-10-05 10:52:31-05:00
trace: use binary file open mode in simpletrace For Windows portability the simple trace backend must use the 'b' file open mode. This prevents the stdio library from mangling 0x0a/0x0d newline characters. Signed-off-by: Stefan Hajnoczi <[email protected]>
6c2a40742602c3cbe6a3905229dd539d7c311550
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/6c2a40742602c3cbe6a3905229dd539d7c311550
2011-09-21 11:30:10+01:00
iSCSI block driver This provides built-in support for iSCSI to QEMU. This has the advantage that the iSCSI devices need not be made visible to the host, which is useful if you have very many virtual machines and very many iscsi devices. It also has the benefit that non-root users of QEMU can access iSCSI devices across the network without requiring root privilege on the host. This driver interfaces with the multiplatform posix library for iscsi initiator/client access to iscsi devices hosted at git://github.com/sahlberg/libiscsi.git The patch adds the driver to interface with the iscsi library. It also updated the configure script to * by default, probe is libiscsi is available and if so, build qemu against libiscsi. * --enable-libiscsi Force a build against libiscsi. If libiscsi is not available the build will fail. * --disable-libiscsi Do not link against libiscsi, even if it is available. When linked with libiscsi, qemu gains support to access iscsi resources such as disks and cdrom directly, without having to make the devices visible to the host. You can specify devices using a iscsi url of the form : iscsi://[<username>[:<password>@]]<host>[:<port]/<target-iqn-name>/<lun> When using authentication, the password can optionally be set with LIBISCSI_CHAP_PASSWORD="password" to avoid it showing up in the process list Signed-off-by: Ronnie Sahlberg <[email protected]> Reviewed-by: Stefan Hajnoczi <[email protected]> Signed-off-by: Kevin Wolf <[email protected]>
c589b24972794a92fe3b5d6b9f4f09ef29e95460
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/c589b24972794a92fe3b5d6b9f4f09ef29e95460
2011-10-28 19:25:48+02:00
configure: Copy test data to build directory The QDict unit-tests (check-qdict) will fail when ran on a different build directory. That's, it only works when ran on the source dir. This happens because its data file (qdict-test-data.txt) is not copied to the build dir. Fix it. Signed-off-by: Luiz Capitulino <[email protected]>
70371cfbf1b5bac6471928f5e30356cb6f7d1187
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/70371cfbf1b5bac6471928f5e30356cb6f7d1187
2011-09-06 10:15:39-03:00
coroutine: introduce coroutines Asynchronous code is becoming very complex. At the same time synchronous code is growing because it is convenient to write. Sometimes duplicate code paths are even added, one synchronous and the other asynchronous. This patch introduces coroutines which allow code that looks synchronous but is asynchronous under the covers. A coroutine has its own stack and is therefore able to preserve state across blocking operations, which traditionally require callback functions and manual marshalling of parameters. Creating and starting a coroutine is easy: coroutine = qemu_coroutine_create(my_coroutine); qemu_coroutine_enter(coroutine, my_data); The coroutine then executes until it returns or yields: void coroutine_fn my_coroutine(void *opaque) { MyData *my_data = opaque; /* do some work */ qemu_coroutine_yield(); /* do some more work */ } Yielding switches control back to the caller of qemu_coroutine_enter(). This is typically used to switch back to the main thread's event loop after issuing an asynchronous I/O request. The request callback will then invoke qemu_coroutine_enter() once more to switch back to the coroutine. Note that if coroutines are used only from threads which hold the global mutex they will never execute concurrently. This makes programming with coroutines easier than with threads. Race conditions cannot occur since only one coroutine may be active at any time. Other coroutines can only run across yield. This coroutines implementation is based on the gtk-vnc implementation written by Anthony Liguori <[email protected]> but it has been significantly rewritten by Kevin Wolf <[email protected]> to use setjmp()/longjmp() instead of the more expensive swapcontext() and by Paolo Bonzini <[email protected]> for Windows Fibers support. Signed-off-by: Kevin Wolf <[email protected]> Signed-off-by: Stefan Hajnoczi <[email protected]>
00dccaf1f848290d979a4b1e6248281ce1b32aaa
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/00dccaf1f848290d979a4b1e6248281ce1b32aaa
2011-08-01 12:14:09+02:00
virtio-balloon: Check if balloon registration failed Multiple balloon registrations are not allowed; check if the registration with the qemu balloon api succeeded. If not, fail the device init. Signed-off-by: Amit Shah <[email protected]> Reviewed-by: Markus Armbruster <[email protected]> Acked-by: Michael S. Tsirkin <[email protected]>
f76f665547f4a954a2c83552a88816fc2a316be0
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/f76f665547f4a954a2c83552a88816fc2a316be0
2011-08-04 16:43:09-05:00
kvm: x86: Save/restore FPU OP, IP and DP These FPU states are properly maintained by KVM but not yet by TCG. So far we unconditionally set them to 0 in the guest which may cause state corruptions, though not with modern guests. To avoid breaking backward migration, use a conditional subsection that is only written if any of the three fields is non-zero. The guest's FNINIT clears them frequently, and cleared IA32_MISC_ENABLE MSR[2] reduces the probability of non-zero values further so that this subsection is not expected to restrict migration in any common scenario. Signed-off-by: Jan Kiszka <[email protected]> Signed-off-by: Avi Kivity <[email protected]>
42cc8fa620cbc73e349e96d84cf46469e828ec34
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/42cc8fa620cbc73e349e96d84cf46469e828ec34
2011-06-19 15:57:56+03:00
fix crash in migration, 32-bit userspace on 64-bit host This change fixes a long-standing immediate crash (memory corruption and abort in glibc malloc code) in migration on 32bits. The bug is present since this commit: commit 692d9aca97b865b0f7903565274a52606910f129 Author: Bruce Rogers <[email protected]> Date: Wed Sep 23 16:13:18 2009 -0600 qemu-kvm: allocate correct size for dirty bitmap The dirty bitmap copied out to userspace is stored in a long array, and gets copied out to userspace accordingly. This patch accounts for that correctly. Currently I'm seeing kvm crashing due to writing beyond the end of the alloc'd dirty bitmap memory, because the buffer has the wrong size. Signed-off-by: Bruce Rogers Signed-off-by: Marcelo Tosatti <[email protected]> --- a/qemu-kvm.c +++ b/qemu-kvm.c @@ int kvm_get_dirty_pages_range(kvm_context_t kvm, unsigned long phys_addr, - buf = qemu_malloc((slots[i].len / 4096 + 7) / 8 + 2); + buf = qemu_malloc(BITMAP_SIZE(slots[i].len)); r = kvm_get_map(kvm, KVM_GET_DIRTY_LOG, i, buf); BITMAP_SIZE is now open-coded in that function, like this: size = ALIGN(((mem->memory_size) >> TARGET_PAGE_BITS), HOST_LONG_BITS) / 8; The problem is that HOST_LONG_BITS in 32bit userspace is 32 but it's 64 in 64bit kernel. So userspace aligns this to 32, and kernel to 64, but since no length is passed from userspace to kernel on ioctl, kernel uses its size calculation and copies 4 extra bytes to userspace, corrupting memory. Here's how it looks like during migrate execution: our=20, kern=24 our=4, kern=8 ... our=4, kern=8 our=4064, kern=4064 our=512, kern=512 our=4, kern=8 our=20, kern=24 our=4, kern=8 ... our=4, kern=8 our=4064, kern=4064 *** glibc detected *** ./x86_64-softmmu/qemu-system-x86_64: realloc(): invalid next size: 0x08f20528 *** (our is userspace size above, kern is the size as calculated by the kernel). Fix this by always aligning to 64 in a hope that no platform will have sizeof(long)>8 any time soon, and add a comment describing it all. It's a small price to pay for bad kernel design. Alternatively it's possible to fix that in the kernel by using different size calculation depending on the current process. But this becomes quite ugly. Special thanks goes to Stefan Hajnoczi for spotting the fundamental cause of the issue, and to Alexander Graf for his support in #qemu. Signed-off-by: Michael Tokarev <[email protected]> CC: Bruce Rogers <[email protected]> Signed-off-by: Avi Kivity <[email protected]>
51b0c6065aa6e47a47094d73e24be298a4a7f3a1
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/51b0c6065aa6e47a47094d73e24be298a4a7f3a1
2011-05-02 09:38:35-03:00
Don't call cpu_synchronize_state() from machine init. This will deadlock when the I/O thread is used, since the CPU thread is blocked waiting for qemu_system_ready. The synchronization is unnecessary since this is before cpu_synchronize_all_post_init(). Signed-off-by: Scott Wood <[email protected]> Acked-by: Jan Kiszka <[email protected]> Signed-off-by: Alexander Graf <[email protected]>
64a4d100b502f24d0116437b9e5678c032a233e6
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/64a4d100b502f24d0116437b9e5678c032a233e6
2011-04-08 11:32:20+02:00
virtio: guard against negative vq notifies The virtio_queue_notify() function checks that the virtqueue number is less than the maximum number of virtqueues. A signed comparison is used but the virtqueue number could be negative if a buggy or malicious guest is run. This results in memory accesses outside of the virtqueue array. It is risky doing input validation in common code instead of at the guest<->host boundary. Note that virtio_queue_set_addr(), virtio_queue_get_addr(), virtio_queue_get_num(), and many other virtio functions do *not* validate the virtqueue number argument. Instead of fixing the comparison in virtio_queue_notify(), move the comparison to the virtio bindings (just like VIRTIO_PCI_QUEUE_SEL) where we have a uint32_t value and can avoid ever calling into common virtio code if the virtqueue number is invalid. Signed-off-by: Stefan Hajnoczi <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]>
7157e2e23e89adcd436caeab31fdd6b47eded377
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/7157e2e23e89adcd436caeab31fdd6b47eded377
2011-06-12 10:33:38+03:00
ccid: add passthru card device The passthru ccid card is a device sitting on the usb-ccid bus and using a chardevice to communicate with a remote device using the VSCard protocol defined in libcacard/vscard_common.h Usage docs available in following patch in docs/ccid.txt Signed-off-by: Alon Levy <[email protected]> --- Changes from v23->v24: * fixed double license line in header. Changes from v20->v21: (Jes Sorensen review) * add reference to COPYING in header * long comment reformatting Changes from v19->v20: * checkpatch.pl Changes from v18->v19: * add qdev.desc * remove .qdev.unplug (no hot unplug support for ccid bus) Changes from v16->v17: * fix wrong cast when receiving VSC_Error * ccid-card-passthru: force chardev user wakeup by sending Init see lengthy comment below. Changes from v15->v16: Behavioral changes: * return correct size * return error instead of assert if client sent too large ATR * don't assert if client sent too large a size, but add asserts for indices to buffer * reset vscard_in indices on chardev disconnect * handle init from client * error if no chardev supplied * use ntoh, hton * eradicate reader_id_t * remove Reconnect usage (removed from VSCARD protocol) * send VSC_SUCCESS on card insert/remove and reader add/remove Style fixes: * width of line fix * update copyright * remove old TODO's * update file header comment * use macros for debug levels * c++ style comment replacement * update copyright license * fix ATR size comment * fix whitespace in struct def * fix DPRINTF prefix * line width fix ccid-card-passthru: force chardev user wakeup by sending Init The problem: how to wakeup the user of the smartcard when the smartcard device is initialized? Long term solution: have a callback interface. This was done via the deprecated so called chardev ioctl interface. Short term solution: do a write. Specifically we write an Init message. And we change the client to send it's own Init message regardless of receiving this one. Additional Init messages will be regarded as acceptable, the first one received after connection establishment is the determining one wrt capabilities.
edbb21363fbfe40e050f583df921484cbc31c79d
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/edbb21363fbfe40e050f583df921484cbc31c79d
2011-04-01 19:07:48-05:00
libcacard: initial commit libcacard emulates a Common Access Card (CAC) which is a standard for smartcards. It is used by the emulated ccid card introduced in a following patch. Docs are available in docs/libcacard.txt Signed-off-by: Alon Levy <[email protected]> --- changes from v24->v25: * Fix out of tree builds. * Fix build with linux-user targets. changes from v23->v24: (Jes Sorensen review 2) * Makefile.target: use obj-$(CONFIG_*) += * remove unrequired includes, include qemu-common before qemu-thread * required adding #define NO_NSPR_10_SUPPORT (harmless) changes from v22->v23: * configure fixes: (reported by Stefan Hajnoczi) * test a = b, not a == b (second isn't portable) * quote $source_path in case it contains spaces - this doesn't really help since there are many other places that need similar fixes, not introduced by this patch. changes from v21->v22: * fix configure to not link libcacard if nss not found (reported by Stefan Hajnoczi) * fix vscclient linkage with simpletrace backend (reported by Stefan Hajnoczi) * card_7816.c: add missing break in ERROR_DATA_NOT_FOUND (reported by William van de Velde) changes from v20->v21: (Jes Sorensen review) * use qemu infrastructure: qemu-thread, qemu-common (qemu_malloc and qemu_free), error_report * assert instead of ASSERT * cosmetic fixes * use strpbrk and isspace * add --disable-nss --enable-nss here, instead of in the final patch. * split vscclient, passthru and docs to following patches. changes from v19->v20: * checkpatch.pl changes from v15->v16: Build: * don't erase self with distclean * fix make clean after make distclean * Makefile: make vscclient link quiet Behavioral: * vcard_emul_nss: load coolkey in more situations * vscclient: * use hton,ntoh * send init on connect, only start vevent thread on response * read payload after header check, before type switch * remove Reconnect * update for vscard_common changes, empty Flush implementation Style/Whitespace: * fix wrong variable usage * remove unused variable * use only C style comments * add copyright header * fix tabulation Signed-off-by: Alon Levy <[email protected]> libcacard: fix out of tree builds
111a38b018c86e6651750c5a548ad534f80b5bb5
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/111a38b018c86e6651750c5a548ad534f80b5bb5
2011-04-01 19:07:48-05:00
hw/xen_disk: aio_inflight not released in handling ioreq when nr_segments==0 In hw/xen_disk.c, async writing ioreq is leaked when ioreq->req.nr_segments==0, because `aio_inflight` flag is not released properly (skipped by misplaced "break"). Signed-off-by: Feiran Zheng <[email protected]> Acked-by: Stefano Stabellini <[email protected]> Signed-off-by: Kevin Wolf <[email protected]>
209bef3e014ba1613759575e2c10f0ef8d64eb84
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/209bef3e014ba1613759575e2c10f0ef8d64eb84
2011-03-15 13:21:14+01:00
bitops: fix test_and_change_bit() ./bitops.h:192: warning: ‘old’ is used uninitialized in this function Signed-off-by: Corentin Chary <[email protected]> Signed-off-by: Blue Swirl <[email protected]>
04483e150d412f5861a00c30581df7ba90a816e7
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/04483e150d412f5861a00c30581df7ba90a816e7
2011-02-25 17:19:02+00:00
tests: Fix two memory leaks Although both leaks are not really important, fix them to avoid cppcheck warnings: tests/linux-test.c:433: error: Memory leak: stack1 tests/linux-test.c:433: error: Memory leak: stack2 Signed-off-by: Stefan Weil <[email protected]> Signed-off-by: Aurelien Jarno <[email protected]>
8da91fffeaffba5f014dfdcc88b672590e83b7fc
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/8da91fffeaffba5f014dfdcc88b672590e83b7fc
2011-02-20 18:45:08+01:00
target-arm: Fix rounding constant addition for Neon shifts Handle cases where adding the rounding constant could overflow in Neon shift instructions: VRSHR, VRSRA, VQRSHRN, VQRSHRUN, VRSHRN. Signed-off-by: Christophe Lyon <[email protected]> [[email protected]: fix handling of large shifts in rshl_s32, calculate signed saturated value as other functions do.] Signed-off-by: Peter Maydell <[email protected]> Signed-off-by: Aurelien Jarno <[email protected]>
4bd4ee072cfbd3555b34279c8529f7f5f8d6c14a
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/4bd4ee072cfbd3555b34279c8529f7f5f8d6c14a
2011-02-20 17:43:01+01:00
QCOW2: bug fix - read base image beyond its size This patch fixes the following bug in QCOW2. For a QCOW2 image that is larger than its base image, when handling a read request straddling over the end of the base image, the QCOW2 driver attempts to read beyond the end of the base image and the request would fail. This bug was found by Fast Virtual Disk (FVD)'s fully automated testing tool. The following test triggered the bug. dd if=/dev/zero of=/var/ramdisk/truth.raw count=0 bs=1 seek=1098561536 dd if=/dev/zero of=/var/ramdisk/zero-500M.raw count=0 bs=1 seek=593099264 ./qemu-img create -f qcow2 -ocluster_size=65536,backing_fmt=blksim -b /var/ramdisk/zero-500M.raw /var/ramdisk/test.qcow2 1098561536 ./qemu-io --auto --seed=30477694 --truth=/var/ramdisk/truth.raw --format=qcow2 --test=blksim:/var/ramdisk/test.qcow2 --verify_write=true --compare_before=false --compare_after=true --round=100000 --parallel=100 --io_size=10485760 --fail_prob=0 --cancel_prob=0 --instant_qemubh=true Signed-off-by: Chunqiang Tang <[email protected]> Signed-off-by: Kevin Wolf <[email protected]>
e0d9c6f93729c9bfc98fcafcd73098bb8e131aeb
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/e0d9c6f93729c9bfc98fcafcd73098bb8e131aeb
2011-02-10 13:23:44+01:00
linux-user: decode MAP_{UNINITIALIZED,EXECUTABLE} in strace Signed-off-by: Mike Frysinger <[email protected]> Signed-off-by: Riku Voipio <[email protected]>
906c1b8ec8ed8987662e2697af20b9ca19c659b5
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/906c1b8ec8ed8987662e2697af20b9ca19c659b5
2011-02-09 10:33:54+02:00
Set the right overflow bit for neon 32 and 64 bit saturating add/sub. Signed-off-by: Christophe Lyon <[email protected]> Reviewed-by: Peter Maydell <[email protected]> Signed-off-by: Aurelien Jarno <[email protected]>
72902672dc2ed6281cdb205259c1d52ecf01f6b2
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/72902672dc2ed6281cdb205259c1d52ecf01f6b2
2011-02-04 20:57:41+01:00
escc: fix interrupt flags Recent PowerPC kernel end up in kernel panic during boot in -nographic mode. In this mode the second serial port is used as the udbg console, and thus a few characters are sent on this port. This activates the tx interrupt flag, and later choke the Linux kernel, as it was not expecting such a flag to be set. The problem here comes from the fact that contrary to most devices the interrupt flags are only set if the interrupt is enabled. Quoting the datasheet: "If the corresponding IE bit is not set, the IP for that source of interrupt will never be set." This patch fixes that by enabling the interrupt flag only when the corresponding interrupt is enabled. Cc: Blue Swirl <[email protected]> Signed-off-by: Aurelien Jarno <[email protected]>
f53671c054ba0b5d5b10e2a7294786fa2f73479e
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/f53671c054ba0b5d5b10e2a7294786fa2f73479e
2011-01-29 15:07:19+01:00
bsd-user: Fix possible memory leaks and wrong realloc call These errors were reported by cppcheck: [bsd-user/elfload.c:1108]: (error) Common realloc mistake: "syms" nulled but not freed upon failure [bsd-user/elfload.c:1076]: (error) Memory leak: s [bsd-user/elfload.c:1079]: (error) Memory leak: syms v2: * The previous fix for memory leaks was incomplete (thanks to Peter Maydell for te hint). * Fix wrong realloc usage, too. Cc: Blue Swirl <[email protected]> Signed-off-by: Stefan Weil <[email protected]> Signed-off-by: Blue Swirl <[email protected]>
29718712eb2e53c09d28f08e39f6514d690f6fd3
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/29718712eb2e53c09d28f08e39f6514d690f6fd3
2011-01-17 20:23:47+00:00
ppc405_uc: fix a buffer overflow Fix a buffer overflow, reported by cppcheck: [/src/qemu/hw/ppc405_uc.c:72]: (error) Buffer access out-of-bounds: bd.bi_s_version The use of field bi_s_version seems to be a typo, it should be bi_r_version. Signed-off-by: Blue Swirl <[email protected]>
4508d81a788f451c83604e1d0033243e191d71a7
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/4508d81a788f451c83604e1d0033243e191d71a7
2011-01-12 21:12:31+00:00
tap: clear vhost_net backend on cleanup Frontends calling tap_get_vhost_net get an invalid pointer after the peer backend has been deleted. Jason Wang <[email protected]> reports this leading to a crash in ack_features when we remove the vhost-net bakend of a virtio nic. The fix is simply to clear the backend pointer. Signed-off-by: Michael S. Tsirkin <[email protected]>
54cdaa1bad3885448ef39faad93d40be3b223519
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/54cdaa1bad3885448ef39faad93d40be3b223519
2010-11-04 15:10:03+02:00
ide/atapi: add support for GET EVENT STATUS NOTIFICATION The GET EVENT STATUS NOTIFICATION is a mandatory command according to MMC-3, even if event status notification is not supported. This patch adds support for this command. It returns NEA ("No Event Available") with an empty "Supported Event Classes" to show that it doesn't event support status notification. If asychronous operation is requested, which requires NCQ support, it returns an error according to the specifications. This fixes HAL support on FreeBSD and derivatives, which fill up the logs every second with: acd0: FAILURE - unknown CMD (0x03) ILLEGAL REQUEST asc=0x20 ascq=0x00 Signed-off-by: Aurelien Jarno <[email protected]> Signed-off-by: Kevin Wolf <[email protected]>
253cb7b9909806b83d73269afb9cf0ab3fa2ce2c
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/253cb7b9909806b83d73269afb9cf0ab3fa2ce2c
2010-07-26 13:39:39+02:00
qcow2: Use bdrv_(p)write_sync for metadata writes Use bdrv_(p)write_sync to ensure metadata integrity in case of a crash. Signed-off-by: Kevin Wolf <[email protected]>
8b3b720620a1137a1b794fc3ed64734236f94e06
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/8b3b720620a1137a1b794fc3ed64734236f94e06
2010-06-22 14:38:02+02:00
monitor: allow device to be ejected if no disk is inserted This changes the monitor eject_device() function to not check for bdrv_is_inserted(). Example run where the bug manifests itself: (output of 'info block' is stripped to include only the CD-ROM device) (qemu) info block ide1-cd0: type=cdrom removable=1 locked=0 [not inserted] (qemu) change ide1-cd0 /dev/cdrom host_cdrom (qemu) info block ide1-cd0: type=cdrom removable=1 locked=0 file=/dev/cdrom ro=1 drv=host_cdrom encrypted=0 (qemu) eject ide1-cd0 (qemu) info block ide1-cd0: type=cdrom removable=1 locked=0 file=/dev/cdrom ro=1 drv=host_cdrom encrypted=0 # at this point, a disk was inserted on the host CD-ROM drive (qemu) info block ide1-cd0: type=cdrom removable=1 locked=0 file=/dev/cdrom ro=1 drv=host_cdrom encrypted=0 (qemu) eject ide1-cd0 (qemu) info block ide1-cd0: type=cdrom removable=1 locked=0 [not inserted] (qemu) The first eject command didn't work because the is_inserted() check failed. I have no clue why the code had the is_inserted() check, as it doesn't matter if there is a disk present at the host drive, when the user wants the virtual device to be disconnected from the host device. The is_inserted() check has another side effect: a memory leak if the "change" command is used multiple times, as do_change() calls eject_device() before re-opening the block device, but bdrv_close() is never called. Signed-off-by: Eduardo Habkost <[email protected]> Signed-off-by: Kevin Wolf <[email protected]>
3b5276b5ec52f461f23e62d4560686f10d27605e
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/3b5276b5ec52f461f23e62d4560686f10d27605e
2010-06-22 14:38:01+02:00
un-register kbd driver in case of USB kbd unplug. If a USB keyboard is unplugged, the keyboard eventhandler is never removed, and events will continue to be passed through to the device, causing crashes or memory corruption. Signed-off-by: Jes Sorensen <[email protected]> Signed-off-by: Anthony Liguori <[email protected]>
46aaebff40f942e7b17b426916a3dee9b8b6f274
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/46aaebff40f942e7b17b426916a3dee9b8b6f274
2010-06-14 15:46:28-05:00
sparc64: improve ldf and stf insns - implemented block load/store primary/secondary with user privilege Signed-off-by: Igor V. Kovalenko <[email protected]> Signed-off-by: Blue Swirl <[email protected]>
0e2fa9cab9c124788077de728f1e6744d1dd8bb2
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/0e2fa9cab9c124788077de728f1e6744d1dd8bb2
2010-06-02 20:06:46+00:00
stash away SCM_RIGHTS fd until a getfd command arrives If there is already a fd in s->msgfd before recvmsg it is closed by parts that this patch does not touch. So, only one descriptor can be "leaked" by attaching it to a command other than getfd. Signed-off-by: Paolo Bonzini <[email protected]> Signed-off-by: Luiz Capitulino <[email protected]>
e53f27b9d9df73461308618151fa6e6392aebd85
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/e53f27b9d9df73461308618151fa6e6392aebd85
2010-04-26 16:36:31-03:00
target-arm: resource leak fixes for iwmmxt disassemble This patch fixes few resource leaks in the iwmmxt disassemble. Signed-off-by: Lars Munch <[email protected]> Signed-off-by: Aurelien Jarno <[email protected]>
d9968827032039d99b38db7ad3598767e1a53bbb
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/d9968827032039d99b38db7ad3598767e1a53bbb
2010-04-08 11:11:21+02:00
qemu-nbd: Fix invalid usage of the first argument of errx errx takes the exit status of a process as the first argument. Passing errno to it is wrong. Instead the patch lets errx take EXIT_FAILURE. Signed-off-by: Ryota Ozaki <[email protected]> Signed-off-by: Aurelien Jarno <[email protected]>
b6353bea572f8cc0f35fb7dc438ce74c08dda9e7
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/b6353bea572f8cc0f35fb7dc438ce74c08dda9e7
2010-03-27 14:02:46+01:00
Fix -usbdevice crash If -usbdevice is used on a machine with no USB busses, usb_create will fail and return NULL. Patch below handles this failure gracefully rather than crashing when we try to init the device. Signed-off-by: Paul Brook <[email protected]>
d44168fffa07fc57e61a37da65e9348661dec887
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/d44168fffa07fc57e61a37da65e9348661dec887
2010-02-25 13:29:06+00:00
don't dereference NULL after failed strdup Most of these are obvious NULL-deref bug fixes, for example, the ones in these files: block/curl.c net.c slirp/misc.c and the first one in block/vvfat.c. The others in block/vvfat.c may not lead to an immediate segfault, but I traced the two schedule_rename(..., strdup(path)) uses, and a failed strdup would appear to trigger this assertion in handle_renames_and_mkdirs: assert(commit->path); The conversion to use qemu_strdup in envlist_to_environ is not technically needed, but does avoid a theoretical leak in the caller when strdup fails for one value, but later succeeds in allocating another buffer(plausible, if one string length is much larger than the others). The caller does not know the length of the returned list, and as such can only free pointers until it hits the first NULL. If there are non-NULL pointers beyond the first, their buffers would be leaked. This one is admittedly far-fetched. The two in linux-user/main.c are worth fixing to ensure that an OOM error is diagnosed up front, rather than letting it provoke some harder-to-diagnose secondary error, in case of exec failure, or worse, in case the exec succeeds but with an invalid list of command line options. However, considering how unlikely it is to encounter a failed strdup early in main, this isn't a big deal. Note that adding the required uses of qemu_strdup here and in envlist.c induce link failures because qemu_strdup is not currently in any library they're linked with. So for now, I've omitted those changes, as well as the fixes in target-i386/helper.c and target-sparc/helper.c. If you'd like to see the above discussion (or anything else) in the commit log, just let me know and I'll be happy to adjust. >From 9af42864fd1ea666bd25e2cecfdfae74c20aa8c7 Mon Sep 17 00:00:00 2001 From: Jim Meyering <[email protected]> Date: Mon, 8 Feb 2010 18:29:29 +0100 Subject: [PATCH] don't dereference NULL after failed strdup Handle failing strdup by replacing each use with qemu_strdup, so as not to dereference NULL or trigger a failing assertion. * block/curl.c (curl_open): s/\bstrdup\b/qemu_strdup/ * block/vvfat.c (init_directories): Likewise. (get_cluster_count_for_direntry, check_directory_consistency): Likewise. * net.c (parse_host_src_port): Likewise. * slirp/misc.c (fork_exec): Likewise. Signed-off-by: Anthony Liguori <[email protected]>
6265eb26a375179f193f792e4f0d49036d2cf052
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/6265eb26a375179f193f792e4f0d49036d2cf052
2010-02-10 14:00:53-06:00
MCE: Fix bug of IA32_MCG_STATUS after system reset Now, if we inject a fatal MCE into guest OS, for example Linux, Linux will go panic and then reboot. But if we inject another MCE now, system will reset directly instead of go panic firstly, because MCG_STATUS.MCIP is set to 1 and not cleared after reboot. This is does not follow the behavior in real hardware. This patch fixes this via set env->mcg_status to 0 during system reset. Signed-off-by: Huang Ying <[email protected]> Signed-off-by: Anthony Liguori <[email protected]>
af364b418cc57c53275c76ee5e0e0645908605b9
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/af364b418cc57c53275c76ee5e0e0645908605b9
2010-01-11 09:56:30-06:00
linux-user: Fix mmap_lock ordering mmap_lock() can be called while tb_lock() is being held. To avoid deadlock when one thread is holding mmap_lock and another tb_lock, _always_ lock first tb_lock(). Signed-off-by: Riku Voipio <[email protected]> Signed-off-by: Aurelien Jarno <[email protected]>
d032d1b4b4bc29cb44592ee207bd8ae7cd4da668
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/d032d1b4b4bc29cb44592ee207bd8ae7cd4da668
2009-12-19 19:45:27+01:00
target-alpha: Fix compiler warning for gcc-4.3 (and older) "Old" compilers obviously are not able to recognise that all cases are handled here: qemu/target-alpha/helper.c:70: error: ‘round_mode’ may be used uninitialized in this function A small modification helps the compiler to do its jobs. gcc-4.4 does not need this, but is still not standard on all platforms. Signed-off-by: Stefan Weil <[email protected]> Acked-by: Laurent Desnogues <[email protected]> Signed-off-by: Aurelien Jarno <[email protected]>
212df029754caabba45f941fbd22ec219b934ef9
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/212df029754caabba45f941fbd22ec219b934ef9
2009-12-16 18:26:28+01:00
target-s390: Fail on unknown instructions We were being a bit too nice and didn't give the guest an invalid instruction interrupt. While that works, it's not exactly the fastest thing to do, since now the guest doesn't know that we're not really implementing that instruction, so it continues doing it. We run into this with the set_page_unstable hint instruction. So let's bail out in these cases. Signed-off-by: Alexander Graf <[email protected]> Signed-off-by: Aurelien Jarno <[email protected]>
d7963c43b9646e4dfc69a4253c61e4bab7b661cd
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/d7963c43b9646e4dfc69a4253c61e4bab7b661cd
2009-12-18 16:32:03+01:00
Fix 32-bit overflow in parallels image support Signed-off-by: David Woodhouse <[email protected]> Signed-off-by: Anthony Liguori <[email protected]>
c34d2451ed32651e14e309f94009be07d231ee96
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/c34d2451ed32651e14e309f94009be07d231ee96
2009-11-12 11:23:56-06:00
whitelist host virtio networking features This patch is a followup to 8eca6b1bc770982595db2f7207c65051572436cb, fixing crashes when guests with 2.6.25 virtio drivers have saturated virtio network connections. https://bugs.edge.launchpad.net/ubuntu/+source/qemu-kvm/+bug/458521 That patch should have been whitelisting *_HOST_* rather than the the *_GUEST_* features. I tested this by running an Ubuntu 8.04 Hardy guest (2.6.24 kernel + 2.6.25-virtio driver). I saturated both the incoming, and outgoing network connection with nc, seeing sustained 6MB/s up and 6MB/s down bitrates for ~20 minutes. Previously, this crashed immediately. Now, the guest does not crash and maintains network connectivity throughout the test. Signed-off-by: Dustin Kirkland <[email protected]> Signed-off-by: Mark McLoughlin <[email protected]> Signed-off-by: Anthony Liguori <[email protected]>
184bd0484533b725194fa517ddc271ffd74da7c9
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/184bd0484533b725194fa517ddc271ffd74da7c9
2009-11-09 08:43:03-06:00
net: add macaddr type. Add new type for mac addresses. Add function which sets the qemu default mac address if it finds the mac address uninitialized (i.e. all zeros). Signed-off-by: Gerd Hoffmann <[email protected]> Signed-off-by: Anthony Liguori <[email protected]>
76d32cba7e502faf04fdce6b14b2f94a301e6dc8
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/76d32cba7e502faf04fdce6b14b2f94a301e6dc8
2009-10-27 12:28:36-05:00
net: Fix -net socket,listen (Jan Kiszka) In case no symbolic name is provided when requesting VLAN connection via listening TCP socket ('-net socket,listen=...'), qemu crashes. This fixes the cause. Signed-off-by: Jan Kiszka <[email protected]> Signed-off-by: Anthony Liguori <[email protected]> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7196 c046a42c-6fe2-441c-8c8c-71466251a162
ea053add700d8abe203cd79a9ffb082aee4eabc0
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/ea053add700d8abe203cd79a9ffb082aee4eabc0
2009-04-21 19:56:11+00:00
Introduce VLANClientState::cleanup() (Mark McLoughlin) We're currently leaking memory and file descriptors on device hot-unplug. Signed-off-by: Mark McLoughlin <[email protected]> Signed-off-by: Anthony Liguori <[email protected]> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7150 c046a42c-6fe2-441c-8c8c-71466251a162
b946a1533209f61a93e34898aebb5b43154b99c3
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/b946a1533209f61a93e34898aebb5b43154b99c3
2009-04-17 17:11:08+00:00
Remove some useless malloc() checking (Mark McLoughlin) Now that we abort() on malloc, neither qemu_find_vlan() nor net_tap_fd_init() can fail. Signed-off-by: Mark McLoughlin <[email protected]> Signed-off-by: Anthony Liguori <[email protected]> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7146 c046a42c-6fe2-441c-8c8c-71466251a162
9036de1a8ad6c565a4e5d8cd124ad8dd05e7d4d4
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/9036de1a8ad6c565a4e5d8cd124ad8dd05e7d4d4
2009-04-17 17:10:51+00:00
array overflow in hw/stellaris.c and hw/omap_dss.c (Jindrich Makovicka) git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5064 c046a42c-6fe2-441c-8c8c-71466251a162
f3d8b1eb105199a1d6bf063a8a574e782689909a
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/f3d8b1eb105199a1d6bf063a8a574e782689909a
2008-08-22 08:57:19+00:00
Add a path length check to prevent heap overflow (Eric Milliken). git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3916 c046a42c-6fe2-441c-8c8c-71466251a162
b34d259a81500d75e4cf435f1e8b262ba7e1421a
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/b34d259a81500d75e4cf435f1e8b262ba7e1421a
2008-01-14 03:48:37+00:00
Fix off-by-one address checks in MIPS64 MMU, by Aurelien Jarno. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3718 c046a42c-6fe2-441c-8c8c-71466251a162
67d6abff605064317d1922745b2e99ffc57b4a77
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/67d6abff605064317d1922745b2e99ffc57b4a77
2007-11-22 00:34:36+00:00
Fix PowerPC 64x64 bits multiplication overflow check. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3444 c046a42c-6fe2-441c-8c8c-71466251a162
88ad920b8adbce8b00085c51a61e57b5fbc83b0c
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/88ad920b8adbce8b00085c51a61e57b5fbc83b0c
2007-10-25 23:36:08+00:00
Fix overflow when multiplying two large positive numbers. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3429 c046a42c-6fe2-441c-8c8c-71466251a162
67fc07d3fba681f3362f7644a69b7a581a2670e8
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/67fc07d3fba681f3362f7644a69b7a581a2670e8
2007-10-23 23:22:54+00:00
DOS 6.22 fix (Johannes Schindelin) git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1627 c046a42c-6fe2-441c-8c8c-71466251a162
0b7a4a97119eefc2c39c5f34602df9e1cc0f493b
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/0b7a4a97119eefc2c39c5f34602df9e1cc0f493b
2005-11-19 18:17:16+00:00
Handle division by zero case in Sparc64 udivx and sdivx ops git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2767 c046a42c-6fe2-441c-8c8c-71466251a162
14a1120e5c8c4c29441141b4657f91e04d10fac0
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/14a1120e5c8c4c29441141b4657f91e04d10fac0
2007-05-02 16:37:44+00:00
lmsw fix (aka dos4gw bug) git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@885 c046a42c-6fe2-441c-8c8c-71466251a162
710c15a2e9078931f496424d8e10241f4930f940
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/710c15a2e9078931f496424d8e10241f4930f940
2004-06-04 11:20:49+00:00
buffer overflow fix - handle case where stdin is closed (Rusty Russell) git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@397 c046a42c-6fe2-441c-8c8c-71466251a162
27c3f2cb9bf2112b82edac898094e0a39e6efca1
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/27c3f2cb9bf2112b82edac898094e0a39e6efca1
2003-09-30 21:40:47+00:00
virito-pci: fix OVERRUN problem Overrunning array "proxy->guest_features" of 2 4-byte elements at element index 2 (byte offset 8) using index "proxy->gfselect" (which evaluates to 2). Normally, the Linux kernel driver just read/write '0' or '1' as the "proxy->gfselect" values, so using '<' instead of '=<' to make coverity happy and avoid potential harm. Cc: Michael S. Tsirkin <[email protected]> Signed-off-by: Gonglei <[email protected]> Reviewed-by: Michael S. Tsirkin <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]>
3750dabc69d76f0938cc726a64a70e4ae2fe21df
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/3750dabc69d76f0938cc726a64a70e4ae2fe21df
2015-06-23 08:14:13+02:00
tcg/sparc: Zero extend address argument to ld/st helpers The C store helper functions take the address argument as a target_ulong type; if this is 32 bit but the host is 64 bit then the SPARC calling convention requires that the caller must zero extend the value. We weren't doing this, which meant we could pass values to the caller with high bits set and QEMU would crash if it was compiled with optimizations. In particular, the i386 BIOS would not start. Signed-off-by: Peter Maydell <[email protected]> Message-id: [email protected] Reviewed-by: Richard Henderson <[email protected]>
5c32be5baf41aec4f4675d2bf24f9948756abf3c
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/5c32be5baf41aec4f4675d2bf24f9948756abf3c
2017-04-03 12:59:37+01:00
qdev: Check for the availability of a hotplug controller before adding a device The qdev_unplug() function contains a g_assert(hotplug_ctrl) statement, so QEMU crashes when the user tries to device_add + device_del a device that does not have a corresponding hotplug controller. This could be provoked for a couple of devices in the past (see commit 4c93950659487c7ad or 84ebd3e8c7d4fe955 for example), and can currently for example also be triggered like this: $ s390x-softmmu/qemu-system-s390x -M none -nographic QEMU 2.10.50 monitor - type 'help' for more information (qemu) device_add qemu-s390x-cpu,id=x (qemu) device_del x ** ERROR:qemu/qdev-monitor.c:872:qdev_unplug: assertion failed: (hotplug_ctrl) Aborted (core dumped) So devices clearly need a hotplug controller when they should be usable with device_add. The code in qdev_device_add() already checks whether the bus has a proper hotplug controller, but for devices that do not have a corresponding bus, there is no appropriate check available yet. In that case we should check whether the machine itself provides a suitable hotplug controller and refuse to plug the device if none is available. Reviewed-by: Igor Mammedov <[email protected]> Signed-off-by: Thomas Huth <[email protected]> Message-Id: <[email protected]> Reviewed-by: Cornelia Huck <[email protected]> Signed-off-by: Eduardo Habkost <[email protected]>
03fcbd9dc5084ff4676c153fbe04fb0fcf939d09
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/03fcbd9dc5084ff4676c153fbe04fb0fcf939d09
2018-01-19 11:18:51-02:00
iothread: fix iothread_stop() race condition There is a small chance that iothread_stop() hangs as follows: Thread 3 (Thread 0x7f63eba5f700 (LWP 16105)): #0 0x00007f64012c09b6 in ppoll () at /lib64/libc.so.6 #1 0x000055959992eac9 in ppoll (__ss=0x0, __timeout=0x0, __nfds=<optimized out>, __fds=<optimized out>) at /usr/include/bits/poll2.h:77 #2 0x000055959992eac9 in qemu_poll_ns (fds=<optimized out>, nfds=<optimized out>, timeout=<optimized out>) at util/qemu-timer.c:322 #3 0x0000559599930711 in aio_poll (ctx=0x55959bdb83c0, blocking=blocking@entry=true) at util/aio-posix.c:629 #4 0x00005595996806fe in iothread_run (opaque=0x55959bd78400) at iothread.c:59 #5 0x00007f640159f609 in start_thread () at /lib64/libpthread.so.0 #6 0x00007f64012cce6f in clone () at /lib64/libc.so.6 Thread 1 (Thread 0x7f640b45b280 (LWP 16103)): #0 0x00007f64015a0b6d in pthread_join () at /lib64/libpthread.so.0 #1 0x00005595999332ef in qemu_thread_join (thread=<optimized out>) at util/qemu-thread-posix.c:547 #2 0x00005595996808ae in iothread_stop (iothread=<optimized out>) at iothread.c:91 #3 0x000055959968094d in iothread_stop_iter (object=<optimized out>, opaque=<optimized out>) at iothread.c:102 #4 0x0000559599857d97 in do_object_child_foreach (obj=obj@entry=0x55959bdb8100, fn=fn@entry=0x559599680930 <iothread_stop_iter>, opaque=opaque@entry=0x0, recurse=recurse@entry=false) at qom/object.c:852 #5 0x0000559599859477 in object_child_foreach (obj=obj@entry=0x55959bdb8100, fn=fn@entry=0x559599680930 <iothread_stop_iter>, opaque=opaque@entry=0x0) at qom/object.c:867 #6 0x0000559599680a6e in iothread_stop_all () at iothread.c:341 #7 0x000055959955b1d5 in main (argc=<optimized out>, argv=<optimized out>, envp=<optimized out>) at vl.c:4913 The relevant code from iothread_run() is: while (!atomic_read(&iothread->stopping)) { aio_poll(iothread->ctx, true); and iothread_stop(): iothread->stopping = true; aio_notify(iothread->ctx); ... qemu_thread_join(&iothread->thread); The following scenario can occur: 1. IOThread: while (!atomic_read(&iothread->stopping)) -> stopping=false 2. Main loop: iothread->stopping = true; aio_notify(iothread->ctx); 3. IOThread: aio_poll(iothread->ctx, true); -> hang The bug is explained by the AioContext->notify_me doc comments: "If this field is 0, everything (file descriptors, bottom halves, timers) will be re-evaluated before the next blocking poll(), thus the event_notifier_set call can be skipped." The problem is that "everything" does not include checking iothread->stopping. This means iothread_run() will block in aio_poll() if aio_notify() was called just before aio_poll(). This patch fixes the hang by replacing aio_notify() with aio_bh_schedule_oneshot(). This makes aio_poll() or g_main_loop_run() to return. Implementing this properly required a new bool running flag. The new flag prevents races that are tricky if we try to use iothread->stopping. Now iothread->stopping is purely for iothread_stop() and iothread->running is purely for the iothread_run() thread. Signed-off-by: Stefan Hajnoczi <[email protected]> Reviewed-by: Eric Blake <[email protected]> Message-id: [email protected] Signed-off-by: Stefan Hajnoczi <[email protected]>
2362a28ea11c145e1a13ae79342d76dc118a72a6
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/2362a28ea11c145e1a13ae79342d76dc118a72a6
2017-12-19 10:25:09+00:00
trace: Try using tracefs first Recent Linux kernel provides separate tracefs which doesn't need to be mounted on the debugfs. Although most systems mount it at the traditional place on the debugfs, it'd be safer to check tracefs first. Signed-off-by: Namhyung Kim <[email protected]> Signed-off-by: Stefan Hajnoczi <[email protected]>
c9add6219514b20223f024584f0464b8842b1ec0
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/c9add6219514b20223f024584f0464b8842b1ec0
2017-12-18 14:37:36+00:00
xen/pt: Set is_express to avoid out-of-bounds write The passed-through device might be an express device. In this case the old code allocated a too small emulated config space in pci_config_alloc() since pci_config_size() returned the size for a non-express device. This leads to an out-of-bound write in xen_pt_config_reg_init(), which sometimes results in crashes. So set is_express as already done for KVM in vfio-pci. Shortened ASan report: ==17512==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x611000041648 at pc 0x55e0fdac51ff bp 0x7ffe4af07410 sp 0x7ffe4af07408 WRITE of size 2 at 0x611000041648 thread T0 #0 0x55e0fdac51fe in memcpy /usr/include/x86_64-linux-gnu/bits/string3.h:53 #1 0x55e0fdac51fe in stw_he_p include/qemu/bswap.h:330 #2 0x55e0fdac51fe in stw_le_p include/qemu/bswap.h:379 #3 0x55e0fdac51fe in pci_set_word include/hw/pci/pci.h:490 #4 0x55e0fdac51fe in xen_pt_config_reg_init hw/xen/xen_pt_config_init.c:1991 #5 0x55e0fdac51fe in xen_pt_config_init hw/xen/xen_pt_config_init.c:2067 #6 0x55e0fdabcf4d in xen_pt_realize hw/xen/xen_pt.c:830 #7 0x55e0fdf59666 in pci_qdev_realize hw/pci/pci.c:2034 #8 0x55e0fdda7d3d in device_set_realized hw/core/qdev.c:914 [...] 0x611000041648 is located 8 bytes to the right of 256-byte region [0x611000041540,0x611000041640) allocated by thread T0 here: #0 0x7ff596a94bb8 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xd9bb8) #1 0x7ff57da66580 in g_malloc0 (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x50580) #2 0x55e0fdda7d3d in device_set_realized hw/core/qdev.c:914 [...] Signed-off-by: Simon Gaiser <[email protected]> Acked-by: Stefano Stabellini <[email protected]> Signed-off-by: Stefano Stabellini <[email protected]>
2e63eb2becc228232f12a1ea30a91b2aa8c5cecd
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/2e63eb2becc228232f12a1ea30a91b2aa8c5cecd
2017-12-14 16:11:53-08:00
blockjob: Make block_job_pause_all() keep a reference to the jobs Starting from commit 40840e419be31e6a32e6ea24511c74b389d5e0e4 we are pausing all block jobs during bdrv_reopen_multiple() to prevent any of them from finishing and removing nodes from the graph while they are being reopened. It turns out that pausing a block job doesn't necessarily prevent it from finishing: a paused block job can still run its exit function from the main loop and call block_job_completed(). The mirror block job in particular always goes to the main loop while it is paused (by virtue of the bdrv_drained_begin() call in mirror_run()). Destroying a paused block job during bdrv_reopen_multiple() has two consequences: 1) The references to the nodes involved in the job are released, possibly destroying some of them. If those nodes were in the reopen queue this would trigger the problem originally described in commit 40840e419be, crashing QEMU. 2) At the end of bdrv_reopen_multiple(), bdrv_drain_all_end() would not be doing all necessary bdrv_parent_drained_end() calls. I can reproduce problem 1) easily with iotest 030 by increasing STREAM_BUFFER_SIZE from 512KB to 8MB in block/stream.c, or by tweaking the iotest like in this example: https://lists.gnu.org/archive/html/qemu-block/2017-11/msg00934.html This patch keeps an additional reference to all block jobs between block_job_pause_all() and block_job_resume_all(), guaranteeing that they are kept alive. Signed-off-by: Alberto Garcia <[email protected]> Signed-off-by: Kevin Wolf <[email protected]>
3d5d319e1221082974711af1d09d82f0755c1698
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/3d5d319e1221082974711af1d09d82f0755c1698
2017-12-04 17:44:51+01:00
block: Close a BlockDriverState completely even when bs->drv is NULL bdrv_close() skips much of its logic when bs->drv is NULL. This is fine when we're closing a BlockDriverState that has just been created (because e.g the initialization process failed), but it's not enough in other cases. For example, when a valid qcow2 image is found to be corrupted then QEMU marks it as such in the file header and then sets bs->drv to NULL in order to make the BlockDriverState unusable. When that BDS is later closed then many of its data structures are not freed (leaking their memory) and none of its children are detached. This results in bdrv_close_all() failing to close all BDSs and making this assertion fail when QEMU is being shut down: bdrv_close_all: Assertion `QTAILQ_EMPTY(&all_bdrv_states)' failed. This patch makes bdrv_close() do the full uninitialization process in all cases. This fixes the problem with corrupted images and still works fine with freshly created BDSs. Signed-off-by: Alberto Garcia <[email protected]> Message-id: [email protected] Reviewed-by: Eric Blake <[email protected]> Signed-off-by: Max Reitz <[email protected]>
50a3efb0f05bcfbe04201d4ebac0b96551a1b551
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/50a3efb0f05bcfbe04201d4ebac0b96551a1b551
2017-11-21 14:54:02+01:00
nbd/server: Fix error reporting for bad requests The NBD spec says an attempt to NBD_CMD_TRIM on a read-only export should fail with EPERM, as a trim has the potential to change disk contents, but we were relying on the block layer to catch that for us, which might not always give the right error (and even if it does, it does not let us pass back a sane message for structured replies). The NBD spec says an attempt to NBD_CMD_WRITE_ZEROES out of bounds should fail with ENOSPC, not EINVAL. Our check for u64 offset + u32 length wraparound up front is pointless; nothing uses offset until after the second round of sanity checks, and we can just as easily ensure there is no wraparound by checking whether offset is in bounds (since a disk size cannot exceed off_t which is 63 bits, adding a 32-bit number for a valid offset can't overflow). Bonus: dropping the up-front check lets us keep the connection alive after NBD_CMD_WRITE, whereas before we would drop the connection (of course, any client sending a packet that would trigger the failure is already buggy, so it's also okay to drop the connection, but better quality-of-implementation never hurts). Solve all of these issues by some code motion and improved request validation. Signed-off-by: Eric Blake <[email protected]> Message-Id: <[email protected]> Reviewed-by: Vladimir Sementsov-Ogievskiy <[email protected]>
fed5f8f82056c9f222433c41aeb9fca50c89f297
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/fed5f8f82056c9f222433c41aeb9fca50c89f297
2017-11-17 08:38:38-06:00
hw/ppc/spapr: Fix virtio-scsi bootindex handling for LUNs >= 256 LUNs >= 256 have to be encoded with the so-called "flat space addressing method" for virtio-scsi, where an additional bit has to be set. SLOF already took care of this with the following commit: https://git.qemu.org/?p=SLOF.git;a=commitdiff;h=f72a37713fea47da (see https://bugzilla.redhat.com/show_bug.cgi?id=1431584 for details) But QEMU does not use this encoding yet for device tree paths that have to be handed over to SLOF to deal with the "bootindex" property, so SLOF currently fails to boot from virtio-scsi devices with LUNs >= 256 in the right boot order. Fix it by using the bit to indicate the "flat space addressing method" for LUNs >= 256. Signed-off-by: Thomas Huth <[email protected]> Signed-off-by: David Gibson <[email protected]>
bac658d1a4dc9dd637b2eb5006abda137071f17f
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/bac658d1a4dc9dd637b2eb5006abda137071f17f
2017-11-22 15:28:37+11:00
fix: unrealize virtio device if we fail to hotplug it If we fail to hotplug virtio-blk device and then suspend or shutdown VM, qemu is likely to crash. Re-production steps: 1. Run VM named vm001 2. Create a virtio-blk.xml which contains wrong configurations: <disk device="lun" rawio="yes" type="block"> <driver cache="none" io="native" name="qemu" type="raw" /> <source dev="/dev/mapper/11-dm" /> <target bus="virtio" dev="vdx" /> </disk> 3. Run command : virsh attach-device vm001 virtio-blk.xml error: Failed to attach device from blk-scsi.xml error: internal error: unable to execute QEMU command 'device_add': Please set scsi=off for virtio-blk devices in order to use virtio 1.0 it means hotplug virtio-blk device failed. 4. Suspend or shutdown VM will leads to qemu crash Problem happens in virtio_vmstate_change which is called by vm_state_notify: vdev’s parent_bus is NULL, so qdev_get_parent_bus(DEVICE(vdev)) will crash. virtio_vmstate_change is added to the list vm_change_state_head at virtio_blk_device_realize(virtio_init), but after hotplug virtio-blk failed, virtio_vmstate_change will not be removed from vm_change_state_head. Adding unrealize function of virtio-blk device can solve this problem. Signed-off-by: linzhecheng <[email protected]> Reviewed-by: Stefan Hajnoczi <[email protected]> Reviewed-by: Michael S. Tsirkin <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]>
7abea552aba6e85b338015726648974d6d6f19c8
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/7abea552aba6e85b338015726648974d6d6f19c8
2017-11-16 17:46:53+02:00
nbd/client: Don't hard-disconnect on ESHUTDOWN from server The NBD spec says that a server may fail any transmission request with ESHUTDOWN when it is apparent that no further request from the client can be successfully honored. The client is supposed to then initiate a soft shutdown (wait for all remaining in-flight requests to be answered, then send NBD_CMD_DISC). However, since qemu's server never uses ESHUTDOWN errors, this code was mostly untested since its introduction in commit b6f5d3b5. More recently, I learned that nbdkit as the NBD server is able to send ESHUTDOWN errors, so I finally tested this code, and noticed that our client was special-casing ESHUTDOWN to cause a hard shutdown (immediate disconnect, with no NBD_CMD_DISC), but only if the server sends this error as a simple reply. Further investigation found that commit d2febedb introduced a regression where structured replies behave differently than simple replies - but that the structured reply behavior is more in line with the spec (even if we still lack code in nbd-client.c to properly quit sending further requests). So this patch reverts the portion of b6f5d3b5 that introduced an improper hard-disconnect special-case at the lower level, and leaves the future enhancement of a nicer soft-disconnect at the higher level for another day. CC: [email protected] Signed-off-by: Eric Blake <[email protected]> Message-Id: <[email protected]> Reviewed-by: Vladimir Sementsov-Ogievskiy <[email protected]>
01b05c66a3616d5a4adc39fc90962e9efaf791d1
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/01b05c66a3616d5a4adc39fc90962e9efaf791d1
2017-11-17 08:34:34-06:00
tests-aio-multithread: fix /aio/multi/schedule race condition test_multi_co_schedule_entry() set to_schedule[id] in the final loop iteration before terminating the coroutine. There is a race condition where the main thread attempts to enter the terminating or terminated coroutine when signalling coroutines to stop: atomic_mb_set(&now_stopping, true); for (i = 0; i < NUM_CONTEXTS; i++) { ctx_run(i, finish_cb, NULL); <--- enters dead coroutine! to_schedule[i] = NULL; } Make sure only to set to_schedule[id] if this coroutine really needs to be scheduled! Reported-by: "R.Nageswara Sastry" <[email protected]> Signed-off-by: Stefan Hajnoczi <[email protected]> Reviewed-by: Paolo Bonzini <[email protected]> Message-id: [email protected] Signed-off-by: Stefan Hajnoczi <[email protected]>
fb0c43f34eed8b18678c6e1f481d8564b35c99ed
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/fb0c43f34eed8b18678c6e1f481d8564b35c99ed
2017-11-08 09:22:55+00:00
scripts: don't throw away stderr when checking out git submodules The stderr from git is important if git fails to checkout modules due to network problems, or other unexpected errors. Signed-off-by: Daniel P. Berrange <[email protected]> Reviewed-by: Peter Maydell <[email protected]> Message-id: [email protected] Signed-off-by: Gerd Hoffmann <[email protected]>
8172bdb2d0c829462f8c4fb2cb54a768d295a747
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/8172bdb2d0c829462f8c4fb2cb54a768d295a747
2017-10-23 08:10:18+02:00
qdev: defer DEVICE_DEL event until instance_finalize() DEVICE_DEL is currently emitted when a Device is unparented, as opposed to when it is finalized. The main design motivation for this seems to be that after unparent()/unrealize(), the Device is no longer visible to the guest, and thus the operation is complete from the perspective of management. However, there are cases where remaining host-side cleanup is also pertinent to management. The is generally handled by treating these resources as aspects of the "backend", which can be managed via separate interfaces/events, such as blockdev_add/del, netdev_add/del, object_add/del, etc, but some devices do not have this level of compartmentalization, namely vfio-pci, and possibly to lend themselves well to it. In the case of vfio-pci, the "backend" cleanup happens as part of the finalization of the vfio-pci device itself, in particular the cleanup of the VFIO group FD. Failing to wait for this cleanup can result in tools like libvirt attempting to rebind the device to the host while it's still being used by VFIO, which can result in host crashes or other misbehavior depending on the host driver. Deferring DEVICE_DEL still affords us the ability to manage backends explicitly, while also addressing cases like vfio-pci's, so we implement that approach here. An alternative proposal involving having VFIO emit a separate event to denote completion of host-side cleanup was discussed, but the prevailing opinion seems to be that it is not worth the added complexity, and leaves the issue open for other Device implementations to solve in the future. Signed-off-by: Michael Roth <[email protected]> Reviewed-by: Greg Kurz <[email protected]> Tested-by: Eric Auger <[email protected]> Reviewed-by: David Gibson <[email protected]> Message-Id: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
f7b879e072ae6839b1b1d1312f48fa7f256397e2
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/f7b879e072ae6839b1b1d1312f48fa7f256397e2
2017-10-18 10:34:50+02:00
sockets: Handle race condition between binds to the same port If an offset of ports is specified to the inet_listen_saddr function(), and two or more processes tries to bind from these ports at the same time, occasionally more than one process may be able to bind to the same port. The condition is detected by listen() but too late to avoid a failure. This function is called by socket_listen() and used by all socket listening code in QEMU, so all cases where any form of dynamic port selection is used should be subject to this issue. Add code to close and re-establish the socket when this condition is observed, hiding the race condition from the user. Also clean up some issues with error handling to allow more accurate reporting of the cause of an error. This has been developed and tested by means of the test-listen unit test in the previous commit. Enable the test for make check now that it passes. Reviewed-by: Bhavesh Davda <[email protected]> Reviewed-by: Yuval Shaia <[email protected]> Reviewed-by: Girish Moodalbail <[email protected]> Signed-off-by: Knut Omang <[email protected]> Reviewed-by: Daniel P. Berrange <[email protected]> Signed-off-by: Daniel P. Berrange <[email protected]>
9cf961bba74d433db76a110917ac70aecc2ebcc4
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/9cf961bba74d433db76a110917ac70aecc2ebcc4
2017-10-16 16:55:31+01:00
tcg: Fix off-by-one in assert in page_set_flags Most of the users of page_set_flags offset (page, page + len) as the end points. One might consider this an error, since the other users do supply an endpoint as the last byte of the region. However, the first thing that page_set_flags does is round end UP to the start of the next page. Which means computing page + len - 1 is in the end pointless. Therefore, accept this usage and do not assert when given the exact size of the vm as the endpoint. Signed-off-by: Richard Henderson <[email protected]> Reviewed-by: Philippe Mathieu-Daudé <[email protected]> Message-Id: <[email protected]> Signed-off-by: Riku Voipio <[email protected]>
de258eb07db6cf893ef1bfad8c0cedc0b983db55
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/de258eb07db6cf893ef1bfad8c0cedc0b983db55
2017-10-16 16:00:56+03:00
qemu-iotests: cleanup and fix search for programs Instead of ./check failing when a binary is missing, we try each test case now and each one fails with tons of test case diffs. Also, all the variables were initialized by "check" prior to "common" being sourced, and then (uselessly) checked for emptiness again in "check". Centralize the search for programs in "common" (which will soon be one with "check"), including the "realpath" invocation which can be done just once in "check" rather than in the tests. For qnio_server, move the detection to "common", simplifying set_prog_path to stop handling the unused second argument, and embedding the "realpath" pass. Signed-off-by: Paolo Bonzini <[email protected]> Reviewed-by: Eric Blake <[email protected]> Signed-off-by: Kevin Wolf <[email protected]>
cceaf1db6fbede3ed0bca103d12f8a19c1374e42
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/cceaf1db6fbede3ed0bca103d12f8a19c1374e42
2017-10-06 16:28:58+02:00
s390x/tcg: make STFL store into the lowcore Using virtual memory access is wrong and will soon include low-address protection checks, which is to be bypassed for STFL. STFL is a privileged instruction and using LowCore requires !CONFIG_USER_ONLY, so add the ifdef and move the declaration to the right place. This was originally part of a bigger STFL(E) refactoring. Signed-off-by: David Hildenbrand <[email protected]> Message-Id: <[email protected]> Reviewed-by: Richard Henderson <[email protected]> Reviewed-by: Thomas Huth <[email protected]> Signed-off-by: Cornelia Huck <[email protected]>
86b5ab390992fd57f3a23764994a7e082bcc2fc4
qemu
devign
1
https://github.com/qemu/qemu
https://github.com/qemu/qemu/commit/86b5ab390992fd57f3a23764994a7e082bcc2fc4
2017-10-06 10:53:02+02:00