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
⌀ |
---|---|---|---|---|---|---|---|
memset string pages to zero to avoid putting random data on the stack
that may make some program crash at startup.
Fix unsigned long / target_ulong confusion (more to do).
Fix missing g2h macros.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3249 c046a42c-6fe2-441c-8c8c-71466251a162
| 4118a97030aa9bd1d520d1d06bbe0655d829df04 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/4118a97030aa9bd1d520d1d06bbe0655d829df04 | 2007-09-27 04:10:43+00:00 |
Update Sparc32 and Sparc64 OpenBIOS image to SVN revision 157. Changes:
r150: Try to fix system reset for SMP and SS-10 cases
r151: Fix obp_dumb_memalloc
r152: Fix mapping more than 2G memory
r153: Get a real memory allocator for Sparc, based on PPC ofmem
r154: Update totavail when memory is allocated by dumb memory allocator
r155: Fix pop_fstr_copy memory leaks
- console one prevented Debian 3.1r1 from installing in console=prom mode
- fixing this also needed the real malloc/free
r156: Hack for building on CIFS directory
r157: Allow boot start PC to be different from virtual location (boot mode)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3029 c046a42c-6fe2-441c-8c8c-71466251a162
| 175087965268c2792cf6bbb524dbccaadcf1fca4 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/175087965268c2792cf6bbb524dbccaadcf1fca4 | 2007-06-28 07:28:22+00:00 |
fd leak fix (Igor Kovalenko)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2118 c046a42c-6fe2-441c-8c8c-71466251a162
| 243a273ee0168fc373f342479ae92fe3028b45c1 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/243a273ee0168fc373f342479ae92fe3028b45c1 | 2006-08-17 16:19:07+00:00 |
mem leak fixes
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2102 c046a42c-6fe2-441c-8c8c-71466251a162
| e84a4fedf74983ad0517b4754f927a96a2eea7ce | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/e84a4fedf74983ad0517b4754f927a96a2eea7ce | 2006-08-07 21:35:12+00:00 |
Avoid crash if -redir or -smb used without -net user.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1760 c046a42c-6fe2-441c-8c8c-71466251a162
| 3b7f5d479caf9b51e99da9940619db720637d5b4 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/3b7f5d479caf9b51e99da9940619db720637d5b4 | 2006-02-10 17:34:02+00:00 |
target/m68k: fix TCG variable double free
t64 is also unconditionally freed after the switch () { ... }
Signed-off-by: Laurent Vivier <[email protected]>
Reviewed-by: Thomas Huth <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Message-Id: <[email protected]>
| 39e3e113bdb27b4144d697fbd6678a9c24740103 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/39e3e113bdb27b4144d697fbd6678a9c24740103 | 2018-01-25 16:02:24+01:00 |
sdhci: fix a NULL pointer dereference due to uninitialized AddresSpace object
missed in 60765b6ceeb4.
Thread 1 "qemu-system-aarch64" received signal SIGSEGV, Segmentation fault.
address_space_init (as=0x0, root=0x55555726e410, name=name@entry=0x555555e3f0a7 "sdhci-dma") at memory.c:3050
3050 as->root = root;
(gdb) bt
#0 address_space_init (as=0x0, root=0x55555726e410, name=name@entry=0x555555e3f0a7 "sdhci-dma") at memory.c:3050
#1 0x0000555555af62c3 in sdhci_sysbus_realize (dev=<optimized out>, errp=0x7fff7f931150) at hw/sd/sdhci.c:1564
#2 0x00005555558b25e5 in zynqmp_sdhci_realize (dev=0x555557051520, errp=0x7fff7f931150) at hw/sd/zynqmp-sdhci.c:151
#3 0x0000555555a2e7f3 in device_set_realized (obj=0x555557051520, value=<optimized out>, errp=0x7fff7f931270) at hw/core/qdev.c:966
#4 0x0000555555ba3f74 in property_set_bool (obj=0x555557051520, v=<optimized out>, name=<optimized out>, opaque=0x555556e04a20,
errp=0x7fff7f931270) at qom/object.c:1906
#5 0x0000555555ba51f4 in object_property_set (obj=obj@entry=0x555557051520, v=v@entry=0x5555576dbd60,
name=name@entry=0x555555dd6306 "realized", errp=errp@entry=0x7fff7f931270) at qom/object.c:1102
Suggested-by: Peter Maydell <[email protected]>
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Message-id: [email protected]
Reviewed-by: Peter Maydell <[email protected]>
Signed-off-by: Peter Maydell <[email protected]>
| 02e57e1c14a32aa1ed64e79d349d8e0e37cfaa27 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/02e57e1c14a32aa1ed64e79d349d8e0e37cfaa27 | 2018-01-25 11:45:30+00:00 |
disas/s390: fix global-buffer-overflow
Spotted thanks to ASAN:
==25226==ERROR: AddressSanitizer: global-buffer-overflow on address 0x556715a1f120 at pc 0x556714b6f6b1 bp 0x7ffcdfac1360 sp 0x7ffcdfac1350
READ of size 1 at 0x556715a1f120 thread T0
#0 0x556714b6f6b0 in init_disasm /home/elmarco/src/qemu/disas/s390.c:219
#1 0x556714b6fa6a in print_insn_s390 /home/elmarco/src/qemu/disas/s390.c:294
#2 0x55671484d031 in monitor_disas /home/elmarco/src/qemu/disas.c:635
#3 0x556714862ec0 in memory_dump /home/elmarco/src/qemu/monitor.c:1324
#4 0x55671486342a in hmp_memory_dump /home/elmarco/src/qemu/monitor.c:1418
#5 0x5567148670be in handle_hmp_command /home/elmarco/src/qemu/monitor.c:3109
#6 0x5567148674ed in qmp_human_monitor_command /home/elmarco/src/qemu/monitor.c:613
#7 0x556714b00918 in qmp_marshal_human_monitor_command /home/elmarco/src/qemu/build/qmp-marshal.c:1704
#8 0x556715138a3e in do_qmp_dispatch /home/elmarco/src/qemu/qapi/qmp-dispatch.c:104
#9 0x556715138f83 in qmp_dispatch /home/elmarco/src/qemu/qapi/qmp-dispatch.c:131
#10 0x55671485cf88 in handle_qmp_command /home/elmarco/src/qemu/monitor.c:3839
#11 0x55671514e80b in json_message_process_token /home/elmarco/src/qemu/qobject/json-streamer.c:105
#12 0x5567151bf2dc in json_lexer_feed_char /home/elmarco/src/qemu/qobject/json-lexer.c:323
#13 0x5567151bf827 in json_lexer_feed /home/elmarco/src/qemu/qobject/json-lexer.c:373
#14 0x55671514ee62 in json_message_parser_feed /home/elmarco/src/qemu/qobject/json-streamer.c:124
#15 0x556714854b1f in monitor_qmp_read /home/elmarco/src/qemu/monitor.c:3881
#16 0x556715045440 in qemu_chr_be_write_impl /home/elmarco/src/qemu/chardev/char.c:172
#17 0x556715047184 in qemu_chr_be_write /home/elmarco/src/qemu/chardev/char.c:184
#18 0x55671505a8e6 in tcp_chr_read /home/elmarco/src/qemu/chardev/char-socket.c:440
#19 0x5567150943c3 in qio_channel_fd_source_dispatch /home/elmarco/src/qemu/io/channel-watch.c:84
#20 0x7fb90292b90b in g_main_dispatch ../glib/gmain.c:3182
#21 0x7fb90292c7ac in g_main_context_dispatch ../glib/gmain.c:3847
#22 0x556715162eca in glib_pollfds_poll /home/elmarco/src/qemu/util/main-loop.c:214
#23 0x556715163001 in os_host_main_loop_wait /home/elmarco/src/qemu/util/main-loop.c:261
#24 0x5567151631fa in main_loop_wait /home/elmarco/src/qemu/util/main-loop.c:515
#25 0x556714ad6d3b in main_loop /home/elmarco/src/qemu/vl.c:1950
#26 0x556714ade329 in main /home/elmarco/src/qemu/vl.c:4865
#27 0x7fb8fe5c9009 in __libc_start_main (/lib64/libc.so.6+0x21009)
#28 0x5567147af4d9 in _start (/home/elmarco/src/qemu/build/s390x-softmmu/qemu-system-s390x+0xf674d9)
0x556715a1f120 is located 32 bytes to the left of global variable 'char_hci_type_info' defined in '/home/elmarco/src/qemu/hw/bt/hci-csr.c:493:23' (0x556715a1f140) of size 104
0x556715a1f120 is located 8 bytes to the right of global variable 's390_opcodes' defined in '/home/elmarco/src/qemu/disas/s390.c:860:33' (0x556715a15280) of size 40600
This fix is based on Andreas Arnez <[email protected]> upstream
commit:
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff;h=9ace48f3d7d80ce09c5df60cccb433470410b11b
2014-08-19 Andreas Arnez <[email protected]>
* s390-dis.c (init_disasm): Simplify initialization of
opc_index[]. This also fixes an access after the last element
of s390_opcodes[].
Signed-off-by: Marc-André Lureau <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
| 02a2ad217b0de16cc6c4f36fe325907cdbe7766b | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/02a2ad217b0de16cc6c4f36fe325907cdbe7766b | 2018-01-16 14:54:50+01:00 |
block/nbd: fix segmentation fault when .desc is not null-terminated
The find_desc_by_name() from util/qemu-option.c relies on the .name not being
NULL to call strcmp(). This check becomes unsafe when the list is not
NULL-terminated, which is the case of nbd_runtime_opts in block/nbd.c, and can
result in segmentation fault when strcmp() tries to access an invalid memory:
#0 0x00007fff8c75f7d4 in __strcmp_power9 () from /lib64/libc.so.6
#1 0x00000000102d3ec8 in find_desc_by_name (desc=0x1036d6f0, name=0x28e46670 "server.path") at util/qemu-option.c:166
#2 0x00000000102d93e0 in qemu_opts_absorb_qdict (opts=0x28e47a80, qdict=0x28e469a0, errp=0x7fffec247c98) at util/qemu-option.c:1026
#3 0x000000001012a2e4 in nbd_open (bs=0x28e42290, options=0x28e469a0, flags=24578, errp=0x7fffec247d80) at block/nbd.c:406
#4 0x00000000100144e8 in bdrv_open_driver (bs=0x28e42290, drv=0x1036e070 <bdrv_nbd_unix>, node_name=0x0, options=0x28e469a0, open_flags=24578, errp=0x7fffec247f50) at block.c:1135
#5 0x0000000010015b04 in bdrv_open_common (bs=0x28e42290, file=0x0, options=0x28e469a0, errp=0x7fffec247f50) at block.c:1395
>From gdb, the desc[i].name was not NULL and resulted in strcmp() accessing an
invalid memory:
>>> p desc[5]
$8 = {
name = 0x1037f098 "R27A",
type = 1561964883,
help = 0xc0bbb23e <error: Cannot access memory at address 0xc0bbb23e>,
def_value_str = 0x2 <error: Cannot access memory at address 0x2>
}
>>> p desc[6]
$9 = {
name = 0x103dac78 <__gcov0.do_qemu_init_bdrv_nbd_init> "\001",
type = 272101528,
help = 0x29ec0b754403e31f <error: Cannot access memory at address 0x29ec0b754403e31f>,
def_value_str = 0x81f343b9 <error: Cannot access memory at address 0x81f343b9>
}
This patch fixes the segmentation fault in strcmp() by adding a NULL element at
the end of nbd_runtime_opts.desc list, which is the common practice to most of
other structs like runtime_opts in block/null.c. Thus, the desc[i].name != NULL
check becomes safe because it will not evaluate to true when .desc list reached
its end.
Reported-by: R. Nageswara Sastry <[email protected]>
Buglink: https://bugs.launchpad.net/qemu/+bug/1727259
Signed-off-by: Murilo Opsfelder Araujo <[email protected]>
Message-Id: <[email protected]>
CC: [email protected]
Fixes: 7ccc44fd7d1dfa62c4d6f3a680df809d6e7068ce
Signed-off-by: Eric Blake <[email protected]>
| c4365735a7d38f4355c6f77e6670d3972315f7c2 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/c4365735a7d38f4355c6f77e6670d3972315f7c2 | 2018-01-08 09:12:23-06:00 |
nbd/server: Add helper functions for parsing option payload
Rather than making every callsite perform length sanity checks
and error reporting, add the helper functions nbd_opt_read()
and nbd_opt_drop() that use the length stored in the client
struct; also add an assertion that optlen is 0 before any
option (ie. any previous option was fully handled), complementing
the assertion added in an earlier patch that optlen is 0 after
all negotiation completes.
Note that the call in nbd_negotiate_handle_export_name() does
not use the new helper (in part because the server cannot
reply to NBD_OPT_EXPORT_NAME - it either succeeds or the
connection drops).
Based on patches by Vladimir Sementsov-Ogievskiy.
Signed-off-by: Eric Blake <[email protected]>
Reviewed-by: Vladimir Sementsov-Ogievskiy <[email protected]>
Message-Id: <[email protected]>
| 894e02804c862c6940b43a0a488164655d3fb3f0 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/894e02804c862c6940b43a0a488164655d3fb3f0 | 2018-01-17 20:14:12-06:00 |
pci: deassert intx when pci device unrealize
If a pci device is not reset by VM (by writing into config space)
and unplugged by VM, after that when VM reboots, qemu may assert:
pcibus_reset: Assertion `bus->irq_count[i] == 0' failed
Cc: [email protected]
Signed-off-by: herongguang <[email protected]>
Reviewed-by: Marcel Apfelbaum <[email protected]>
Reviewed-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
| 3936161f1fd72d1dfa577aaba910819c5e873260 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/3936161f1fd72d1dfa577aaba910819c5e873260 | 2017-05-18 00:35:15+03:00 |
vhost-scsi: add missing virtqueue_size parameter
Commit 5c0919d02066 ("virtio-scsi: Add virtqueue_size parameter allowing
virtqueue size to be set.") introduced a new parameter to virtio-scsi.
Later, commit 920036106044 ("vhost-user-scsi: add missing virtqueue_size
param") added that parameter to the new vhost-user-scsi interface but
neglected the existing vhost-scsi interface it was built on.
Apply the same change to vhost-scsi, so that we can boot a guest with
a device defined. This also avoids crashing a guest when hotplugging
a vhost-scsi device.
Signed-off-by: Eric Farman <[email protected]>
Message-id: [email protected]
Reviewed-by: Paolo Bonzini <[email protected]>
Signed-off-by: Peter Maydell <[email protected]>
| 2994cb2ee244b7d6a00576b4fd178932d8b31439 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/2994cb2ee244b7d6a00576b4fd178932d8b31439 | 2017-12-05 12:38:31+00:00 |
pc: fix crash on attempted cpu unplug
when qemu is started with '-no-acpi' CLI option, an attempt
to unplug a CPU using device_del results in null pointer
dereference at:
#0 object_get_class
#1 pc_machine_device_unplug_request_cb
#2 qmp_marshal_device_del
which is caused by pcms->acpi_dev == NULL due to ACPI support
being disabled.
Considering that ACPI support is necessary for unplug to work,
check that it's enabled and fail unplug request gracefully
if no acpi device were found.
Signed-off-by: Igor Mammedov <[email protected]>
Reviewed-by: Eduardo Habkost <[email protected]>
Reviewed-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
| 75ba2ddb188fa07c3442446766782036e3085cba | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/75ba2ddb188fa07c3442446766782036e3085cba | 2017-12-01 19:05:58+02:00 |
qcow2: fix image corruption after committing qcow2 image into base
After committing the qcow2 image contents into the base image, qemu-img
will call bdrv_make_empty to drop the payload in the layered image.
When this is done for qcow2 images, it blows away the LUKS encryption
header, making the resulting image unusable. There are two codepaths
for emptying a qcow2 image, and the second (slower) codepath leaves
the LUKS header intact, so force use of that codepath.
Reviewed-by: Eric Blake <[email protected]>
Signed-off-by: Daniel P. Berrange <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
| f06033295b51d4868c2b4921ad2287e8f55eb688 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/f06033295b51d4868c2b4921ad2287e8f55eb688 | 2017-11-17 13:36:03+01:00 |
target/arm: Create new arm_v7m_mmu_idx_for_secstate_and_priv()
The TT instruction is going to need to look up the MMU index
for a specified security and privilege state. Refactor the
existing arm_v7m_mmu_idx_for_secstate() into a version that
lets you specify the privilege state and one that uses the
current state of the CPU.
Signed-off-by: Peter Maydell <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Message-id: [email protected]
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
| ec8e3340286a87d3924c223d60ba5c994549f796 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/ec8e3340286a87d3924c223d60ba5c994549f796 | 2017-12-13 17:59:23+00:00 |
qcow2: Prevent allocating L2 tables at offset 0
If the refcount data is corrupted then we can end up trying to
allocate a new L2 table at offset 0 in the image, triggering an
assertion in the qcow2 cache that would crash QEMU:
qcow2_cache_entry_mark_dirty: Assertion `c->entries[i].offset != 0' failed
This patch adds an explicit check for this scenario and a new test
case.
Signed-off-by: Alberto Garcia <[email protected]>
Reviewed-by: Max Reitz <[email protected]>
Message-id: 92dac37191ae7844a2da22c122204eb493cc3133.1509718618.git.berto@igalia.com
Signed-off-by: Max Reitz <[email protected]>
| 9883975050deffc147a3903d07ff995ecdc8a100 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/9883975050deffc147a3903d07ff995ecdc8a100 | 2017-11-14 18:06:25+01:00 |
monitor: fix dangling CPU pointer
If a CPU selected with the "cpu" command is hot-unplugged then "info cpus"
causes QEMU to exit:
(qemu) device_del cpu1
(qemu) info cpus
qemu:qemu_cpu_kick_thread: No such process
This happens because "cpu" stores the pointer to the selected CPU into
the monitor structure. When the CPU is hot-unplugged, we end up with a
dangling pointer. The "info cpus" command then does:
hmp_info_cpus()
monitor_get_cpu_index()
mon_get_cpu()
cpu_synchronize_state() <--- called with dangling pointer
This could cause a QEMU crash as well.
This patch switches the monitor to store the QOM path instead of a
pointer to the current CPU. The path is then resolved when needed.
If the resolution fails, we assume that the CPU was removed and the
path is resetted to the default (ie, path of first_cpu).
Reported-by: Satheesh Rajendran <[email protected]>
Suggested-by: Igor Mammedov <[email protected]>
Signed-off-by: Greg Kurz <[email protected]>
Message-Id: <[email protected]>
Reviewed-by: Igor Mammedov <[email protected]>
Signed-off-by: Dr. David Alan Gilbert <[email protected]>
| 751f8cfe2a556b3ef49f6af2860e2d1d2a1ec66a | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/751f8cfe2a556b3ef49f6af2860e2d1d2a1ec66a | 2017-10-30 18:46:32+00:00 |
nbd/server: Report error for write to read-only export
When the server is read-only, we were already reporting an error
message for NBD_CMD_WRITE_ZEROES, but failed to set errp for a
similar NBD_CMD_WRITE. This will matter more once structured
replies allow the server to propagate the errp information back
to the client. While at it, use an error message that makes a
bit more sense if viewed on the client side.
Note that when using qemu-io to test qemu-nbd behavior, it is
rather difficult to convince qemu-io to send protocol violations
(such as a read beyond bounds), because we have a lot of active
checking on the client side that a qemu-io request makes sense
before it ever goes over the wire to the server. The case of a
client attempting a write when the server is started as
'qemu-nbd -r' is one of the few places where we can easily test
error path handling, without having to resort to hacking in known
temporary bugs to either the server or client. [Maybe we want a
future patch to the client to do up-front checking on writes to a
read-only export, the way it does up-front bounds checking; but I
don't see anything in the NBD spec that points to a protocol
violation in our current behavior.]
Signed-off-by: Eric Blake <[email protected]>
Reviewed-by: Vladimir Sementsov-Ogievskiy <[email protected]>
Message-Id: <[email protected]>
| 8fb48b8b38a895cbb17a601829603365c4938f60 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/8fb48b8b38a895cbb17a601829603365c4938f60 | 2017-10-30 21:07:44+01:00 |
9pfs: use g_malloc0 to allocate space for xattr
9p back-end first queries the size of an extended attribute,
allocates space for it via g_malloc() and then retrieves its
value into allocated buffer. Race between querying attribute
size and retrieving its could lead to memory bytes disclosure.
Use g_malloc0() to avoid it.
Reported-by: Tuomas Tynkkynen <[email protected]>
Signed-off-by: Prasad J Pandit <[email protected]>
Signed-off-by: Greg Kurz <[email protected]>
| 7bd92756303f2158a68d5166264dc30139b813b6 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/7bd92756303f2158a68d5166264dc30139b813b6 | 2017-10-16 14:21:59+02:00 |
virtio/vhost: reset dev->log after syncing
vhost_log_put() is called to decomission the dirty log between qemu and
a vhost device when stopping the device. Such a call can happen from
migration_completion().
Present code sets dev->log_size to zero too early in vhost_log_put(),
causing the sync check to always return false. As a consequence, the
last pass on the dirty bitmap never happens at the end of migration.
If a vhost device was busy (writing to guest memory) until the last
moments before vhost_virtqueue_stop(), this error will result in guest
memory corruption (at least) following migrations.
Signed-off-by: Felipe Franciosi <[email protected]>
Acked-by: Jason Wang <[email protected]>
Reviewed-by: Marc-André Lureau <[email protected]>
Reviewed-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
| 5c0ba1be37181bd8a7c96c7f81b19ae5f8e66e2d | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/5c0ba1be37181bd8a7c96c7f81b19ae5f8e66e2d | 2017-10-15 05:54:41+03:00 |
hw/sd: fix out-of-bounds check for multi block reads
The current code checks if the next block exceeds the size of the card.
This generates an error while reading the last block of the card.
Do the out-of-bounds check when starting to read a new block to fix this.
This issue became visible with increased error checking in Linux 4.13.
Cc: [email protected]
Signed-off-by: Michael Olbrich <[email protected]>
Reviewed-by: Alistair Francis <[email protected]>
Message-id: [email protected]
Signed-off-by: Peter Maydell <[email protected]>
| 8573378e62d19e25a2434e23462ec99ef4d065ac | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/8573378e62d19e25a2434e23462ec99ef4d065ac | 2017-10-06 16:46:47+01:00 |
uuid: Tighten uuid parse
sscanf is relatively loose (tolerate) on some invalid formats that we
should fail instead of generating a wrong uuid structure, like with
whitespaces and short strings.
Add and use a helper function to first check the format.
Signed-off-by: Fam Zheng <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Reviewed-by: Jeff Cody <[email protected]>
Message-Id: <[email protected]>
| 0d6ae94783b35a5c42d88872d1adb523f5fcc6f3 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/0d6ae94783b35a5c42d88872d1adb523f5fcc6f3 | 2016-09-23 11:42:52+08:00 |
tcg/ppc: disable atomic write check on ppc32
This fixes building for ppc64 on ppc32 (changed in 5964fca8a12c):
tcg/ppc/tcg-target.inc.c: In function 'tb_target_set_jmp_target':
include/qemu/compiler.h:86:30: error: static assertion failed: \
"not expecting: sizeof(*(uint64_t *)jmp_addr) > ATOMIC_REG_SIZE"
QEMU_BUILD_BUG_ON(sizeof(*ptr) > ATOMIC_REG_SIZE); \
^
tcg/ppc/tcg-target.inc.c:1377:9: note: in expansion of macro 'atomic_set'
atomic_set((uint64_t *)jmp_addr, pair);
^
Suggested-by: Richard Henderson <[email protected]>
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Message-Id: <[email protected]>
[rth: Added commentary requested by pmm.]
Signed-off-by: Richard Henderson <[email protected]>
| ba026602a673677735428e64e621cdf95b5cd6d9 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/ba026602a673677735428e64e621cdf95b5cd6d9 | 2017-09-17 06:52:19-07:00 |
net/filter-rewriter.c: Fix rewirter checksum bug when use virtio-net
Because vnet_hdr have a offset to net packet, we must add it when use
virtio-net.
Signed-off-by: Zhang Chen <[email protected]>
Signed-off-by: Jason Wang <[email protected]>
| 6ce310b5356abb7edc3aa8b8b097d0b8cc76f83f | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/6ce310b5356abb7edc3aa8b8b097d0b8cc76f83f | 2017-09-08 08:17:35+08:00 |
hw/ppc/spapr_cpu_core: Add a proper check for spapr machine
QEMU currently crashes when the user tries to add a spapr-cpu-core
on a non-pseries machine:
$ qemu-system-ppc64 -S -machine ppce500,accel=tcg \
-device POWER5+_v2.1-spapr-cpu-core
hw/ppc/spapr_cpu_core.c:178:spapr_cpu_core_realize_child:
Object 0x55cee1f55160 is not an instance of type spapr-machine
Aborted (core dumped)
So let's add a proper check for the correct machine time with
a more friendly error message here.
Reported-by: Eduardo Habkost <[email protected]>
Signed-off-by: Thomas Huth <[email protected]>
Signed-off-by: David Gibson <[email protected]>
| 2363d5ee231bf047479422d56d3b85b7d37a7c23 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/2363d5ee231bf047479422d56d3b85b7d37a7c23 | 2017-09-08 09:30:55+10:00 |
net/rocker: Convert to realize()
The rocker device still implements the old PCIDeviceClass .init()
instead of the new .realize(). All devices need to be converted to
.realize().
.init() reports errors with fprintf() and return 0 on success, negative
number on failure. Meanwhile, when -device rocker fails, it first report
a specific error, then a generic one, like this:
$ x86_64-softmmu/qemu-system-x86_64 -device rocker,name=qemu-rocker
rocker: name too long; please shorten to at most 9 chars
qemu-system-x86_64: -device rocker,name=qemu-rocker: Device initialization failed
Now, convert it to .realize() that passes errors to its callers via its
errp argument. Also avoid the superfluous second error message. After
the patch, effect like this:
$ x86_64-softmmu/qemu-system-x86_64 -device rocker,name=qemu-rocker
qemu-system-x86_64: -device rocker,name=qemu-rocker: name too long; please shorten to at most 9 chars
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Mao Zhongyi <[email protected]>
Reviewed-by: Markus Armbruster <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Jason Wang <[email protected]>
| 0c8f86ea98945678622c6e4b070c4218a53a0d19 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/0c8f86ea98945678622c6e4b070c4218a53a0d19 | 2017-09-08 08:17:37+08:00 |
ppc/xive: fix OV5_XIVE_EXPLOIT bits
On POWER9, the Client Architecture Support (CAS) negotiation process
determines whether the guest operates in XIVE Legacy compatibility or
in XIVE exploitation mode. Now that we have initial guest support for
the XIVE interrupt controller, let's fix the bits definition which have
evolved in the latest specs.
The platform advertises the XIVE Exploitation Mode support using the
property "ibm,arch-vec-5-platform-support-vec-5", byte 23 bits 0-1 :
- 0b00 XIVE legacy mode Only
- 0b01 XIVE exploitation mode Only
- 0b10 XIVE legacy or exploitation mode
The OS asks for XIVE Exploitation Mode support using the property
"ibm,architecture-vec-5", byte 23 bits 0-1:
- 0b00 XIVE legacy mode Only
- 0b01 XIVE exploitation mode Only
Signed-off-by: Cédric Le Goater <[email protected]>
Signed-off-by: David Gibson <[email protected]>
| 21f3f8db0e61884ca48e9969b0305d54f1efe24b | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/21f3f8db0e61884ca48e9969b0305d54f1efe24b | 2017-09-15 10:29:48+10:00 |
hw/arm/allwinner-a10: Mark the allwinner-a10 device with user_creatable = false
QEMU currently exits unexpectedly when the user accidentially
tries to do something like this:
$ aarch64-softmmu/qemu-system-aarch64 -S -M integratorcp -nographic
QEMU 2.9.93 monitor - type 'help' for more information
(qemu) device_add allwinner-a10
Unsupported NIC model: smc91c111
Exiting just due to a "device_add" should not happen. Looking closer
at the the realize and instance_init function of this device also
reveals that it is using serial_hds and nd_table directly there, so
this device is clearly not creatable by the user and should be marked
accordingly.
Signed-off-by: Thomas Huth <[email protected]>
Reviewed-by: Eduardo Habkost <[email protected]>
Message-id: [email protected]
Reviewed-by: Peter Maydell <[email protected]>
Signed-off-by: Peter Maydell <[email protected]>
| dc89a180caf143a5d596d3f2f776d13be83a687d | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/dc89a180caf143a5d596d3f2f776d13be83a687d | 2017-09-07 13:54:51+01:00 |
virtfs: error out gracefully when mandatory suboptions are missing
We internally convert -virtfs to -fsdev/-device. If the user doesn't
provide the path or security_model suboptions, and the fsdev backend
requires them, we hit an assertion when populating the internal -fsdev
option:
util/qemu-option.c:547: opt_set: Assertion `opt->str' failed.
Aborted (core dumped)
Let's test the suboption presence on the command line before trying
to set it in the internal -fsdev option, and let the backend code
error out gracefully (ie, like it already does when the user passes
-fsdev on the command line).
Reported-by: Thomas Huth <[email protected]>
Signed-off-by: Greg Kurz <[email protected]>
Reviewed-by: Thomas Huth <[email protected]>
| 32b6943699948f7adc35ada233fbd25daffad5e9 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/32b6943699948f7adc35ada233fbd25daffad5e9 | 2017-09-05 17:56:58+02:00 |
cpu: Define new cpu_transaction_failed() hook
Currently we have a rather half-baked setup for allowing CPUs to
generate exceptions on accesses to invalid memory: the CPU has a
cpu_unassigned_access() hook which the memory system calls in
unassigned_mem_write() and unassigned_mem_read() if the current_cpu
pointer is non-NULL. This was originally designed before we
implemented the MemTxResult type that allows memory operations to
report a success or failure code, which is why the hook is called
right at the bottom of the memory system. The major problem with
this is that it means that the hook can be called even when the
access was not actually done by the CPU: for instance if the CPU
writes to a DMA engine register which causes the DMA engine to begin
a transaction which has been set up by the guest to operate on
invalid memory then this will casue the CPU to take an exception
incorrectly. Another minor problem is that currently if a device
returns a transaction error then this won't turn into a CPU exception
at all.
The right way to do this is to have allow the CPU to respond
to memory system transaction failures at the point where the
CPU specific code calls into the memory system.
Define a new QOM CPU method and utility function
cpu_transaction_failed() which is called in these cases.
The functionality here overlaps with the existing
cpu_unassigned_access() because individual target CPUs will
need some work to convert them to the new system. When this
transition is complete we can remove the old cpu_unassigned_access()
code.
Signed-off-by: Peter Maydell <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Reviewed-by: Edgar E. Iglesias <[email protected]>
| 0dff0939f6fc6a7abd966d4295f06a06d7a01df9 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/0dff0939f6fc6a7abd966d4295f06a06d7a01df9 | 2017-09-04 15:21:54+01:00 |
block: fix leaks in bdrv_open_driver()
bdrv_open_driver() is called in two places, bdrv_new_open_driver() and
bdrv_open_common(). In the latter, failure cleanup in is in its caller,
bdrv_open_inherit(), which unrefs the bs->file of the failed driver open
if it exists.
Let's move the bs->file cleanup to bdrv_open_driver() to take care of
all callers and do not set bs->drv to NULL unless the driver's open
function failed. When bs is destroyed by removing its last reference, it
calls bdrv_close() which checks bs->drv to perform the needed cleanups
and also call the driver's close function. Since it cleans up options
and opaque we must take care not leave dangling pointers.
The error paths in bdrv_open_driver() are now two:
If open fails, drv->bdrv_close() should not be called. Unref the child
if it exists, free what we allocated and set bs->drv to NULL. Return the
error and let callers free their stuff.
If open succeeds but we fail after, return the error and let callers
unref and delete their bs, while cleaning up their allocations.
Signed-off-by: Manos Pitsidianakis <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
| 180ca19ae02be70f9b158bfd7dec1ff123b9cf8c | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/180ca19ae02be70f9b158bfd7dec1ff123b9cf8c | 2017-08-01 18:09:33+02:00 |
trace-events: fix code style: %# -> 0x%
In trace format '#' flag of printf is forbidden. Fix it to '0x%'.
This patch is created by the following:
check that we have a problem
> find . -name trace-events | xargs grep '%#' | wc -l
56
check that there are no cases with additional printf flags before '#'
> find . -name trace-events | xargs grep "%[-+ 0'I]+#" | wc -l
0
check that there are no wrong usage of '#' and '0x' together
> find . -name trace-events | xargs grep '0x%#' | wc -l
0
fix the problem
> find . -name trace-events | xargs sed -i 's/%#/0x%/g'
[Eric Blake noted that xargs grep '%[-+ 0'I]+#' should be xargs grep
"%[-+ 0'I]+#" instead so the shell quoting is correct.
--Stefan]
Signed-off-by: Vladimir Sementsov-Ogievskiy <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Message-id: [email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>
| db73ee4bc8861f9f6772e0d24f978d79e50e8dee | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/db73ee4bc8861f9f6772e0d24f978d79e50e8dee | 2017-08-01 12:13:07+01:00 |
target/arm: Correct MPU trace handling of write vs execute
Correct off-by-one bug in the PSMAv7 MPU tracing where it would print
a write access as "reading", an insn fetch as "writing", and a read
access as "execute".
Since we have an MMUAccessType enum now, we can make the code clearer
in the process by using that rather than the raw 0/1/2 values.
Signed-off-by: Peter Maydell <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Message-id: [email protected]
| 709e4407add7acacc593cb6cdac026558c9a8fb6 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/709e4407add7acacc593cb6cdac026558c9a8fb6 | 2017-07-31 13:05:04+01:00 |
nbd: fix memory leak in nbd_opt_go()
nbd/client.c:385:12: warning: Potential leak of memory pointed to by 'buf'
Reported-by: Clang Static Analyzer
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Message-Id: <[email protected]>
[introduced in commit 8ecaeae8]
Signed-off-by: Eric Blake <[email protected]>
| 158b9aa568eabe614d37882dddc2eea534edc7ae | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/158b9aa568eabe614d37882dddc2eea534edc7ae | 2017-07-28 11:58:20-05:00 |
vfio/pci: Fixup v0 PCIe capabilities
Intel 82599 VFs report a PCIe capability version of 0, which is
invalid. The earliest version of the PCIe spec used version 1. This
causes Windows to fail startup on the device and it will be disabled
with error code 10. Our choices are either to drop the PCIe cap on
such devices, which has the side effect of likely preventing the guest
from discovering any extended capabilities, or performing a fixup to
update the capability to the earliest valid version. This implements
the latter.
Signed-off-by: Alex Williamson <[email protected]>
| 47985727e383eee191a39cc007541c17cd8680ee | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/47985727e383eee191a39cc007541c17cd8680ee | 2017-07-10 10:39:43-06:00 |
megasas: always store SCSIRequest* into MegasasCmd
This ensures that the request is unref'ed properly, and avoids a
segmentation fault in the new qtest testcase that is added.
This is CVE-2017-9503.
Reported-by: Zhangyanyu <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
| 87e459a810d7b1ec1638085b5a80ea3d9b43119a | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/87e459a810d7b1ec1638085b5a80ea3d9b43119a | 2017-06-15 11:04:05+02:00 |
monitor: resurrect handle_qmp_command trace event
Commit 104fc3027960dd2aa9d310936a6cb201c60e1088 ("qmp: Drop duplicated
QMP command object checks") removed the call to
trace_handle_qmp_command() while eliminating code duplication.
This patch brings the trace event back so QEMU-internal trace events can
be correlated with the QMP commands that caused them.
Signed-off-by: Stefan Hajnoczi <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Message-id: [email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>
| b097efc0027e36fd15a4fc2e415e780611024757 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/b097efc0027e36fd15a4fc2e415e780611024757 | 2017-06-13 14:35:11+01:00 |
block/gluster.c: Handle qdict_array_entries() failure
In qemu_gluster_parse_json(), the call to qdict_array_entries()
could return a negative error code, which we were ignoring
because we assigned the result to an unsigned variable.
Fix this by using the 'int' type instead, which matches the
return type of qdict_array_entries() and also the type
we use for the loop enumeration variable 'i'.
(Spotted by Coverity, CID 1360960.)
Signed-off-by: Peter Maydell <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Reviewed-by: Jeff Cody <[email protected]>
Message-id: [email protected]
Signed-off-by: Jeff Cody <[email protected]>
| 56faeb9bb6872b3f926b3b3e0452a70beea10af2 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/56faeb9bb6872b3f926b3b3e0452a70beea10af2 | 2017-06-09 08:41:29-04:00 |
xhci: add CONFIG_USB_XHCI_NEC option
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1451189
Signed-off-by: Gerd Hoffmann <[email protected]>
Message-id: [email protected]
| 2da077a881894c0b18032153c709d95ac89492c6 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/2da077a881894c0b18032153c709d95ac89492c6 | 2017-05-29 14:03:36+02:00 |
input: limit kbd queue depth
Apply a limit to the number of items we accept into the keyboard queue.
Impact: Without this limit vnc clients can exhaust host memory by
sending keyboard events faster than qemu feeds them to the guest.
Fixes: CVE-2017-8379
Cc: P J P <[email protected]>
Cc: Huawei PSIRT <[email protected]>
Reported-by: [email protected]
Signed-off-by: Gerd Hoffmann <[email protected]>
Message-id: [email protected]
| fa18f36a461984eae50ab957e47ec78dae3c14fc | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/fa18f36a461984eae50ab957e47ec78dae3c14fc | 2017-05-03 14:18:21+02:00 |
qcow2: Allow discard of final unaligned cluster
As mentioned in commit 0c1bd46, we ignored requests to
discard the trailing cluster of an unaligned image. While
discard is an advisory operation from the guest standpoint,
(and we are therefore free to ignore any request), our
qcow2 implementation exploits the fact that a discarded
cluster reads back as 0. As long as we discard on cluster
boundaries, we are fine; but that means we could observe
non-zero data leaked at the tail of an unaligned image.
Enhance iotest 66 to cover this case, and fix the implementation
to honor a discard request on the final partial cluster.
Signed-off-by: Eric Blake <[email protected]>
Message-id: [email protected]
Signed-off-by: Max Reitz <[email protected]>
| 048c5fd1bfc787adcb1b726ce997e87fe44545fd | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/048c5fd1bfc787adcb1b726ce997e87fe44545fd | 2017-04-28 16:02:03+02:00 |
ui/console: use exclusive mechanism directly
The previous commit (8bb93c6f99) using async_safe_run_on_cpu() doesn't
work on graphics sub-system which restrict which threads can do GUI
updates. Rather the special casing MacOS we just directly call the
helper and move all the exclusive handling into do_dafe_dpy_refresh().
The unfortunate bouncing of the BQL is to ensure there is no deadlock
as vCPUs waiting on the BQL are kicked into their quiescent state.
Signed-off-by: Alex Bennée <[email protected]>
Reviewed-by: Paolo Bonzini <[email protected]>
Reviewed-by: Gerd Hoffmann <[email protected]>
| 0096109052c5b83ee6894c88acedfd59b76d0113 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/0096109052c5b83ee6894c88acedfd59b76d0113 | 2017-03-28 10:52:45+01:00 |
9pfs: fix file descriptor leak
The v9fs_create() and v9fs_lcreate() functions are used to create a file
on the backend and to associate it to a fid. The fid shouldn't be already
in-use, otherwise both functions may silently leak a file descriptor or
allocated memory. The current code doesn't check that.
This patch ensures that the fid isn't already associated to anything
before using it.
Signed-off-by: Li Qiang <[email protected]>
(reworded the changelog, Greg Kurz)
Signed-off-by: Greg Kurz <[email protected]>
| d63fb193e71644a073b77ff5ac6f1216f2f6cf6e | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/d63fb193e71644a073b77ff5ac6f1216f2f6cf6e | 2017-03-27 21:13:19+02:00 |
e1000e: correctly tear down MSI-X memory regions
MSI-X has been disabled by the time the e1000e device is unrealized, hence
msix_uninit is never called. This causes the object to be leaked, which
shows up as a RAMBlock with empty name when attempting migration.
Reported-by: Dr. David Alan Gilbert <[email protected]>
Cc: Jason Wang <[email protected]>
Cc: [email protected]
Signed-off-by: Paolo Bonzini <[email protected]>
Tested-by: Laurent Vivier <[email protected]>
Signed-off-by: Jason Wang <[email protected]>
| 7ec7ae4b973d1471f6f39fc2b6481f69c2b39593 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/7ec7ae4b973d1471f6f39fc2b6481f69c2b39593 | 2017-03-14 15:39:55+08:00 |
virtio: Fix error handling in virtio_bus_device_plugged
For one thing we shouldn't continue if an error happened, for the other
two steps failing can cause an abort() in error_setg because we reuse
the same errp blindly.
Add error handling checks to fix both issues.
Signed-off-by: Fam Zheng <[email protected]>
Reviewed-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
Reviewed-by: Cornelia Huck <[email protected]>
Reviewed-by: Andrew Jones <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
| a77690c41da67d85bab1e784a9f24f18bc63dbd9 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/a77690c41da67d85bab1e784a9f24f18bc63dbd9 | 2017-03-22 17:54:32+02:00 |
sheepdog: Fix error handling in sd_snapshot_delete()
As a bdrv_snapshot_delete() method, sd_snapshot_delete() must set an
error and return negative errno on failure. It sometimes returns -1,
and sometimes neglects to set an error. It also prints error messages
with error_report(). Fix all that.
Moreover, its handling of an attempt to delete a nonexistent snapshot
is wrong: it error_report()s and succeeds. Fix it to set an error and
return -ENOENT instead.
Signed-off-by: Markus Armbruster <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
| e25cad6921ef78c8e2b7a4f59b03545bd675a9ad | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/e25cad6921ef78c8e2b7a4f59b03545bd675a9ad | 2017-03-07 14:53:28+01:00 |
iotests: Fix another race in 030
We can't rely on a non-paused job to be present and running for us.
Assume that if the job is not present that it completed already.
Signed-off-by: John Snow <[email protected]>
Reviewed-by: Fam Zheng <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
| 2c3b44da07d341557a8203cc509ea07fe3605e11 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/2c3b44da07d341557a8203cc509ea07fe3605e11 | 2017-02-24 16:09:23+01:00 |
pc: pcihp: avoid adding ACPI_PCIHP_PROP_BSEL twice
PCI hotplug for bridges was introduced only since 2.0 however
acpi_set_bsel()->object_property_add_uint32_ptr(bus, ACPI_PCIHP_PROP_BSEL)
didn't take in account that for legacy mode (1.7) when
PCI hotplug for bridges is unavailable and ACPI_PCIHP_PROP_BSEL property
the only bus "PCI.0' has been created earlier at acpi_pcihp_init() time.
We managed to live with it only because of error rised by adding
a duplicate property in acpi_set_bsel() has been ignored which
resulted in useless leaking of just allocated (int)bus_bsel.
Issue affects only 1.7 machine type as ACPI tables supported by
QEMU were introduced at that time, but there wasn't PCI hotplug
for bridges till the next release (2.0).
Fix it by removing duplicate ACPI_PCIHP_PROP_BSEL intialization
in acpi_pcihp_init() and doing it only in one place acpi_set_pci_info().
PS:
do not ignore error returned by object_property_add_uint32_ptr()
and abort QEMU since it's programming error which should be fixed
instead of being ignored.
Signed-off-by: Igor Mammedov <[email protected]>
Reported-by: Marc-André Lureau <[email protected]>
Message-Id: <[email protected]>
Reviewed-by: Marcel Apfelbaum <[email protected]>
Reviewed-by: Marc-André Lureau <[email protected]>
[ Marc-André - Remove now unused ACPI_PCIHP_LEGACY_SIZE ]
Signed-off-by: Marc-André Lureau <[email protected]>
| f0c9d64a68b776374ec4732424a3e27753ce37b6 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/f0c9d64a68b776374ec4732424a3e27753ce37b6 | 2017-03-01 11:51:05+04:00 |
tests: fix ipmi-bt-test leak
Spotted by ASAN.
Signed-off-by: Marc-André Lureau <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
| 2607b660e9b9edb11384520249b9b683e1e8c8ab | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/2607b660e9b9edb11384520249b9b683e1e8c8ab | 2017-03-01 11:51:05+04:00 |
block/rbd: add all the currently supported runtime_opts
This adds all the currently supported runtime opts, which
are the options as parsed from the filename. All of these
options are explicitly checked for during during runtime,
with an exception to the "keyvalue-pairs" option.
This option contains all the key/value pairs that the QEMU rbd
driver merely unescapes, and passes along blindly to rados. This
option is a "legacy" option, and will not be exposed in the QAPI
or available for introspection.
Reviewed-by: Eric Blake <[email protected]>
Signed-off-by: Jeff Cody <[email protected]>
| 0f9d252de4a377cbdd9f05537b4b0b8893ab7979 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/0f9d252de4a377cbdd9f05537b4b0b8893ab7979 | 2017-02-28 11:32:25-05:00 |
9pfs: local: chown: don't follow symlinks
The local_chown() callback is vulnerable to symlink attacks because it
calls:
(1) lchown() which follows symbolic links for all path elements but the
rightmost one
(2) local_set_xattr()->setxattr() which follows symbolic links for all
path elements
(3) local_set_mapped_file_attr() which calls in turn local_fopen() and
mkdir(), both functions following symbolic links for all path
elements but the rightmost one
This patch converts local_chown() to rely on open_nofollow() and
fchownat() to fix (1), as well as local_set_xattrat() and
local_set_mapped_file_attrat() to fix (2) and (3) respectively.
This partly fixes CVE-2016-9602.
Signed-off-by: Greg Kurz <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
| d369f20763a857eac544a5289a046d0285a91df8 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/d369f20763a857eac544a5289a046d0285a91df8 | 2017-02-28 11:21:15+01:00 |
test-qmp-event: Simplify and tighten event_test_emit()
Use qdict_get_qdict() and qdict_get_try_int() to simplify.
While there, add a sanity check for seconds.
Signed-off-by: Markus Armbruster <[email protected]>
Message-Id: <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
| 4b32e11a59e34c5cf570c1fd102a78d9351e71f5 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/4b32e11a59e34c5cf570c1fd102a78d9351e71f5 | 2017-02-22 19:51:59+01:00 |
spapr: fix off-by-one error in spapr_ovec_populate_dt()
The last byte of the option vector was missing due to an off-by-one
error. Without this fix, client architecture support negotiation will
fail because the last byte of option vector 5, which contains the MMU
support, will be missed.
Signed-off-by: Sam Bobroff <[email protected]>
Reviewed-by: Thomas Huth <[email protected]>
Reviewed-by: Michael Roth <[email protected]>
Signed-off-by: David Gibson <[email protected]>
| fe93e3e6ec1b1bf4a4c9d4bf55f8776318da6847 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/fe93e3e6ec1b1bf4a4c9d4bf55f8776318da6847 | 2017-02-22 11:28:27+11:00 |
9pfs: introduce relative_openat_nofollow() helper
When using the passthrough security mode, symbolic links created by the
guest are actual symbolic links on the host file system.
Since the resolution of symbolic links during path walk is supposed to
occur on the client side. The server should hence never receive any path
pointing to an actual symbolic link. This isn't guaranteed by the protocol
though, and malicious code in the guest can trick the server to issue
various syscalls on paths whose one or more elements are symbolic links.
In the case of the "local" backend using the "passthrough" or "none"
security modes, the guest can directly create symbolic links to arbitrary
locations on the host (as per spec). The "mapped-xattr" and "mapped-file"
security modes are also affected to a lesser extent as they require some
help from an external entity to create actual symbolic links on the host,
i.e. another guest using "passthrough" mode for example.
The current code hence relies on O_NOFOLLOW and "l*()" variants of system
calls. Unfortunately, this only applies to the rightmost path component.
A guest could maliciously replace any component in a trusted path with a
symbolic link. This could allow any guest to escape a virtfs shared folder.
This patch introduces a variant of the openat() syscall that successively
opens each path element with O_NOFOLLOW. When passing a file descriptor
pointing to a trusted directory, one is guaranteed to be returned a
file descriptor pointing to a path which is beneath the trusted directory.
This will be used by subsequent patches to implement symlink-safe path walk
for any access to the backend.
Symbolic links aren't the only threats actually: a malicious guest could
change a path element to point to other types of file with undesirable
effects:
- a named pipe or any other thing that would cause openat() to block
- a terminal device which would become QEMU's controlling terminal
These issues can be addressed with O_NONBLOCK and O_NOCTTY.
Two helpers are introduced: one to open intermediate path elements and one
to open the rightmost path element.
Suggested-by: Jann Horn <[email protected]>
Signed-off-by: Greg Kurz <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
(renamed openat_nofollow() to relative_openat_nofollow(),
assert path is relative and doesn't contain '//',
fixed side-effect in assert, Greg Kurz)
Signed-off-by: Greg Kurz <[email protected]>
| 6482a961636d66cc10928dde5d4d908206e5f65a | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/6482a961636d66cc10928dde5d4d908206e5f65a | 2017-02-28 11:21:15+01:00 |
ppc: switch to constants within BUILD_BUG_ON
We are switching BUILD_BUG_ON to verify that it's parameter is a
compile-time constant, and it turns out that some gcc versions
(specifically gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609) are
not smart enough to figure it out for expressions involving local
variables. This is harmless but means that the check is ineffective for
these platforms. To fix, replace the variable with macros.
Reported-by: Peter Maydell <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
[dwg: Correct a printf format warning]
Signed-off-by: David Gibson <[email protected]>
| 25e6a11832bcd0715068f0cc24fb46ec03de676e | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/25e6a11832bcd0715068f0cc24fb46ec03de676e | 2017-01-31 14:04:06+11:00 |
exec: Add missing rcu_read_unlock
rcu_read_unlock was not called if the address_space_access_valid result is
negative.
This caused (at least) a problem when qemu on PPC/E500+TAP failed to terminate
properly and instead got stuck in a deadlock.
Signed-off-by: Roman Kapl <[email protected]>
Message-Id: <[email protected]>
Cc: [email protected]
Signed-off-by: Paolo Bonzini <[email protected]>
| 5ad4a2b75f85dd854a781a6e03b90320cb3441d3 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/5ad4a2b75f85dd854a781a6e03b90320cb3441d3 | 2017-01-16 17:52:35+01:00 |
aio: add polling mode to AioContext
The AioContext event loop uses ppoll(2) or epoll_wait(2) to monitor file
descriptors or until a timer expires. In cases like virtqueues, Linux
AIO, and ThreadPool it is technically possible to wait for events via
polling (i.e. continuously checking for events without blocking).
Polling can be faster than blocking syscalls because file descriptors,
the process scheduler, and system calls are bypassed.
The main disadvantage to polling is that it increases CPU utilization.
In classic polling configuration a full host CPU thread might run at
100% to respond to events as quickly as possible. This patch implements
a timeout so we fall back to blocking syscalls if polling detects no
activity. After the timeout no CPU cycles are wasted on polling until
the next event loop iteration.
The run_poll_handlers_begin() and run_poll_handlers_end() trace events
are added to aid performance analysis and troubleshooting. If you need
to know whether polling mode is being used, trace these events to find
out.
Note that the AioContext is now re-acquired before disabling notify_me
in the non-polling case. This makes the code cleaner since notify_me
was enabled outside the non-polling AioContext release region. This
change is correct since it's safe to keep notify_me enabled longer
(disabling is an optimization) but potentially causes unnecessary
event_notifer_set() calls. I think the chance of performance regression
is small here.
Signed-off-by: Stefan Hajnoczi <[email protected]>
Reviewed-by: Paolo Bonzini <[email protected]>
Message-id: [email protected]
Signed-off-by: Stefan Hajnoczi <[email protected]>
| 4a1cba3802554a3b077d436002519ff1fb0c18bf | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/4a1cba3802554a3b077d436002519ff1fb0c18bf | 2017-01-03 16:38:48+00:00 |
target-m68k: add 680x0 divu/divs variants
Update helper to set the throwing location in case of div-by-0.
Cleanup divX.w and add quad word variants of divX.l.
Signed-off-by: Laurent Vivier <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
[laurent: modified to clear Z on overflow, as found with risu]
| 0ccb9c1d8128a020720d5c6abf99a470742a1b94 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/0ccb9c1d8128a020720d5c6abf99a470742a1b94 | 2016-12-27 18:16:42+01:00 |
gluster: Fix use after free in glfs_clear_preopened()
This fixes a use-after-free bug introduced in commit 6349c154. We need
to use QLIST_FOREACH_SAFE() when freeing elements in the loop. Spotted
by Coverity.
Signed-off-by: Kevin Wolf <[email protected]>
Message-id: [email protected]
Signed-off-by: Jeff Cody <[email protected]>
| 668c0e441d761a79f33eae11c120e01a29f9d4dd | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/668c0e441d761a79f33eae11c120e01a29f9d4dd | 2016-11-21 17:04:43-05:00 |
char: cadence: check baud rate generator and divider values
The Cadence UART device emulator calculates speed by dividing the
baud rate by a 'baud rate generator' & 'baud rate divider' value.
The device specification defines these register values to be
non-zero and within certain limits. Add checks for these limits
to avoid errors like divide by zero.
Reported-by: Huawei PSIRT <[email protected]>
Signed-off-by: Prasad J Pandit <[email protected]>
Reviewed-by: Alistair Francis <[email protected]>
Message-id: [email protected]
Signed-off-by: Peter Maydell <[email protected]>
| 6e29651c5e3a0e0336818574f273b3f6ecea491d | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/6e29651c5e3a0e0336818574f273b3f6ecea491d | 2016-11-07 10:00:24+00:00 |
ppc/pnv: add XSCOM infrastructure
On a real POWER8 system, the Pervasive Interconnect Bus (PIB) serves
as a backbone to connect different units of the system. The host
firmware connects to the PIB through a bridge unit, the
Alter-Display-Unit (ADU), which gives him access to all the chiplets
on the PCB network (Pervasive Connect Bus), the PIB acting as the root
of this network.
XSCOM (serial communication) is the interface to the sideband bus
provided by the POWER8 pervasive unit to read and write to chiplets
resources. This is needed by the host firmware, OPAL and to a lesser
extent, Linux. This is among others how the PCI Host bridges get
configured at boot or how the LPC bus is accessed.
To represent the ADU of a real system, we introduce a specific
AddressSpace to dispatch XSCOM accesses to the targeted chiplets. The
translation of an XSCOM address into a PCB register address is
slightly different between the P9 and the P8. This is handled before
the dispatch using a 8byte alignment for all.
To customize the device tree, a QOM InterfaceClass, PnvXScomInterface,
is provided with a populate() handler. The chip populates the device
tree by simply looping on its children. Therefore, each model needing
custom nodes should not forget to declare itself as a child at
instantiation time.
Based on previous work done by :
Benjamin Herrenschmidt <[email protected]>
Signed-off-by: Cédric Le Goater <[email protected]>
[dwg: Added cpu parameter to xscom_complete()]
Signed-off-by: David Gibson <[email protected]>
| 967b75230b9720ea2b3ae49f38f8287026125f9f | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/967b75230b9720ea2b3ae49f38f8287026125f9f | 2016-10-28 09:38:25+11:00 |
exec: call cpu_exec_exit() from a CPU unrealize common function
As cpu_exec_exit() mirrors the cpu_exec_realizefn(),
rename it as cpu_exec_unrealizefn().
Create and register a cpu_common_unrealizefn() function for
the CPU device class and call cpu_exec_unrealizefn() from
this function.
Remove cpu_exec_exit() from cpu_common_finalize()
(which mirrors init, not realize), and as x86_cpu_unrealizefn()
and ppc_cpu_unrealizefn() overwrite the device class unrealize function,
add a call to a parent_unrealize pointer.
Signed-off-by: Laurent Vivier <[email protected]>
Reviewed-by: Eduardo Habkost <[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
| 7bbc124e7e8fb544288ccd1f5185643a7d0554b8 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/7bbc124e7e8fb544288ccd1f5185643a7d0554b8 | 2016-10-24 17:29:16-02:00 |
9pfs: fix memory leak in v9fs_xattrcreate
The 'fs.xattr.value' field in V9fsFidState object doesn't consider the
situation that this field has been allocated previously. Every time, it
will be allocated directly. This leads to a host memory leak issue if
the client sends another Txattrcreate message with the same fid number
before the fid from the previous time got clunked.
Signed-off-by: Li Qiang <[email protected]>
Reviewed-by: Greg Kurz <[email protected]>
[groug, updated the changelog to indicate how the leak can occur]
Signed-off-by: Greg Kurz <[email protected]>
| ff55e94d23ae94c8628b0115320157c763eb3e06 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/ff55e94d23ae94c8628b0115320157c763eb3e06 | 2016-10-17 14:13:58+02:00 |
ide: Fix memory leak in ide_register_restart_cb()
Fix a memory leak in ide_register_restart_cb() in hw/ide/core.c and add
idebus_unrealize() in hw/ide/qdev.c to have calls to
qemu_del_vm_change_state_handler() to deal with the dangling change
state handler during hot-unplugging ide devices which might lead to a
crash.
Signed-off-by: Ashijeet Acharya <[email protected]>
Reviewed-by: John Snow <[email protected]>
Message-id: [email protected]
[Minor whitespace fix --js]
Signed-off-by: John Snow <[email protected]>
| ca44141d5fb801dd5903102acefd0f2d8e8bb6a1 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/ca44141d5fb801dd5903102acefd0f2d8e8bb6a1 | 2016-09-29 15:50:29-04:00 |
cpus-common: fix uninitialized variable use in run_on_cpu
Reviewed-by: Alex Bennée <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
| 0e55539c076a61b0b10a1aea1158fc20fb159d99 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/0e55539c076a61b0b10a1aea1158fc20fb159d99 | 2016-09-27 11:57:30+02:00 |
scsi-disk: change disk serial length from 20 to 36
Openstack Cinder assigns volume a 36 characters uuid as serial.
QEMU will shrinks the uuid to 20 characters, which does not match
the original uuid.
Note that there is no limit to the length of the serial number in
the SCSI spec. 20 was copy-pasted from virtio-blk which in turn was
copy-pasted from ATA; 36 is even more arbitrary. However, bumping it
up too much might cause issues (e.g. 252 seems to make sense because
then the maximum amount of returned data is 256; but who knows there's
no off-by-one somewhere for such a nicely rounded number).
Signed-off-by: Rony Weng <[email protected]>
Message-Id: <[email protected]>
Cc: [email protected]
Signed-off-by: Paolo Bonzini <[email protected]>
| 48b6206305b8d56524ac2ee347b68e6e0a528559 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/48b6206305b8d56524ac2ee347b68e6e0a528559 | 2016-09-13 19:08:45+02:00 |
tests: fix leak in test-string-input-visitor
Free the list returned by visit_type_intList().
Signed-off-by: Marc-André Lureau <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
| bd794065ffffe10721b6a95f1db52f2cc7953196 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/bd794065ffffe10721b6a95f1db52f2cc7953196 | 2016-09-08 18:05:21+04:00 |
ppc: Don't update NIP in lswi/lswx/stswi/stswx
Instead, pass GETPC() result to the corresponding helpers. This
requires a bit of fiddling to get the PC (hopefully) right in
the case where we generate a program check, though the hacks there
are temporary, a subsequent patch will clean this all up by always
having the nip already set to the right instruction when taking
the fault.
Signed-off-by: Benjamin Herrenschmidt <[email protected]>
[dwg: Fix trivial checkpatch warning]
Signed-off-by: David Gibson <[email protected]>
| e41029b378b4a65a0b89b5a8dc087aca6b5d012d | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/e41029b378b4a65a0b89b5a8dc087aca6b5d012d | 2016-09-07 12:37:48+10:00 |
ARM: ACPI: fix the AML ID format for CPU devices
Current QEMU will stall guest VM booting under ACPI mode when vcpu count
is >= 12. Analyzing the booting log, it turns out that DSDT table can't
be loaded correctly due to "Invalid character(s) in name (0x62303043),
repaired: [C00*]". This is because existing QEMU uses a lower case AML
ID for CPU devices (e.g. C000, C001, ..., C00a, C00b). The ACPI code
inside guest VM detects this lower case character as an invalid character
(see acpi_ut_valid_acpi_char() in drivers/acpi/acpica/utstring.c file)
and converts it to "*". This causes duplicated IDs (i.e. "C00a" ==>"C00*"
and "C00b" ==> "C00*"). So ACPI refuses to load the table.
This patch fixes the problem by changing the format with a upper case
character. It matches the CPU ID formats used in other parts of QEMU
code.
Reported-by: Eric Auger <[email protected]>
Signed-off-by: Wei Huang <[email protected]>
Reviewed-by: Shannon Zhao <[email protected]>
Reviewed-by: Eric Auger <[email protected]>
Tested-by: Eric Auger <[email protected]>
Message-id: [email protected]
Signed-off-by: Peter Maydell <[email protected]>
| f460be435f8750d5d1484d3d8b9e5b2c334f0e20 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/f460be435f8750d5d1484d3d8b9e5b2c334f0e20 | 2016-09-06 19:52:17+01:00 |
vhost: fix cleanup on not fully initialized device
If vhost_dev_init() failed, caller may still call vhost_dev_cleanup()
later. However, vhost_dev_cleanup() tries to remove the device from the
list even if it wasn't yet added, which may lead to crashes. Similarly
for the memory listener.
Signed-off-by: Marc-André Lureau <[email protected]>
Reviewed-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
| 5be5f9be724d43fbec3d6f955a43bc64a62d55cc | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/5be5f9be724d43fbec3d6f955a43bc64a62d55cc | 2016-07-29 00:33:46+03:00 |
vnc: don't crash getting server info if lsock is NULL
When VNC is started with '-vnc none' there will be no
listener socket present. When we try to populate the
VncServerInfo we'll crash accessing a NULL 'lsock'
field.
#0 qio_channel_socket_get_local_address (ioc=0x0, errp=errp@entry=0x7ffd5b8aa0f0) at io/channel-socket.c:33
#1 0x00007f4b9a297d6f in vnc_init_basic_info_from_server_addr (errp=0x7ffd5b8aa0f0, info=0x7f4b9d425460, ioc=<optimized out>) at ui/vnc.c:146
#2 vnc_server_info_get (vd=0x7f4b9e858000) at ui/vnc.c:223
#3 0x00007f4b9a29d318 in vnc_qmp_event (vs=0x7f4b9ef82000, vs=0x7f4b9ef82000, event=QAPI_EVENT_VNC_CONNECTED) at ui/vnc.c:279
#4 vnc_connect (vd=vd@entry=0x7f4b9e858000, sioc=sioc@entry=0x7f4b9e8b3a20, skipauth=skipauth@entry=true, websocket=websocket @entry=false) at ui/vnc.c:2994
#5 0x00007f4b9a29e8c8 in vnc_display_add_client (id=<optimized out>, csock=<optimized out>, skipauth=<optimized out>) at ui/v nc.c:3825
#6 0x00007f4b9a18d8a1 in qmp_marshal_add_client (args=<optimized out>, ret=<optimized out>, errp=0x7ffd5b8aa230) at qmp-marsh al.c:123
#7 0x00007f4b9a0b53f5 in handle_qmp_command (parser=<optimized out>, tokens=<optimized out>) at /usr/src/debug/qemu-2.6.0/mon itor.c:3922
#8 0x00007f4b9a348580 in json_message_process_token (lexer=0x7f4b9c78dfe8, input=0x7f4b9c7350e0, type=JSON_RCURLY, x=111, y=5 9) at qobject/json-streamer.c:94
#9 0x00007f4b9a35cfeb in json_lexer_feed_char (lexer=lexer@entry=0x7f4b9c78dfe8, ch=125 '}', flush=flush@entry=false) at qobj ect/json-lexer.c:310
#10 0x00007f4b9a35d0ae in json_lexer_feed (lexer=0x7f4b9c78dfe8, buffer=<optimized out>, size=<optimized out>) at qobject/json -lexer.c:360
#11 0x00007f4b9a348679 in json_message_parser_feed (parser=<optimized out>, buffer=<optimized out>, size=<optimized out>) at q object/json-streamer.c:114
#12 0x00007f4b9a0b3a1b in monitor_qmp_read (opaque=<optimized out>, buf=<optimized out>, size=<optimized out>) at /usr/src/deb ug/qemu-2.6.0/monitor.c:3938
#13 0x00007f4b9a186751 in tcp_chr_read (chan=<optimized out>, cond=<optimized out>, opaque=0x7f4b9c7add40) at qemu-char.c:2895
#14 0x00007f4b92b5c79a in g_main_context_dispatch () from /lib64/libglib-2.0.so.0
#15 0x00007f4b9a2bb0c0 in glib_pollfds_poll () at main-loop.c:213
#16 os_host_main_loop_wait (timeout=<optimized out>) at main-loop.c:258
#17 main_loop_wait (nonblocking=<optimized out>) at main-loop.c:506
#18 0x00007f4b9a0835cf in main_loop () at vl.c:1934
#19 main (argc=<optimized out>, argv=<optimized out>, envp=<optimized out>) at vl.c:4667
Do an upfront check for a NULL lsock and report an error to
the caller, which matches behaviour from before
commit 04d2529da27db512dcbd5e99d0e26d333f16efcc
Author: Daniel P. Berrange <[email protected]>
Date: Fri Feb 27 16:20:57 2015 +0000
ui: convert VNC server to use QIOChannelSocket
where getsockname() would be given a FD value -1 and thus report
an error to the caller.
Signed-off-by: Daniel P. Berrange <[email protected]>
Message-id: [email protected]
Signed-off-by: Gerd Hoffmann <[email protected]>
| 624cdd46d7f67fa2d23e87ffe0a36a569edde11a | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/624cdd46d7f67fa2d23e87ffe0a36a569edde11a | 2016-08-03 15:06:32+02:00 |
nvdimm: fix memory leak in error code path
object_get_canonical_path_component() returns a heap-allocated string
that must be freed using g_free().
Reported-by: Paolo Bonzini <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>
Reviewed-by: Igor Mammedov <[email protected]>
Reviewed-by: Xiao Guangrong <[email protected]>
Reviewed-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
| cdcab9d94101a6dd9ac8136c6f2cd15b6a997896 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/cdcab9d94101a6dd9ac8136c6f2cd15b6a997896 | 2016-07-20 19:30:26+03:00 |
hw/ppc/spapr: Make sure to close the htab_fd when migration is canceled
When canceling a migration process, we currently do not close the
HTAB migration file descriptor since htab_save_complete() is never
called in that case. So we leave the migration process with a
dangling htab_fd value around, and this causes any further migration
attempts to fail. To fix this issue, simply make sure that the
htab_fd is closed during the migration cleanup stage. And since the
cleanup() function is also called when migration succeeds, we can
also remove the call to close_htab_fd() from the htab_save_complete()
function.
Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1354341
Signed-off-by: Thomas Huth <[email protected]>
Reviewed-by: Greg Kurz <[email protected]>
Signed-off-by: David Gibson <[email protected]>
| c573fc03da65e35bf44bce0448ea12801e3631ac | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/c573fc03da65e35bf44bce0448ea12801e3631ac | 2016-07-25 10:19:30+10:00 |
vnc-enc-tight: fix off-by-one bug
In tight_encode_indexed_rect32, buf(or src)’s size is count. In for loop,
the logic is supposed to be that i is an index into src, i should be
incremented when incrementing src.
This is broken when src is incremented but i is not before while loop,
resulting in off-by-one bug in while loop.
Signed-off-by: He Rongguang <[email protected]>
Message-id: [email protected]
Signed-off-by: Gerd Hoffmann <[email protected]>
| 3f7e51bca3ef2d64c53b35ab9916c99e4a9e3c69 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/3f7e51bca3ef2d64c53b35ab9916c99e4a9e3c69 | 2016-07-15 12:11:55+02:00 |
net: do not use atexit for cleanup
This will be necessary in the next patch, which stops using atexit for
character devices; without it, vhost-user and the redirector filter
will cause a use-after-free. Relying on the ordering of atexit calls
is also brittle, even now that both the network and chardev
subsystems are using atexit.
Signed-off-by: Paolo Bonzini <[email protected]>
| 8caf911d3316b6eccc503cff0d9a68cf922950f1 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/8caf911d3316b6eccc503cff0d9a68cf922950f1 | 2016-07-13 13:30:00+02:00 |
target-ppc: Correct page size decoding in ppc_hash64_pteg_search()
The architecture specifies that when searching a PTEG for PTEs, entries
with a page size encoding that's not valid for the current segment should
be ignored, continuing the search.
The current implementation does this with ppc_hash64_pte_size_decode()
which is a very incomplete implementation of this check. We already have
code to do a full and correct page size decode in hpte_page_shift().
This patch moves hpte_page_shift() so it can be used in
ppc_hash64_pteg_search() and adjusts the latter's parameters to include
a full SLBE instead of just a segment page shift.
Signed-off-by: David Gibson <[email protected]>
Reviewed-by: Benjamin Herrenschmidt <[email protected]>
| 651060aba79dc9d0cc77ac3921948ea78dba7409 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/651060aba79dc9d0cc77ac3921948ea78dba7409 | 2016-07-05 14:31:08+10:00 |
q35: allow dynamic sysbus
Allow adding sysbus devices with -device on Q35.
At first Q35 will support only intel-iommu to be added this way,
however the command line will support all sysbus devices.
Mark with 'cannot_instantiate_with_device_add_yet' the ones
causing immediate problems (e.g. crashes).
Signed-off-by: Marcel Apfelbaum <[email protected]>
Reviewed-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
| bf8d492405feaee2c1685b3b9d5e03228ed3e47f | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/bf8d492405feaee2c1685b3b9d5e03228ed3e47f | 2016-07-04 14:50:01+03:00 |
arm: Re-enable tmp105 test
The tmp105 test is currently not executed since the following
line in the Makefile overwrites the check-qtest-arm-y variable
instead of extending it.
Signed-off-by: Thomas Huth <[email protected]>
Message-id: [email protected]
Reviewed-by: Peter Maydell <[email protected]>
Signed-off-by: Peter Maydell <[email protected]>
| 1f5c1cfbaec0792cd2e5daae082e017b3543c2c9 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/1f5c1cfbaec0792cd2e5daae082e017b3543c2c9 | 2016-06-27 15:37:32+01:00 |
vmxnet3: Fix reading/writing guest memory specially when behind an IOMMU
When a PCI device lives behind an IOMMU, it should use 'pci_dma_*' family of
functions when any transfer from/to guest memory is required while
'cpu_physical_memory_*' family of functions completely bypass any MMU/IOMMU in
the system.
vmxnet3 in some places was using 'cpu_physical_memory_*' family of functions
which works fine with the default QEMU setup where IOMMU is not enabled but
fails miserably when IOMMU is enabled. This commit converts all such instances
in favor of 'pci_dma_*'
Cc: Dmitry Fleytman <[email protected]>
Cc: Jason Wang <[email protected]>
Cc: [email protected]
Cc: Anthony Liguori <[email protected]>
Signed-off-by: KarimAllah Ahmed <[email protected]>
Acked-by: Dmitry Fleytman <[email protected]>
Signed-off-by: Jason Wang <[email protected]>
| c508277335e3b6b20cf18e6ea3a35c1fa835c64a | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/c508277335e3b6b20cf18e6ea3a35c1fa835c64a | 2016-06-28 10:13:57+08:00 |
linux-user: Block signals during sigaction() handling
Block signals while emulating sigaction. This is a non-interruptible
syscall, and using block_signals() avoids races where the host
signal handler is invoked and tries to examine the signal handler
data structures while we are updating them.
Signed-off-by: Timothy Edward Baldwin <[email protected]>
Message-id: 1441497448-32489-29-git-send-email-T.E.Baldwin99@members.leeds.ac.uk
[PMM: expanded commit message]
Reviewed-by: Peter Maydell <[email protected]>
Signed-off-by: Peter Maydell <[email protected]>
Signed-off-by: Riku Voipio <[email protected]>
| ef6a778ea2af4ebcf08a84cc9314cfe7cf2a2299 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/ef6a778ea2af4ebcf08a84cc9314cfe7cf2a2299 | 2016-06-07 16:39:07+03:00 |
ppc: Do some batching of TCG tlb flushes
On ppc64 especially, we flush the tlb on any slbie or tlbie instruction.
However, those instructions often come in bursts of 3 or more (context
switch will favor a series of slbie's for example to an slbia if the
SLB has less than a certain number of entries in it, and tlbie's can
happen in a series, with PAPR, H_BULK_REMOVE can remove up to 4 entries
at a time.
Doing a tlb_flush() each time is a waste of time. We end up doing a memset
of the whole TLB, reloading it for the next instruction, memset'ing again,
etc...
Those instructions don't have to take effect immediately. For slbie, they
can wait for the next context synchronizing event. For tlbie, the next
tlbsync.
This implements batching by keeping a flag that indicates that we have a
TLB in need of flushing. We check it on interrupts, rfi's, isync's and
tlbsync and flush the TLB if needed.
This reduces the number of tlb_flush() on a boot to a ubuntu installer
first dialog screen from roughly 360K down to 36K.
Signed-off-by: Benjamin Herrenschmidt <[email protected]>
[clg: added a 'CPUPPCState *' variable in h_remove() and
h_bulk_remove() ]
Signed-off-by: Cédric Le Goater <[email protected]>
[dwg: removed spurious whitespace change, use 0/1 not true/false
consistently, since tlb_need_flush has int type]
Signed-off-by: David Gibson <[email protected]>
| cd0c6f473532bfaf20a095bc90a18e45162981b5 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/cd0c6f473532bfaf20a095bc90a18e45162981b5 | 2016-05-30 13:20:04+10:00 |
scsi: megasas: initialise local configuration data buffer
When reading MegaRAID SAS controller configuration via MegaRAID
Firmware Interface(MFI) commands, routine megasas_dcmd_cfg_read
uses an uninitialised local data buffer. Initialise this buffer
to avoid stack information leakage.
Reported-by: Li Qiang <[email protected]>
Signed-off-by: Prasad J Pandit <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
| d37af740730dbbb93960cd318e040372d04d6dcf | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/d37af740730dbbb93960cd318e040372d04d6dcf | 2016-05-29 09:11:10+02:00 |
loader: fix potential memory leak
Signed-off-by: Cao jin <[email protected]>
Signed-off-by: Michael Tokarev <[email protected]>
| ed2f3bc1fad37297468234add82f464b59b16830 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/ed2f3bc1fad37297468234add82f464b59b16830 | 2016-05-18 15:04:26+03:00 |
linux-user: Handle msgrcv error case correctly
The msgrcv ABI is a bit odd -- the msgsz argument is a size_t, which is
unsigned, but it must fail EINVAL if the value is negative when cast
to a long. We were incorrectly passing the value through an
"unsigned int", which meant that if the guest was 32-bit longs and
the host was 64-bit longs an input of 0xffffffff (which should trigger
EINVAL) would simply be passed to the host msgrcv() as 0xffffffff,
where it does not cause the host kernel to reject it.
Follow the same approach as do_msgsnd() in using a ssize_t and
doing the check for negative values by hand, so we correctly fail
in this corner case.
This fixes the msgrcv03 Linux Test Project test case, which otherwise
hangs.
Signed-off-by: Peter Maydell <[email protected]>
Signed-off-by: Riku Voipio <[email protected]>
| 99874f65526ed7827202c6e17c62f30d47652bdd | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/99874f65526ed7827202c6e17c62f30d47652bdd | 2016-05-27 14:50:39+03:00 |
iotests: fix the broken 026.nocache output
This patch fixes longstanding issue with 026 iotest. Unfortunately,
this test contains 2 versions of the correct output, one for cached
writes and one for non-cached ones. People tends to fix only one
version of output of the test and thus noncached version becomes
broken. Unfortunately, it is default in tests/check-block.sh
The following problematic commits were made:
commit 3b5e14c76a6bb142bf250ddf99e24a0ac8c7bc12
Author: Max Reitz <[email protected]>
Date: Tue Dec 2 18:32:51 2014 +0100
qcow2: Flushing the caches in qcow2_close may fail
commit a069e2f1372a0a823ab506fc019852a2a652aa54
Author: John Snow <[email protected]>
Date: Fri Feb 6 16:26:17 2015 -0500
blkdebug: fix "once" rule
commit b106ad9185f35fc4ad669555ad0e79e276083bd7
Author: Kevin Wolf <[email protected]>
Date: Fri Mar 28 18:06:31 2014 +0100
qcow2: Don't rely on free_cluster_index in alloc_refcount_block()
Signed-off-by: Pavel Butsykin <[email protected]>
Signed-off-by: Denis V. Lunev <[email protected]>
CC: Max Reitz <[email protected]>
CC: John Snow <[email protected]>
CC: Kevin Wolf <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
| af74e865c40d00c12e5fd0c556d7812305930b24 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/af74e865c40d00c12e5fd0c556d7812305930b24 | 2016-04-12 18:06:51+02:00 |
block/vpc: make checks on max table size a bit more lax
The check on the max_table_size field not being larger than required is
valid, and in accordance with the VHD spec. However, there have been
VHD images encountered in the wild that have an out-of-spec max table
size that is technically too large.
There is no issue in allowing this larger table size, as we also
later verify that the computed size (used for the pagetable) is
large enough to fit all sectors. In addition, max_table_entries
is bounds checked against SIZE_MAX and INT_MAX.
Remove the strict check, so that we can accomodate these sorts of
images that are benignly out of spec.
Reported-by: Stefan Hajnoczi <[email protected]>
Reported-by: Grant Wu <[email protected]>
Signed-off-by: Jeff Cody <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
| 66176fc6a7b86fcead206fb0685ba688e40646a9 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/66176fc6a7b86fcead206fb0685ba688e40646a9 | 2016-04-15 17:22:12+02:00 |
ivshmem: Simplify rejection of invalid peer ID from server
ivshmem_read() processes server messages. These are 64 bit signed
integers. -1 is shared memory setup, 16 bit unsigned is a peer ID,
anything else is invalid.
ivshmem_read() rejects invalid negative messages right away, silently.
Invalid positive messages get rejected only in resize_peers(), and
ivshmem_read() then prints the rather cryptic message "failed to
resize peers array".
Extend the first check to cover all invalid messages, make it report
"server sent invalid message", and drop the second check.
Now resize_peers() can't fail anymore; simplify.
Signed-off-by: Markus Armbruster <[email protected]>
Reviewed-by: Marc-André Lureau <[email protected]>
Message-Id: <[email protected]>
| cd9953f720e1d57cfa86bc0882abced45ba96d3c | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/cd9953f720e1d57cfa86bc0882abced45ba96d3c | 2016-03-21 21:29:01+01:00 |
vl: fix tracing initialization
we should call trace_init_backends() before trace_init_file() for
CONFIG_TRACE_SIMPLE There is no difference for other cases.
This problem was introduced by the commit
commit 41fc57e44ed64cd4ab5393d83624afd897dabd4f
Author: Paolo Bonzini <[email protected]>
Date: Thu Jan 7 16:55:24 2016 +0300
trace: split trace_init_file out of trace_init_backends
'make check' was failed as a result if configured with
--enable-trace-backends=simple
Spotted by Alex Bennée.
Signed-off-by: Denis V. Lunev <[email protected]>
Reviewed-by: Alex Bennée <[email protected]>
Tested-by: Alex Bennée <[email protected]>
Tested-by: Christian Borntraeger <[email protected]>
Message-id: [email protected]
CC: Alex Bennée <[email protected]>
CC: Paolo Bonzini <[email protected]>
CC: Stefan Hajnoczi <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>
| 62cb4145bbc71fcb9754034655a6c7327905efc4 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/62cb4145bbc71fcb9754034655a6c7327905efc4 | 2016-03-01 13:20:15+00:00 |
watchdog/diag288: avoid race condition on expired watchdog
When configured to inject an NMI, watchdog_perform_action() may cause
the BQL to be temporarily relinquished (inject_nmi() → ... →
s390_nmi() → s390_cpu_restart() → run_on_cpu()). When the guest issues
diag 288 again in response to the NMI, the diag 288 operation will
race against wdt_diag288_reset(). Depending on scheduler behaviour,
wdt_diag288_reset() may be run after the guest issued a diag 288
Init. As a result, we will cancel the timer the guest just set up. The
effect observed by the guest is that a second expiry does not trigger
the watchdog action and diag 288 Change operations fail.
Fix this by resetting the timer _before_ invoking the action.
Signed-off-by: Sascha Silbe <[email protected]>
Acked-by: David Hildenbrand <[email protected]>
Signed-off-by: Cornelia Huck <[email protected]>
| fe345a3d5d7ed4bc2965c65542832b1fa785ae9d | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/fe345a3d5d7ed4bc2965c65542832b1fa785ae9d | 2016-03-01 12:15:28+01:00 |
gtk: fix uninitialized temporary VirtualConsole
Only the echo field is used in the temporary VirtualConsole, so the
damage was limited. But still, if echo was incorrectly set to true,
the result would be some puzzling output in VTE monitor and serial
consoles.
Fixes: fba958c692e47a373d15c1fd3d72b255bf76adbd
Cc: Gerd Hoffmann <[email protected]>
Tested-by: Mark Cave-Ayland <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
Message-id: [email protected]
Signed-off-by: Gerd Hoffmann <[email protected]>
| 327d83ba717c879f5640b41c15af3ce56a7922eb | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/327d83ba717c879f5640b41c15af3ce56a7922eb | 2016-02-22 08:38:42+01:00 |
qapi: Don't box branches of flat unions
There's no reason to do two malloc's for a flat union; let's just
inline the branch struct directly into the C union branch of the
flat union.
Surprisingly, fewer clients were actually using explicit references
to the branch types in comparison to the number of flat unions
thus modified.
This lets us reduce the hack in qapi-types:gen_variants() added in
the previous patch; we no longer need to distinguish between
alternates and flat unions.
The change to unboxed structs means that u.data (added in commit
cee2dedb) is now coincident with random fields of each branch of
the flat union, whereas beforehand it was only coincident with
pointers (since all branches of a flat union have to be objects).
Note that this was already the case for simple unions - but there
we got lucky. Remember, visit_start_union() blindly returns true
for all visitors except for the dealloc visitor, where it returns
the value !!obj->u.data, and that this result then controls
whether to proceed with the visit to the variant. Pre-patch,
this meant that flat unions were testing whether the boxed pointer
was still NULL, and thereby skipping visit_end_implicit_struct()
and avoiding a NULL dereference if the pointer had not been
allocated. The same was true for simple unions where the current
branch had pointer type, except there we bypassed visit_type_FOO().
But for simple unions where the current branch had scalar type, the
contents of that scalar meant that the decision to call
visit_type_FOO() was data-dependent - the reason we got lucky there
is that visit_type_FOO() for all scalar types in the dealloc visitor
is a no-op (only the pointer variants had anything to free), so it
did not matter whether the dealloc visit was skipped. But with this
patch, we would risk leaking memory if we could skip a call to
visit_type_FOO_fields() based solely on a data-dependent decision.
But notice: in the dealloc visitor, visit_type_FOO() already handles
a NULL obj - it was only the visit_type_implicit_FOO() that was
failing to check for NULL. And now that we have refactored things to
have the branch be part of the parent struct, we no longer have a
separate pointer that can be NULL in the first place. So we can just
delete the call to visit_start_union() altogether, and blindly visit
the branch type; there is no change in behavior except to the dealloc
visitor, where we now unconditionally visit the branch, but where that
visit is now always safe (for a flat union, we can no longer
dereference NULL, and for a simple union, visit_type_FOO() was already
safely handling NULL on pointer types).
Unfortunately, simple unions are not as easy to switch to unboxed
layout; because we are special-casing the hidden implicit type with
a single 'data' member, we really DO need to keep calling another
layer of visit_start_struct(), with a second malloc; although there
are some cleanups planned for simple unions in later patches.
visit_start_union() and gen_visit_implicit_struct() are now unused.
Drop them.
Note that after this patch, the only remaining use of
visit_start_implicit_struct() is for alternate types; the next patch
will do further cleanup based on that fact.
Signed-off-by: Eric Blake <[email protected]>
Message-Id: <[email protected]>
[Dead code deletion squashed in, commit message updated accordingly]
Signed-off-by: Markus Armbruster <[email protected]>
| 544a3731591f5d53e15f22de00ce5ac758d490b3 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/544a3731591f5d53e15f22de00ce5ac758d490b3 | 2016-02-19 11:08:57+01:00 |
ivshmem: remove redundant assignment, fix crash with msi=off
Fix crash when msi=false introduced in 660c97ee (msi_vectors is NULL in
this case)
Signed-off-by: Marc-André Lureau <[email protected]>
Reviewed-by: Markus Armbruster <[email protected]>
| 47213eb1104709bf238c8d16db20aa47d37b1c59 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/47213eb1104709bf238c8d16db20aa47d37b1c59 | 2016-02-02 13:28:58+01:00 |
s390x: s390_cpu_get_phys_page_debug has to return -1
If translation fails, we have to return -1. For now, we
would simply return the value last stored to raddr (if any).
This way, reading invalid memory via gdb will return values, although it
shouldn't.
Reviewed-by: Christian Borntraeger <[email protected]>
Signed-off-by: David Hildenbrand <[email protected]>
Signed-off-by: Cornelia Huck <[email protected]>
| 234779a2b9141d9386289ba5ed86c9d617567646 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/234779a2b9141d9386289ba5ed86c9d617567646 | 2016-01-27 15:34:48+01:00 |
configure: sanity check the glib library that pkg-config finds
Developers on 64-bit machines will often try to perform a
32-bit build of QEMU by running
./configure --extra-cflags="-m32"
Unfortunately if PKG_CONFIG_LIBDIR is not set to point to
the location of the 32-bit pkg-config files, then configure
will silently pick up the 64-bit pkg-config files and still
succeed.
This causes a problem for glib because it means QEMU will
be pulling in /usr/lib64/glib-2.0/include/glibconfig.h
instead of /usr/lib/glib-2.0/include/glibconfig.h
This causes problems because the 'gsize' type (defined as
'unsigned long') will no longer be fully compatible with
the 'size_t' type (defined as 'unsigned int'). Although
both are the same size, the compiler refuses to allow
casts from 'unsigned long *' to 'unsigned int *' as they
are different pointer types. This results in non-obvious
compiler errors when building QEMU eg
qga/commands-posix.c: In function ‘qmp_guest_set_user_password’:
qga/commands-posix.c:1912:55: error: passing argument 2 of ‘g_base64_decode’ from incompatible pointer type [-Werror=incompatible-pointer-types]
rawpasswddata = (char *)g_base64_decode(password, &rawpasswdlen);
^
In file included from /usr/include/glib-2.0/glib.h:35:0,
from qga/commands-posix.c:14:
/usr/include/glib-2.0/glib/gbase64.h:52:9: note: expected ‘gsize * {aka long unsigned int *}’ but argument is of type ‘size_t * {aka unsigned int *}’
guchar *g_base64_decode (const gchar *text,
^
cc1: all warnings being treated as errors
To detect this problem, add a check to configure that
verifies that GLIB_SIZEOF_SIZE_T matches sizeof(size_t).
If this fails print a warning suggesting that the dev
probably needs to set PKG_CONFIG_LIBDIR.
On Fedora x86_64 it passes with any of:
# ./configure
# PKG_CONFIG_LIBDIR=/usr/lib/pkgconfig ./configure --extra-cflags="-m32"
# PKG_CONFIG_LIBDIR=/usr/lib64/pkgconfig ./configure --extra-cflags="-m64"
And fails with a mis-match
# PKG_CONFIG_LIBDIR=/usr/lib64/pkgconfig ./configure --extra-cflags="-m32"
# PKG_CONFIG_LIBDIR=/usr/lib/pkgconfig ./configure --extra-cflags="-m64"
ERROR: sizeof(size_t) doesn't match GLIB_SIZEOF_SIZE_T.
You probably need to set PKG_CONFIG_LIBDIR
to point to the right pkg-config files for your
build target
Signed-off-by: Daniel P. Berrange <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
| 977a82ab56daac83623d730174f47d5a7edd73c9 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/977a82ab56daac83623d730174f47d5a7edd73c9 | 2016-02-09 15:45:26+01:00 |
scripts/kvm/kvm_stat: Improve debugfs access checking
Access checking with F_OK was replaced with the better readable
os.path.exists().
On Linux exists() returns False when the user doesn't have sufficient
permissions for statting the directory. Therefore the error message
now states that sufficient rights are needed when the check fails.
Also added check for /sys/kernel/debug/tracing/.
Signed-off-by: Janosch Frank <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
| 7aa4ee5a60c6ac651fd2e60b783630e35a7e3ff4 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/7aa4ee5a60c6ac651fd2e60b783630e35a7e3ff4 | 2016-01-26 15:58:12+01:00 |
audio: Clean up inappropriate and unreachable use of hw_error()
audio_init() should not use hw_error(), because dumping CPU registers
is unhelpful there, and aborting is wrong, because it can be called
called from an audio device's realize() method.
The two uses of hw_error() come from commit 0d9acba:
* When qemu_new_timer() fails. It couldn't fail back then, and it
can't fail now. Drop the unreachable error handling.
* When no_audio_driver can't be initialized. It couldn't fail back
then, and it can't fail now. Replace the error handling by an
assertion.
Cc: Gerd Hoffmann <[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
Reviewed-by: Gerd Hoffmann <[email protected]>
| 7e274652e4e2225298a2735c3dcc74f2f8ba7b07 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/7e274652e4e2225298a2735c3dcc74f2f8ba7b07 | 2016-01-13 15:16:16+01:00 |
spapr_drc: Make device "spapr-dr-connector" unavailable with -device
It should only be created via spapr_dr_connector_new(). Attempting to
create it with -device crashes.
Signed-off-by: Markus Armbruster <[email protected]>
Signed-off-by: David Gibson <[email protected]>
| c401ae8c9cd4e335dca59661f2849e7a26b5eb31 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/c401ae8c9cd4e335dca59661f2849e7a26b5eb31 | 2015-12-04 10:56:29+11:00 |
bt: check struct sizes
See http://permalink.gmane.org/gmane.linux.bluez.kernel/36505. For historical
reasons these do not use sizeof, and Coverity caught a mistake in
EVT_ENCRYPT_CHANGE_SIZE.
In addition:
- remove status from create_conn_cancel_cp; the "status" field is only
in rp structs. Note that this means that the OCF_CREATE_CONN_CANCEL
could never have worked (it would have failed the LENGTH_CHECK), but
I am keeping it anyway.
- OCF_READ_LINK_QUALITY similarly could never have worked, but I am
fixing read_link_quality_cp anyway.
- fix inquiry_info which is shorter by one: the kernel has a struct that
is 14 byte long, but not counting the initial num_responses byte which
the kernel parses separately;
- remove extended_inquiry_info altogether, since it's not used and unlike
the other inquiry structs does not have the initial num_responses byte.
Signed-off-by: Paolo Bonzini <[email protected]>
Signed-off-by: Michael Tokarev <[email protected]>
| 98475746b357f6c048caf9e001998d8a0618b2e4 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/98475746b357f6c048caf9e001998d8a0618b2e4 | 2015-12-04 09:39:55+03:00 |
crypto: fix leak of gnutls_dh_params_t data on credential unload
The QCryptoTLSCredsX509 object was not free'ing the allocated
gnutls_dh_params_t data when unloading the credentials
Signed-off-by: Daniel P. Berrange <[email protected]>
| 61b9251a3aaa65e65c4aab3a6800e884bb3b82f9 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/61b9251a3aaa65e65c4aab3a6800e884bb3b82f9 | 2015-11-18 14:56:58+00:00 |
xen_disk: Account for failed and invalid operations
Signed-off-by: Alberto Garcia <[email protected]>
Message-id: e0cbb96cb0e1f86c37c7ce332efdf02b57b9d365.1446044838.git.berto@igalia.com
Signed-off-by: Stefan Hajnoczi <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
| 57ee366ce9cf8d9f7a52b7b654b9db78fe887349 | qemu | devign | 1 | https://github.com/qemu/qemu | https://github.com/qemu/qemu/commit/57ee366ce9cf8d9f7a52b7b654b9db78fe887349 | 2015-11-12 16:22:46+01:00 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.