Commit c84fa8c5 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

pie: x86 -- Adjust size of parasite and restorer code

In case of @gotpcrel relocations we need additional
space to carry pointers.
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent fba12ae9
......@@ -2364,7 +2364,11 @@ static int prepare_restorer_blob(void)
* in turn will lead to set-exe-file prctl to fail with EBUSY.
*/
#if defined(CONFIG_X86_32) || defined(CONFIG_X86_64)
restorer_len = round_up(sizeof(restorer_blob) + nr_gotpcrel * sizeof(long), PAGE_SIZE);
#else
restorer_len = round_up(sizeof(restorer_blob), PAGE_SIZE);
#endif
restorer = mmap(NULL, restorer_len,
PROT_READ | PROT_WRITE | PROT_EXEC,
MAP_PRIVATE | MAP_ANON, 0, 0);
......
......@@ -38,7 +38,11 @@
#include "asm/dump.h"
#include "asm/restorer.h"
#define parasite_size (round_up(sizeof(parasite_blob), PAGE_SIZE))
#if defined(CONFIG_X86_32) || defined(CONFIG_X86_64)
# define parasite_size (round_up(sizeof(parasite_blob) + nr_gotpcrel * sizeof(long), PAGE_SIZE))
#else
# define parasite_size (round_up(sizeof(parasite_blob), PAGE_SIZE))
#endif
static int can_run_syscall(unsigned long ip, unsigned long start, unsigned long end)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment