aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorMatthew Leach <matthew.leach@arm.com>2012-09-21 13:56:11 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2012-09-26 17:58:39 -0400
commitc564df4db85aac8d1d65a56176a0a25f46138064 (patch)
treec026b395a89052ac685d60890192484da4994dce /arch/arm
parent4cabd1d9625c7d88acd143f4021fbef75394f154 (diff)
ARM: 7540/1: kexec: Check segment memory addresses
Ensure that the memory regions that are set within the segments correspond to physical contiguous memory regions. Reviewed-by: Simon Horman <horms@verge.net.au> Reviewed-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Matthew Leach <matthew.leach@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/kernel/machine_kexec.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/arm/kernel/machine_kexec.c b/arch/arm/kernel/machine_kexec.c
index dee34efca748..e29c3337ca81 100644
--- a/arch/arm/kernel/machine_kexec.c
+++ b/arch/arm/kernel/machine_kexec.c
@@ -8,6 +8,7 @@
8#include <linux/reboot.h> 8#include <linux/reboot.h>
9#include <linux/io.h> 9#include <linux/io.h>
10#include <linux/irq.h> 10#include <linux/irq.h>
11#include <linux/memblock.h>
11#include <asm/pgtable.h> 12#include <asm/pgtable.h>
12#include <linux/of_fdt.h> 13#include <linux/of_fdt.h>
13#include <asm/pgalloc.h> 14#include <asm/pgalloc.h>
@@ -44,6 +45,11 @@ int machine_kexec_prepare(struct kimage *image)
44 for (i = 0; i < image->nr_segments; i++) { 45 for (i = 0; i < image->nr_segments; i++) {
45 current_segment = &image->segment[i]; 46 current_segment = &image->segment[i];
46 47
48 err = memblock_is_region_memory(current_segment->mem,
49 current_segment->memsz);
50 if (err)
51 return - EINVAL;
52
47 err = get_user(header, (__be32*)current_segment->buf); 53 err = get_user(header, (__be32*)current_segment->buf);
48 if (err) 54 if (err)
49 return err; 55 return err;