[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL v3 5/8] fw_cfg: prevent selector key conflict
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PULL v3 5/8] fw_cfg: prevent selector key conflict |
Date: |
Wed, 10 Jun 2015 08:35:28 +0200 |
From: "Gabriel L. Somlo" <address@hidden>
Enforce a single assignment of data for each distinct selector key.
Signed-off-by: Gabriel Somlo <address@hidden>
Reviewed-by: Laszlo Ersek <address@hidden>
Signed-off-by: Gerd Hoffmann <address@hidden>
---
hw/nvram/fw_cfg.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
index d2a4347..0c0e15e 100644
--- a/hw/nvram/fw_cfg.c
+++ b/hw/nvram/fw_cfg.c
@@ -423,6 +423,7 @@ static void fw_cfg_add_bytes_read_callback(FWCfgState *s,
uint16_t key,
key &= FW_CFG_ENTRY_MASK;
assert(key < FW_CFG_MAX_ENTRY && len < UINT32_MAX);
+ assert(s->entries[arch][key].data == NULL); /* avoid key conflict */
s->entries[arch][key].data = data;
s->entries[arch][key].len = (uint32_t)len;
--
1.8.3.1
- [Qemu-devel] [PULL v3 0/8] fw_cfg patch queue, Gerd Hoffmann, 2015/06/10
- [Qemu-devel] [PULL v3 5/8] fw_cfg: prevent selector key conflict,
Gerd Hoffmann <=
- [Qemu-devel] [PULL v3 6/8] fw_cfg: prohibit insertion of duplicate fw_cfg file names, Gerd Hoffmann, 2015/06/10
- [Qemu-devel] [PULL v3 2/8] fw_cfg: add fw_cfg_modify_i16 (update) method, Gerd Hoffmann, 2015/06/10
- [Qemu-devel] [PULL v3 4/8] fw_cfg: remove support for guest-side data writes, Gerd Hoffmann, 2015/06/10
- [Qemu-devel] [PULL v3 1/8] QemuOpts: increase number of vm_config_groups, Gerd Hoffmann, 2015/06/10
- [Qemu-devel] [PULL v3 3/8] fw_cfg: fix FW_CFG_BOOT_DEVICE update on ppc and sparc, Gerd Hoffmann, 2015/06/10
- [Qemu-devel] [PULL v3 7/8] fw_cfg: insert fw_cfg file blobs via qemu cmdline, Gerd Hoffmann, 2015/06/10
- [Qemu-devel] [PULL v3 8/8] bios-tables-test: handle false-positive smbios signature matches, Gerd Hoffmann, 2015/06/10
- Re: [Qemu-devel] [PULL v3 0/8] fw_cfg patch queue, Peter Maydell, 2015/06/10