From: Dan Smith Subject: [PATCH] Remove READ_IMPLIES_EXEC during restart Date: Mon, 6 Apr 2009 13:41:34 -0400 Message-ID: <1239039694-22332-1-git-send-email-danms@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org List-Id: containers.vger.kernel.org On s390, all tasks have READ_IMPLIES_EXEC set in current->personality, which causes the restart process to map things like the stack and heap as executable. During the restart process, remove this bit and restore the original personality afterwards. This seems a little ugly, but I don't know that there's a better place for it. Cc: orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org Signed-off-by: Dan Smith --- checkpoint/restart.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/checkpoint/restart.c b/checkpoint/restart.c index adebc1c..8958ec7 100644 --- a/checkpoint/restart.c +++ b/checkpoint/restart.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include @@ -535,12 +536,18 @@ static int do_restart_root(struct cr_ctx *ctx, pid_t pid) int do_restart(struct cr_ctx *ctx, pid_t pid) { int ret; + unsigned int original_personality; + + original_personality = current->personality; + current->personality &= ~READ_IMPLIES_EXEC; if (ctx) ret = do_restart_root(ctx, pid); else ret = do_restart_task(pid); + current->personality = original_personality; + /* on success, adjust the return value if needed [TODO] */ return ret; } -- 1.6.1