Commit 5f13a31e authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

check: return non-zero code if PR_SET_MM_MAP is unsupported

We do the same for other features.

Here is an exception in case of the --ms option.
Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 1cad9b10
...@@ -183,6 +183,12 @@ static int check_prctl(void) ...@@ -183,6 +183,12 @@ static int check_prctl(void)
*/ */
ret = sys_prctl(PR_SET_MM, PR_SET_MM_MAP_SIZE, (unsigned long)&size, 0, 0); ret = sys_prctl(PR_SET_MM, PR_SET_MM_MAP_SIZE, (unsigned long)&size, 0, 0);
if (ret) { if (ret) {
if (!opts.check_ms_kernel) {
pr_msg("prctl: PR_SET_MM_MAP is not supported, which "
"is required for restoring user namespaces\n");
return -1;
} else
pr_warn("Skipping unssuported PR_SET_MM_MAP\n");
ret = sys_prctl(PR_SET_MM, PR_SET_MM_BRK, sys_brk(0), 0, 0); ret = sys_prctl(PR_SET_MM, PR_SET_MM_BRK, sys_brk(0), 0, 0);
if (ret) { if (ret) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment