Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c564df4d authored by Matthew Leach's avatar Matthew Leach Committed by Russell King
Browse files

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: default avatarSimon Horman <horms@verge.net.au>
Reviewed-by: default avatarWill Deacon <will.deacon@arm.com>
Signed-off-by: default avatarMatthew Leach <matthew.leach@arm.com>
Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 4cabd1d9
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@
#include <linux/reboot.h>
#include <linux/io.h>
#include <linux/irq.h>
#include <linux/memblock.h>
#include <asm/pgtable.h>
#include <linux/of_fdt.h>
#include <asm/pgalloc.h>
@@ -44,6 +45,11 @@ int machine_kexec_prepare(struct kimage *image)
	for (i = 0; i < image->nr_segments; i++) {
		current_segment = &image->segment[i];

		err = memblock_is_region_memory(current_segment->mem,
						current_segment->memsz);
		if (err)
			return - EINVAL;

		err = get_user(header, (__be32*)current_segment->buf);
		if (err)
			return err;