-
Notifications
You must be signed in to change notification settings - Fork 615
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
uffd: fixed for exiting exiting program as user #1483
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nithin-jaikar rework the PR, leave only the EPERM checking of uffd opening and write a proper patch comment.
@nithin-jaikar , don't add 5th commit, please. Remove all commits and leave only one. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The patch (not PR, but the very commit) must have a descriptive comment
@nithin-jaikar , you've somehow pulled in the Adrian's patch, then merged yours with his and then added the fix I requested as another commit. Please, be more attentive and make a proper PR. |
Ok, @nithin-jaikar , now let's add the comment to the commit (the text that accompanies the pull-request can be just copied) |
From the PR description it is not clear to me what this tries to solve. Some more details how this could happen would be interesting. |
@adrianreber , this is the part of "dump shared memory as user" task. The "criu dump" used to work from non-root some time ago, but then this mode testing stopped and the functionality got broken. On of the found problems is that non-root is not allowed to open uffd, so criu cannot even check the kerndat stuff. |
Ah, thanks. I saw similar errors when doing the non-root changes in #1155 Anyway, that information would be good to have in the commit and/or PR. |
Whee, comment commit message is mastered!
|
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]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#define EPERM 1
Should not we differentiate errno == EPERM from syscall SYS_userfaultfd and later errors in uffd_open() ?
I still think that my objection is valid, so #1493 |
While Dumping the process, it fails and exits as a user because of kerndat_uffd() returns -1 and due permission error
uffd = syscall(SYS_userfaultfd, flags); this function fails inturn kerndat_uffd() fails.
In the change it ignores the permission error and proceeds further.