[1/2] criu: threads -- Allow uids/gids being different

Submitted by Cyrill Gorcunov on Sept. 12, 2017, 2:49 p.m.

Details

Message ID 1505227745-22533-2-git-send-email-gorcunov@openvz.org
State New
Series "criu: Allow uids/gids being different"
Headers show

Commit Message

Cyrill Gorcunov Sept. 12, 2017, 2:49 p.m.
We are carrying uids/gids in per-thread way since v1.8,
so no need to require them to match anymore. We still
require seccomp to match though. Need to revisit, seems
may relax this requirement as well.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
---
 criu/seize.c | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

Patch hide | download patch | download mbox

diff --git a/criu/seize.c b/criu/seize.c
index 4abc159c2e9c..0a36b721e55d 100644
--- a/criu/seize.c
+++ b/criu/seize.c
@@ -634,23 +634,14 @@  static inline bool thread_collected(struct pstree_item *i, pid_t tid)
 static bool creds_dumpable(struct proc_status_creds *parent,
 				struct proc_status_creds *child)
 {
-	size_t size;
 	/*
-	 * The comparison rules are the following
-	 *
-	 *  - CAPs can be different
 	 *  - seccomp filters should be passed via
 	 *    semantic comparison (FIXME) but for
 	 *    now we require them to be exactly
 	 *    identical
-	 *  - sigpnd may be different
-	 *  - the rest of members must match
 	 */
-
-	size = offsetof(struct proc_status_creds, cap_inh) -
-	       sizeof(parent->s.sigpnd);
-
-	if (memcmp(&parent->s.sigpnd, &child->s.sigpnd, size)) {
+	if (parent->s.seccomp_mode != child->s.seccomp_mode ||
+	    parent->last_filter != child->last_filter) {
 		if (!pr_quelled(LOG_DEBUG)) {
 			pr_debug("Creds undumpable (parent:child)\n"
 				 "  uids:               %d:%d %d:%d %d:%d %d:%d\n"