kexec: clear notes during setup

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>
This commit is contained in:
Andrew Cooper committed 2012-05-07 13:32:28 +01:00
1 parent 68e6f038a4
commit 090e7cbafd
1 file changed
+3 -1
+3 -1
View File
@@ -401,7 +401,7 @@ static int kexec_init_cpu_notes(const unsigned long cpu)
/* 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. */
@@ -520,6 +520,8 @@ static int __init kexec_init(void)
if ( ! crash_heap_current )
return -ENOMEM;
memset(crash_heap_current, 0, crash_heap_size);
crash_heap_end = crash_heap_current + crash_heap_size;
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.