[Qemu-devel] [PATCH v3 0/2] hostmem-file: reject invalid pmem file sizes

Stefan Hajnoczi posted 2 patches 5 years, 2 months ago
Test asan passed
Test docker-mingw@fedora passed
Test docker-clang@ubuntu passed
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20190214031004.32522-1-stefanha@redhat.com
Maintainers: Stefan Weil <sw@weilnetz.de>, Eduardo Habkost <ehabkost@redhat.com>, Igor Mammedov <imammedo@redhat.com>
include/qemu/osdep.h    | 13 ++++++++++
backends/hostmem-file.c | 32 +++++++++++++++++++++----
util/oslib-posix.c      | 53 +++++++++++++++++++++++++++++++++++++++++
util/oslib-win32.c      |  5 ++++
4 files changed, 98 insertions(+), 5 deletions(-)
[Qemu-devel] [PATCH v3 0/2] hostmem-file: reject invalid pmem file sizes
Posted by Stefan Hajnoczi 5 years, 2 months ago
v3:
 * Added Patch 1 by Igor [Wei]
 * Moved pmem size check after mem_path check [Wei]

Guests started with NVDIMMs larger than the underlying host file produce
confusing errors inside the guest.  This happens because the guest
accesses pages beyond the end of the file.

Check the pmem file size on startup and print a clear error message if
the size is invalid.

Igor Mammedov (1):
  hostmem: simplify ifdef-s in file_backend_memory_alloc()

Stefan Hajnoczi (1):
  hostmem-file: reject invalid pmem file sizes

 include/qemu/osdep.h    | 13 ++++++++++
 backends/hostmem-file.c | 32 +++++++++++++++++++++----
 util/oslib-posix.c      | 53 +++++++++++++++++++++++++++++++++++++++++
 util/oslib-win32.c      |  5 ++++
 4 files changed, 98 insertions(+), 5 deletions(-)

-- 
2.20.1


Re: [Qemu-devel] [PATCH v3 0/2] hostmem-file: reject invalid pmem file sizes
Posted by Pankaj Gupta 5 years, 2 months ago

> 
> v3:
>  * Added Patch 1 by Igor [Wei]
>  * Moved pmem size check after mem_path check [Wei]
> 
> Guests started with NVDIMMs larger than the underlying host file produce
> confusing errors inside the guest.  This happens because the guest
> accesses pages beyond the end of the file.
> 
> Check the pmem file size on startup and print a clear error message if
> the size is invalid.
> 
> Igor Mammedov (1):
>   hostmem: simplify ifdef-s in file_backend_memory_alloc()
> 
> Stefan Hajnoczi (1):
>   hostmem-file: reject invalid pmem file sizes
> 
>  include/qemu/osdep.h    | 13 ++++++++++
>  backends/hostmem-file.c | 32 +++++++++++++++++++++----
>  util/oslib-posix.c      | 53 +++++++++++++++++++++++++++++++++++++++++
>  util/oslib-win32.c      |  5 ++++
>  4 files changed, 98 insertions(+), 5 deletions(-)
> 
> --
> 2.20.1

Both the patches look good to me.
Reviewed-by: Pankaj Gupta <pagupta@redhat.com>