[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 04/15] nvdimm: support nvdimm label
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH 04/15] nvdimm: support nvdimm label |
Date: |
Thu, 17 Mar 2016 10:28:07 +0000 |
User-agent: |
Mutt/1.5.24 (2015-08-30) |
On Thu, Mar 17, 2016 at 04:32:50PM +0800, Xiao Guangrong wrote:
> +static void nvdimm_init(Object *obj)
> +{
> + object_property_add_bool(obj, "reserve-label", nvdimm_get_reserve_label,
> + nvdimm_set_reserve_label, NULL);
In the future users may wish for larger namespace label sizes. This
bool option will not allow that.
Perhaps the option should be an integer called "label-size"?
> +static void nvdimm_assert_rw_label_data(NVDIMMDevice *nvdimm, uint64_t size,
> + uint64_t offset)
> +{
> + assert(nvdimm->reserve_label &&
> + (nvdimm->label_size >= size + offset) && (offset + size >
> offset));
> +}
It's not clear from this patch alone, but QEMU is not allowed to assert
due to invalid inputs from the guest. So if input validation is
necessary here because the values may be invalid, please write if
statements and error returns.
This is important so guests cannot cause QEMU to core dump (SIGABRT
default behavior) and so that nested virtualization doesn't allow a
nested guest to DoS its parent guest.
signature.asc
Description: PGP signature
- [Qemu-devel] [PATCH 00/15] NVDIMM: introduce nvdimm label support, Xiao Guangrong, 2016/03/17
- [Qemu-devel] [PATCH 01/15] pc-dimm: get memory region from ->get_memory_region(), Xiao Guangrong, 2016/03/17
- [Qemu-devel] [PATCH 02/15] pc-dimm: introduce realize callback, Xiao Guangrong, 2016/03/17
- [Qemu-devel] [PATCH 05/15] acpi: add aml_object_type, Xiao Guangrong, 2016/03/17
- [Qemu-devel] [PATCH 03/15] pc-dimm: keep the state of the whole backend memory, Xiao Guangrong, 2016/03/17
- [Qemu-devel] [PATCH 04/15] nvdimm: support nvdimm label, Xiao Guangrong, 2016/03/17
- Re: [Qemu-devel] [PATCH 04/15] nvdimm: support nvdimm label,
Stefan Hajnoczi <=
- [Qemu-devel] [PATCH 06/15] acpi: add aml_call5, Xiao Guangrong, 2016/03/17
- [Qemu-devel] [PATCH 07/15] nvdimm acpi: set HDLE properly, Xiao Guangrong, 2016/03/17
- [Qemu-devel] [PATCH 08/15] nvdimm acpi: save arg3 of _DSM method, Xiao Guangrong, 2016/03/17
- [Qemu-devel] [PATCH 10/15] nvdimm acpi: abstract the operations for root device and nvdimm devices, Xiao Guangrong, 2016/03/17
- [Qemu-devel] [PATCH 09/15] nvdimm acpi: check UUID, Xiao Guangrong, 2016/03/17
- [Qemu-devel] [PATCH 11/15] nvdimm acpi: check revision, Xiao Guangrong, 2016/03/17
- [Qemu-devel] [PATCH 13/15] nvdimm acpi: support Get Namespace Label Data function, Xiao Guangrong, 2016/03/17