2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-09-05 00:35:23 +00:00

kerndat: Handle non-root mode when checking uffd

When criu is run as user it fails and exits because of kerndat_uffd() returning -1.
This, in turn, happens after uffd = syscall(SYS_userfaultfd, flags); which only works
for root.

In the change it ignores the permission error and proceeds further just like it's done
for e.g. pagemap checking.

Signed-off-by: Nithin Jaikar J <jaikar006@gmail.com>
This commit is contained in:
nithin-jaikar
2021-05-21 23:52:06 +05:30
committed by Andrei Vagin
parent 2402192b54
commit cfdeac4a4d

View File

@@ -919,7 +919,10 @@ static int kerndat_uffd(void)
if (uffd < 0) {
if (uffd == -ENOSYS)
return 0;
if (uffd == -EPERM) {
pr_info("Lazy pages are disabled\n");
return 0;
}
pr_err("Lazy pages are not available\n");
return -1;
}