Skip to content

Commit

Permalink
kerndat: Handle non-root mode when checking uffd
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
nithin-jaikar authored and avagin committed May 30, 2021
1 parent 2402192 commit cfdeac4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion criu/kerndat.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit cfdeac4

Please sign in to comment.