Message ID | 161894164234.29796.8745971840518585404.tip-bot2@tip-bot2 |
---|---|
State | New |
Headers | show |
Series | [tip:,x86/urgent] x86/crash: Fix crash_setup_memmap_entries() out-of-bounds access | expand |
diff --git a/arch/x86/kernel/crash.c b/arch/x86/kernel/crash.c index a8f3af2..b1deacb 100644 --- a/arch/x86/kernel/crash.c +++ b/arch/x86/kernel/crash.c @@ -337,7 +337,7 @@ int crash_setup_memmap_entries(struct kimage *image, struct boot_params *params) struct crash_memmap_data cmd; struct crash_mem *cmem; - cmem = vzalloc(sizeof(struct crash_mem)); + cmem = vzalloc(struct_size(cmem, ranges, 1)); if (!cmem) return -ENOMEM;