Skip to content

Commit e7a4178

Browse files
committed
kerndat: Skip clone3(set_tid) when unprivileged.
clone3(set_tid) requires CAP_CHECKPOINT_RESTORE we might not have. Assume that if it errored out with EPERM it's there and might be usable from inside a user namespace. Signed-off-by: Michał Mirosław <[email protected]>
1 parent 42c1c84 commit e7a4178

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

criu/kerndat.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1400,12 +1400,13 @@ static bool kerndat_has_clone3_set_tid(void)
14001400
pid_t pid;
14011401
struct _clone_args args = {};
14021402

1403+
kdat.has_clone3_set_tid = false;
1404+
14031405
#if defined(CONFIG_MIPS)
14041406
/*
14051407
* Currently the CRIU PIE assembler clone3() wrapper is
14061408
* not implemented for MIPS.
14071409
*/
1408-
kdat.has_clone3_set_tid = false;
14091410
return 0;
14101411
#endif
14111412

@@ -1427,7 +1428,7 @@ static bool kerndat_has_clone3_set_tid(void)
14271428
if (errno == ENOSYS || errno == E2BIG)
14281429
return 0;
14291430

1430-
if (errno != EINVAL) {
1431+
if (errno != EINVAL && errno != EPERM) {
14311432
pr_pwarn("Unexpected error from clone3");
14321433
return 0;
14331434
}

0 commit comments

Comments
 (0)