ARM: move vector stubs
Move the machine vector stubs into the page above the vector page, which we can prevent from being visible to userspace. Also move the reset stub, and place the swi vector at a location that the 'ldr' can get to it. This hides pointers into the kernel which could give valuable information to attackers, and reduces the number of exploitable instructions at a fixed address. Cc: <stable@vger.kernel.org> Acked-by: Nicolas Pitre <nico@linaro.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This commit is contained in:
@@ -1160,7 +1160,7 @@ static void __init devicemaps_init(struct machine_desc *mdesc)
|
||||
/*
|
||||
* Allocate the vector page early.
|
||||
*/
|
||||
vectors = early_alloc(PAGE_SIZE);
|
||||
vectors = early_alloc(PAGE_SIZE * 2);
|
||||
|
||||
early_trap_init(vectors);
|
||||
|
||||
@@ -1210,10 +1210,18 @@ static void __init devicemaps_init(struct machine_desc *mdesc)
|
||||
|
||||
if (!vectors_high()) {
|
||||
map.virtual = 0;
|
||||
map.length = PAGE_SIZE * 2;
|
||||
map.type = MT_LOW_VECTORS;
|
||||
create_mapping(&map);
|
||||
}
|
||||
|
||||
/* Now create a kernel read-only mapping */
|
||||
map.pfn += 1;
|
||||
map.virtual = 0xffff0000 + PAGE_SIZE;
|
||||
map.length = PAGE_SIZE;
|
||||
map.type = MT_LOW_VECTORS;
|
||||
create_mapping(&map);
|
||||
|
||||
/*
|
||||
* Ask the machine support to map in the statically mapped devices.
|
||||
*/
|
||||
|
Viittaa uudesa ongelmassa
Block a user