[PATCH 0/2] spapr/nvram: Fix QEMU crash

Greg Kurz posted 2 patches 3 years, 8 months ago
Test docker-quick@centos7 failed
Test docker-mingw@fedora failed
Test checkpatch failed
Test FreeBSD failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/159715979684.1635409.14107632395902701971.stgit@bahia.lan
Maintainers: David Gibson <david@gibson.dropbear.id.au>, Artyom Tarasenko <atar4qemu@gmail.com>, Thomas Huth <thuth@redhat.com>, Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
There is a newer version of this series
hw/nvram/chrp_nvram.c         |   35 +++++++++++++++++++++++------------
hw/nvram/mac_nvram.c          |    2 +-
hw/nvram/spapr_nvram.c        |    7 ++++++-
hw/sparc/sun4m.c              |    2 +-
hw/sparc64/sun4u.c            |    2 +-
include/hw/nvram/chrp_nvram.h |    3 ++-
6 files changed, 34 insertions(+), 17 deletions(-)
[PATCH 0/2] spapr/nvram: Fix QEMU crash
Posted by Greg Kurz 3 years, 8 months ago
This series fixes the following crash:

$ qemu-system-ppc64 -M pseries $(for ((x=0;x<128;x++)); do \
  echo -n " -prom-env "$(for ((y=0;y<1024;y++)); do echo -n x ; done) ; \
  done) # this requires ~128 Kib
malloc(): corrupted top size
Aborted (core dumped)

This also affects g3beige and mac99 machine types, and probably some
sparc/sparc64 machine types as well, but I prefer to leave the fixing
to knowledgeable people.

---

Greg Kurz (2):
      nvram: Add dry_run argument to chrp_nvram_create_system_partition()
      spapr/nvram: Allocate enough space for all -prom-env options


 hw/nvram/chrp_nvram.c         |   35 +++++++++++++++++++++++------------
 hw/nvram/mac_nvram.c          |    2 +-
 hw/nvram/spapr_nvram.c        |    7 ++++++-
 hw/sparc/sun4m.c              |    2 +-
 hw/sparc64/sun4u.c            |    2 +-
 include/hw/nvram/chrp_nvram.h |    3 ++-
 6 files changed, 34 insertions(+), 17 deletions(-)

--
Greg