restore: add a synchronisation point after restoring credentials

For security reason processes can be resumed only when all
credentials are restored. Otherwise someone can attach to a
process, which are not restored credentials yet and execute
some code.

https://bugzilla.openvz.org/show_bug.cgi?id=2561

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Andrey Vagin 2013-04-19 15:58:50 +04:00 committed by Pavel Emelyanov
parent 1abb8782a8
commit a34057c192
3 changed files with 25 additions and 6 deletions

View file

@ -164,6 +164,13 @@ enum {
CR_STATE_RESTORE_PGID,
CR_STATE_RESTORE,
CR_STATE_RESTORE_SIGCHLD,
/*
* For security reason processes can be resumed only when all
* credentials are restored. Otherwise someone can attach to a
* process, which are not restored credentials yet and execute
* some code.
*/
CR_STATE_RESTORE_CREDS,
CR_STATE_COMPLETE
};