[1/5] seize: Fix size error in creds_dumpable()

Submitted by Kirill Tkhai on April 15, 2017, 5:15 p.m.

Details

Message ID 149227653434.1524.13627911389230683586.stgit@localhost.localdomain
State New
Series "compel, criu: Make struct seize_task_status extensible"
Headers show

Commit Message

Kirill Tkhai April 15, 2017, 5:15 p.m.
The goal of this function is to compare everything except caps,
but caps size is took to compare. It's wrong, there must be
used offsetof(struct proc_status_creds, cap_inh) instead.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 criu/seize.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/criu/seize.c b/criu/seize.c
index d5079ca6c..eda4e8a27 100644
--- a/criu/seize.c
+++ b/criu/seize.c
@@ -629,8 +629,7 @@  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)
 {
-	const size_t size = sizeof(struct proc_status_creds) -
-			offsetof(struct proc_status_creds, cap_inh);
+	const size_t size = offsetof(struct proc_status_creds, cap_inh);
 
 	/*
 	 * The comparison rules are the following