summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2021-04-25 09:02:13 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2021-04-25 09:02:13 -0700
commit11fac7a004113466b7155e9b0d836156cf8a7e8d (patch)
treea4f6f4f52e64d903c05a161594e7d29049200251
parent2a1d7946fa53cea2083e5981ff55a8176ab2be6b (diff)
parent5849cdf8c120e3979c57d34be55b92d90a77a47e (diff)
downloadlinux-11fac7a004113466b7155e9b0d836156cf8a7e8d.tar.bz2
Merge tag 'x86_urgent_for_v5.12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 fix from Borislav Petkov: "Fix an out-of-bounds memory access when setting up a crash kernel with kexec" * tag 'x86_urgent_for_v5.12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/crash: Fix crash_setup_memmap_entries() out-of-bounds access
-rw-r--r--arch/x86/kernel/crash.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kernel/crash.c b/arch/x86/kernel/crash.c
index a8f3af257e26..b1deacbeb266 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;