Explicity zero the memory backing the crash notes during setup.
This allows the crash environment to be rather more certain whether
the crash notes were actually written, rather than trusting that the
memory was clear beforehand.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
/* If we dont care about the position of allocation, malloc. */
if ( low_crashinfo_mode == LOW_CRASHINFO_NONE )
- note = xmalloc_bytes(nr_bytes);
+ note = xzalloc_bytes(nr_bytes);
/* Protect the write into crash_notes[] with a spinlock, as this function
* is on a hotplug path and a hypercall path. */
if ( ! crash_heap_current )
return -ENOMEM;
+ memset(crash_heap_current, 0, crash_heap_size);
+
crash_heap_end = crash_heap_current + crash_heap_size;
}