[Devel] [PATCH RHEL7 COMMIT] ve/ptrace: don't change the upstream logic which affects criu

Konstantin Khorenko khorenko at virtuozzo.com
Mon Dec 28 05:13:07 PST 2015


The commit is pushed to "branch-rh7-3.10.0-229.7.2.vz7.9.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-229.7.2.vz7.9.18
------>
commit 17c71ec0b2e177931b2258b50b96f7042452e106
Author: Andrew Vagin <avagin at openvz.org>
Date:   Mon Dec 28 17:13:06 2015 +0400

    ve/ptrace: don't change the upstream logic which affects criu
    
    We changed logic of getting registers via ptrace to get PID from
    the current namespace for clone, fork and vfork system calls.
    It was done in rhel5 and then this patch was backported into rhel6
    and rhel7.
    https://jira.sw.ru/browse/PCLIN-27522
    
    It was done to be able to trace container's processes via strace.
    Now strace works without this patch, so we can drop it.
    
    https://jira.sw.ru/browse/PSBM-42216
    
    Signed-off-by: Andrew Vagin <avagin at openvz.org>
    Acked-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 arch/x86/kernel/ptrace.c | 22 ----------------------
 1 file changed, 22 deletions(-)

diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c
index 1c551af..b7cc6a0 100644
--- a/arch/x86/kernel/ptrace.c
+++ b/arch/x86/kernel/ptrace.c
@@ -37,7 +37,6 @@
 #include <asm/proto.h>
 #include <asm/hw_breakpoint.h>
 #include <asm/traps.h>
-#include <asm/unistd.h>
 
 #include "tls.h"
 
@@ -504,27 +503,6 @@ static unsigned long getreg(struct task_struct *task, unsigned long offset)
 		return get_desc_base(&task->thread.tls_array[GS_TLS]);
 	}
 #endif
-#ifdef CONFIG_VE
-	case offsetof(struct user_regs_struct, ax): {
-		struct pt_regs *regs;
-		unsigned long ret;
-
-		regs = task_pt_regs(task);
-		ret = *pt_regs_access(regs, offset);
-
-		if ((regs->orig_ax == __NR_vfork) ||
-		    (regs->orig_ax == __NR_clone) ||
-		    (regs->orig_ax == __NR_fork)) {
-			rcu_read_lock();
-			/* get tracee pid in tracer's pid-namespace */
-			if (task->nsproxy->pid_ns != current->nsproxy->pid_ns)
-				ret = pid_vnr(find_pid_ns(ret,
-						task->nsproxy->pid_ns));
-			rcu_read_unlock();
-		}
-		return ret;
-	}
-#endif
 	}
 
 	return *pt_regs_access(task_pt_regs(task), offset);


More information about the Devel mailing list