Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stable 2.5 - boot HP Firmware Images of Router and Switches #40

Closed
wants to merge 59 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
0d33580
ehci: make idt processing more robust
kraxel Dec 14, 2015
42ae4a3
net: vmxnet3: avoid memory leakage in activate_device
Dec 15, 2015
d4aed70
target-ppc: kvm: fix floating point registers sync on little-endian h…
gkurz Jan 15, 2016
52a7b27
configure: Fix shell syntax to placate OpenBSD's pdksh
pm215 Dec 14, 2015
4d59e78
xen/blkif: Avoid double access to src->nr_segments
Dec 18, 2015
ff083d3
xenfb: avoid reading twice the same fields from the shared page
Dec 18, 2015
4588b0d
virtio-9p: use accessor to get thread_pool
gkurz Dec 23, 2015
16a2875
scsi: initialise info object with appropriate size
Dec 21, 2015
3e96d5d
ivshmem: no need for opaque argument
elmarco Dec 18, 2015
702a8d1
ivshmem: remove redundant assignment, fix crash with msi=off
elmarco Dec 18, 2015
7a2c1c8
net: rocker: fix an incorrect array bounds check
Dec 28, 2015
e1a8a09
block: Add blk_dev_has_tray()
XanClic Jan 29, 2016
6a49a71
blockdev: Fix 'change' for slot devices
XanClic Jan 29, 2016
abda95c
net/dump: fix nfds->filename leak
zhijianli88 Dec 23, 2015
aaa5271
net/filter: fix nf->netdev_id leak
zhijianli88 Dec 23, 2015
fe90bdc
net: ne2000: check ring buffer control registers
Feb 24, 2016
9849b19
net: set endianness on all backend devices
vivier Jan 13, 2016
3ede27d
ehci: update irq on reset
kraxel Jan 19, 2016
643c8d8
block/raw-posix: avoid bogus fixup for cylinders on DASD disks
borntraeger Dec 14, 2015
d983923
s390x/ioinst: set type and len for SEI response
Jan 14, 2016
091af18
s390x/css: fix control flags during csch
Jan 20, 2016
020282d
fw_cfg: avoid calculating invalid current entry pointer
Nov 5, 2015
225d50f
cpus: use broadcast on qemu_pause_cond
dagrh Jan 25, 2016
a38a283
qmp: Fix reference-counting of qnull on empty output visit
ebblake Jan 29, 2016
a375e0b
block: set device_list.tqe_prev to NULL on BDS removal
codyprime Feb 2, 2016
4853a5a
block: qemu-iotests - add test for snapshot, commit, snapshot bug
codyprime Feb 2, 2016
cb873ea
e1000: eliminate infinite loops on out-of-bounds transfer start
lersek Jan 19, 2016
c06f342
spapr: skip configuration section during migration of older machines
gkurz Feb 18, 2016
6b62303
hw/virtio: fix double use of a virtio flag
marcel-apf Feb 10, 2016
c5c9841
hw/virtio: group virtio flags into an enum
marcel-apf Feb 10, 2016
3092979
fw_cfg: unbreak migration compatibility for 2.4 and earlier machines
lersek Feb 18, 2016
9ae0217
vhost-user: don't merge regions with different fds
mstsirkin Feb 21, 2016
cab1cc7
target-arm: Make reserved ranges in ID_AA64* spaces RAZ, not UNDEF
pm215 Feb 19, 2016
4b0b1ec
quorum: Fix crash in quorum_aio_cb()
bertogg Mar 10, 2016
bad094d
vl.c: Fix regression in machine error message
marcel-apf Feb 12, 2016
a2ae168
migration: allow machine to enforce configuration section migration
gkurz Feb 18, 2016
aaf4fb6
ahci: Do not unmap NULL addresses
jnsnow Feb 10, 2016
24fe899
hmp: fix sendkey out of bounds write (CVE-2015-8619)
Blub Jan 13, 2016
b47809c
i386: avoid null pointer dereference
Dec 18, 2015
4f046a6
ide: ahci: reset ncq object to unused on error
Jan 11, 2016
d0ee85b
net: check packet payload length
Mar 2, 2016
38e0921
net: ne2000: fix bounds check in ioport operations
Dec 31, 2015
4dcd2f1
usb: check page select value while processing iTD
Jan 19, 2016
e3a2cdf
usb: check RNDIS buffer offsets & length
Feb 16, 2016
9bddb45
usb: check RNDIS message length
Feb 16, 2016
80b6e57
usb: check USB configuration descriptor object
Feb 11, 2016
acea76c
vmdk: Create streamOptimized as version 3
Sep 17, 2015
078de11
vmdk: Fix converting to streamOptimized
Jan 25, 2016
5f409b1
hyperv: cpu hotplug fix with HyperV enabled
Feb 22, 2016
a58047f
Update version for 2.5.1 release
mdroth Mar 29, 2016
4f0323d
vga: fix banked access bounds checking (CVE-2016-3710)
kraxel Apr 26, 2016
46aff2c
vga: add vbe_enabled() helper
kraxel Apr 26, 2016
2f2f74e
vga: factor out vga register setup
kraxel Apr 26, 2016
a6e5e5d
vga: update vga register setup on vbe changes
kraxel Apr 26, 2016
44b86aa
vga: make sure vga register setup for vbe stays intact (CVE-2016-3712).
kraxel Apr 26, 2016
706bab6
ehci: apply limit to iTD/sidt descriptors
kraxel Apr 18, 2016
0bcdb63
Revert "ehci: make idt processing more robust"
kraxel Apr 18, 2016
5b7236f
cadence_uart: bounds check write offset
mstsirkin Apr 18, 2016
db51dfc
Update version for 2.5.1.1 release
mdroth May 9, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.5.0
2.5.1.1
24 changes: 14 additions & 10 deletions block.c
Original file line number Diff line number Diff line change
Expand Up @@ -1976,21 +1976,25 @@ void bdrv_close_all(void)
}
}

/* Note that bs->device_list.tqe_prev is initially null,
* and gets set to non-null by QTAILQ_INSERT_TAIL(). Establish
* the useful invariant "bs in bdrv_states iff bs->tqe_prev" by
* resetting it to null on remove. */
void bdrv_device_remove(BlockDriverState *bs)
{
QTAILQ_REMOVE(&bdrv_states, bs, device_list);
bs->device_list.tqe_prev = NULL;
}

/* make a BlockDriverState anonymous by removing from bdrv_state and
* graph_bdrv_state list.
Also, NULL terminate the device_name to prevent double remove */
void bdrv_make_anon(BlockDriverState *bs)
{
/*
* Take care to remove bs from bdrv_states only when it's actually
* in it. Note that bs->device_list.tqe_prev is initially null,
* and gets set to non-null by QTAILQ_INSERT_TAIL(). Establish
* the useful invariant "bs in bdrv_states iff bs->tqe_prev" by
* resetting it to null on remove.
*/
/* Take care to remove bs from bdrv_states only when it's actually
* in it. */
if (bs->device_list.tqe_prev) {
QTAILQ_REMOVE(&bdrv_states, bs, device_list);
bs->device_list.tqe_prev = NULL;
bdrv_device_remove(bs);
}
if (bs->node_name[0] != '\0') {
QTAILQ_REMOVE(&graph_bdrv_states, bs, node_list);
Expand Down Expand Up @@ -2031,7 +2035,7 @@ static void change_parent_backing_link(BlockDriverState *from,
if (!to->device_list.tqe_prev) {
QTAILQ_INSERT_BEFORE(from, to, device_list);
}
QTAILQ_REMOVE(&bdrv_states, from, device_list);
bdrv_device_remove(from);
}
}

Expand Down
10 changes: 9 additions & 1 deletion block/block-backend.c
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,14 @@ bool blk_dev_has_removable_media(BlockBackend *blk)
return !blk->dev || (blk->dev_ops && blk->dev_ops->change_media_cb);
}

/*
* Does @blk's attached device model have a tray?
*/
bool blk_dev_has_tray(BlockBackend *blk)
{
return blk->dev_ops && blk->dev_ops->is_tray_open;
}

/*
* Notify @blk's attached device model of a media eject request.
* If @force is true, the medium is about to be yanked out forcefully.
Expand All @@ -473,7 +481,7 @@ void blk_dev_eject_request(BlockBackend *blk, bool force)
*/
bool blk_dev_is_tray_open(BlockBackend *blk)
{
if (blk->dev_ops && blk->dev_ops->is_tray_open) {
if (blk_dev_has_tray(blk)) {
return blk->dev_ops->is_tray_open(blk->dev_opaque);
}
return false;
Expand Down
12 changes: 7 additions & 5 deletions block/quorum.c
Original file line number Diff line number Diff line change
Expand Up @@ -646,8 +646,9 @@ static BlockAIOCB *read_quorum_children(QuorumAIOCB *acb)
}

for (i = 0; i < s->num_children; i++) {
bdrv_aio_readv(s->children[i]->bs, acb->sector_num, &acb->qcrs[i].qiov,
acb->nb_sectors, quorum_aio_cb, &acb->qcrs[i]);
acb->qcrs[i].aiocb = bdrv_aio_readv(s->children[i]->bs, acb->sector_num,
&acb->qcrs[i].qiov, acb->nb_sectors,
quorum_aio_cb, &acb->qcrs[i]);
}

return &acb->common;
Expand All @@ -662,9 +663,10 @@ static BlockAIOCB *read_fifo_child(QuorumAIOCB *acb)
qemu_iovec_init(&acb->qcrs[acb->child_iter].qiov, acb->qiov->niov);
qemu_iovec_clone(&acb->qcrs[acb->child_iter].qiov, acb->qiov,
acb->qcrs[acb->child_iter].buf);
bdrv_aio_readv(s->children[acb->child_iter]->bs, acb->sector_num,
&acb->qcrs[acb->child_iter].qiov, acb->nb_sectors,
quorum_aio_cb, &acb->qcrs[acb->child_iter]);
acb->qcrs[acb->child_iter].aiocb =
bdrv_aio_readv(s->children[acb->child_iter]->bs, acb->sector_num,
&acb->qcrs[acb->child_iter].qiov, acb->nb_sectors,
quorum_aio_cb, &acb->qcrs[acb->child_iter]);

return &acb->common;
}
Expand Down
7 changes: 0 additions & 7 deletions block/raw-posix.c
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,6 @@ static int hdev_probe_geometry(BlockDriverState *bs, HDGeometry *geo)
{
BDRVRawState *s = bs->opaque;
struct hd_geometry ioctl_geo = {0};
uint32_t blksize;

/* If DASD, get its geometry */
if (check_for_dasd(s->fd) < 0) {
Expand All @@ -803,12 +802,6 @@ static int hdev_probe_geometry(BlockDriverState *bs, HDGeometry *geo)
}
geo->heads = ioctl_geo.heads;
geo->sectors = ioctl_geo.sectors;
if (!probe_physical_blocksize(s->fd, &blksize)) {
/* overwrite cyls: HDIO_GETGEO result is incorrect for big drives */
geo->cylinders = bdrv_nb_sectors(bs) / (blksize / BDRV_SECTOR_SIZE)
/ (geo->heads * geo->sectors);
return 0;
}
geo->cylinders = ioctl_geo.cylinders;

return 0;
Expand Down
14 changes: 12 additions & 2 deletions block/vmdk.c
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,7 @@ static int vmdk_open_vmdk4(BlockDriverState *bs,
VmdkExtent *extent;
BDRVVmdkState *s = bs->opaque;
int64_t l1_backup_offset = 0;
bool compressed;

ret = bdrv_pread(file->bs, sizeof(magic), &header, sizeof(header));
if (ret < 0) {
Expand Down Expand Up @@ -644,14 +645,17 @@ static int vmdk_open_vmdk4(BlockDriverState *bs,
header = footer.header;
}

compressed =
le16_to_cpu(header.compressAlgorithm) == VMDK4_COMPRESSION_DEFLATE;
if (le32_to_cpu(header.version) > 3) {
char buf[64];
snprintf(buf, sizeof(buf), "VMDK version %" PRId32,
le32_to_cpu(header.version));
error_setg(errp, QERR_UNKNOWN_BLOCK_FORMAT_FEATURE,
bdrv_get_device_or_node_name(bs), "vmdk", buf);
return -ENOTSUP;
} else if (le32_to_cpu(header.version) == 3 && (flags & BDRV_O_RDWR)) {
} else if (le32_to_cpu(header.version) == 3 && (flags & BDRV_O_RDWR) &&
!compressed) {
/* VMware KB 2064959 explains that version 3 added support for
* persistent changed block tracking (CBT), and backup software can
* read it as version=1 if it doesn't care about the changed area
Expand Down Expand Up @@ -1654,7 +1658,13 @@ static int vmdk_create_extent(const char *filename, int64_t filesize,
}
magic = cpu_to_be32(VMDK4_MAGIC);
memset(&header, 0, sizeof(header));
header.version = zeroed_grain ? 2 : 1;
if (compress) {
header.version = 3;
} else if (zeroed_grain) {
header.version = 2;
} else {
header.version = 1;
}
header.flags = VMDK4_FLAG_RGD | VMDK4_FLAG_NL_DETECT
| (compress ? VMDK4_FLAG_COMPRESS | VMDK4_FLAG_MARKER : 0)
| (zeroed_grain ? VMDK4_FLAG_ZERO_GRAIN : 0);
Expand Down
34 changes: 30 additions & 4 deletions blockdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -2306,6 +2306,11 @@ void qmp_blockdev_open_tray(const char *device, bool has_force, bool force,
return;
}

if (!blk_dev_has_tray(blk)) {
/* Ignore this command on tray-less devices */
return;
}

if (blk_dev_is_tray_open(blk)) {
return;
}
Expand Down Expand Up @@ -2336,6 +2341,11 @@ void qmp_blockdev_close_tray(const char *device, Error **errp)
return;
}

if (!blk_dev_has_tray(blk)) {
/* Ignore this command on tray-less devices */
return;
}

if (!blk_dev_is_tray_open(blk)) {
return;
}
Expand Down Expand Up @@ -2365,7 +2375,7 @@ void qmp_x_blockdev_remove_medium(const char *device, Error **errp)
return;
}

if (has_device && !blk_dev_is_tray_open(blk)) {
if (has_device && blk_dev_has_tray(blk) && !blk_dev_is_tray_open(blk)) {
error_setg(errp, "Tray of device '%s' is not open", device);
return;
}
Expand All @@ -2384,12 +2394,19 @@ void qmp_x_blockdev_remove_medium(const char *device, Error **errp)

/* This follows the convention established by bdrv_make_anon() */
if (bs->device_list.tqe_prev) {
QTAILQ_REMOVE(&bdrv_states, bs, device_list);
bs->device_list.tqe_prev = NULL;
bdrv_device_remove(bs);
}

blk_remove_bs(blk);

if (!blk_dev_has_tray(blk)) {
/* For tray-less devices, blockdev-open-tray is a no-op (or may not be
* called at all); therefore, the medium needs to be ejected here.
* Do it after blk_remove_bs() so blk_is_inserted(blk) returns the @load
* value passed here (i.e. false). */
blk_dev_change_media_cb(blk, false);
}

out:
aio_context_release(aio_context);
}
Expand All @@ -2415,7 +2432,7 @@ static void qmp_blockdev_insert_anon_medium(const char *device,
return;
}

if (has_device && !blk_dev_is_tray_open(blk)) {
if (has_device && blk_dev_has_tray(blk) && !blk_dev_is_tray_open(blk)) {
error_setg(errp, "Tray of device '%s' is not open", device);
return;
}
Expand All @@ -2428,6 +2445,15 @@ static void qmp_blockdev_insert_anon_medium(const char *device,
blk_insert_bs(blk, bs);

QTAILQ_INSERT_TAIL(&bdrv_states, bs, device_list);

if (!blk_dev_has_tray(blk)) {
/* For tray-less devices, blockdev-close-tray is a no-op (or may not be
* called at all); therefore, the medium needs to be pushed into the
* slot here.
* Do it after blk_insert_bs() so blk_is_inserted(blk) returns the @load
* value passed here (i.e. true). */
blk_dev_change_media_cb(blk, true);
}
}

void qmp_x_blockdev_insert_medium(const char *device, const char *node_name,
Expand Down
6 changes: 5 additions & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -4758,7 +4758,11 @@ echo "GTK GL support $gtk_gl"
echo "GNUTLS support $gnutls"
echo "GNUTLS hash $gnutls_hash"
echo "libgcrypt $gcrypt"
echo "nettle $nettle ${nettle+($nettle_version)}"
if test "$nettle" = "yes"; then
echo "nettle $nettle ($nettle_version)"
else
echo "nettle $nettle"
fi
echo "libtasn1 $tasn1"
echo "VTE support $vte"
echo "curses support $curses"
Expand Down
4 changes: 2 additions & 2 deletions cpus.c
Original file line number Diff line number Diff line change
Expand Up @@ -986,7 +986,7 @@ static void qemu_wait_io_event_common(CPUState *cpu)
if (cpu->stop) {
cpu->stop = false;
cpu->stopped = true;
qemu_cond_signal(&qemu_pause_cond);
qemu_cond_broadcast(&qemu_pause_cond);
}
flush_queued_work(cpu);
cpu->thread_kicked = false;
Expand Down Expand Up @@ -1387,7 +1387,7 @@ void cpu_stop_current(void)
current_cpu->stop = false;
current_cpu->stopped = true;
cpu_exit(current_cpu);
qemu_cond_signal(&qemu_pause_cond);
qemu_cond_broadcast(&qemu_pause_cond);
}
}

Expand Down
18 changes: 8 additions & 10 deletions hmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1734,21 +1734,18 @@ void hmp_sendkey(Monitor *mon, const QDict *qdict)
int has_hold_time = qdict_haskey(qdict, "hold-time");
int hold_time = qdict_get_try_int(qdict, "hold-time", -1);
Error *err = NULL;
char keyname_buf[16];
char *separator;
int keyname_len;

while (1) {
separator = strchr(keys, '-');
keyname_len = separator ? separator - keys : strlen(keys);
pstrcpy(keyname_buf, sizeof(keyname_buf), keys);

/* Be compatible with old interface, convert user inputted "<" */
if (!strncmp(keyname_buf, "<", 1) && keyname_len == 1) {
pstrcpy(keyname_buf, sizeof(keyname_buf), "less");
if (keys[0] == '<' && keyname_len == 1) {
keys = "less";
keyname_len = 4;
}
keyname_buf[keyname_len] = 0;

keylist = g_malloc0(sizeof(*keylist));
keylist->value = g_malloc0(sizeof(*keylist->value));
Expand All @@ -1761,16 +1758,17 @@ void hmp_sendkey(Monitor *mon, const QDict *qdict)
}
tmp = keylist;

if (strstart(keyname_buf, "0x", NULL)) {
if (strstart(keys, "0x", NULL)) {
char *endp;
int value = strtoul(keyname_buf, &endp, 0);
if (*endp != '\0') {
int value = strtoul(keys, &endp, 0);
assert(endp <= keys + keyname_len);
if (endp != keys + keyname_len) {
goto err_out;
}
keylist->value->type = KEY_VALUE_KIND_NUMBER;
keylist->value->u.number = value;
} else {
int idx = index_from_key(keyname_buf);
int idx = index_from_key(keys, keyname_len);
if (idx == Q_KEY_CODE_MAX) {
goto err_out;
}
Expand All @@ -1792,7 +1790,7 @@ void hmp_sendkey(Monitor *mon, const QDict *qdict)
return;

err_out:
monitor_printf(mon, "invalid parameter: %s\n", keyname_buf);
monitor_printf(mon, "invalid parameter: %.*s\n", keyname_len, keys);
goto out;
}

Expand Down
2 changes: 1 addition & 1 deletion hw/9pfs/virtio-9p-coth.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ static int coroutine_enter_func(void *arg)
void co_run_in_worker_bh(void *opaque)
{
Coroutine *co = opaque;
thread_pool_submit_aio(qemu_get_aio_context()->thread_pool,
thread_pool_submit_aio(aio_get_thread_pool(qemu_get_aio_context()),
coroutine_enter_func, co, coroutine_enter_cb, co);
}
12 changes: 8 additions & 4 deletions hw/block/xen_blkif.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,10 @@ static inline void blkif_get_x86_32_req(blkif_request_t *dst, blkif_x86_32_reque
d->nr_sectors = s->nr_sectors;
return;
}
if (n > src->nr_segments)
n = src->nr_segments;
/* prevent the compiler from optimizing the code and using src->nr_segments instead */
barrier();
if (n > dst->nr_segments)
n = dst->nr_segments;
for (i = 0; i < n; i++)
dst->seg[i] = src->seg[i];
}
Expand All @@ -106,8 +108,10 @@ static inline void blkif_get_x86_64_req(blkif_request_t *dst, blkif_x86_64_reque
d->nr_sectors = s->nr_sectors;
return;
}
if (n > src->nr_segments)
n = src->nr_segments;
/* prevent the compiler from optimizing the code and using src->nr_segments instead */
barrier();
if (n > dst->nr_segments)
n = dst->nr_segments;
for (i = 0; i < n; i++)
dst->seg[i] = src->seg[i];
}
Expand Down
3 changes: 3 additions & 0 deletions hw/char/cadence_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,9 @@ static void uart_write(void *opaque, hwaddr offset,

DB_PRINT(" offset:%x data:%08x\n", (unsigned)offset, (unsigned)value);
offset >>= 2;
if (offset >= CADENCE_UART_R_MAX) {
return;
}
switch (offset) {
case R_IER: /* ier (wts imr) */
s->r[R_IMR] |= value;
Expand Down
Loading