-
Notifications
You must be signed in to change notification settings - Fork 201
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
[LibOS] fs/encrypted: Fix crash on dropping a directory handle #564
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.
Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions, not enough approvals from maintainers (2 more required), not enough approvals from different teams (1 more required, approved so far: ITL) (waiting on @pwmarcz)
a discussion (no related file):
Please check Jenkins. It failed.
-- commits
line 4 at r1:
a that
-> that a
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.
Reviewable status: 0 of 1 files reviewed, 2 unresolved discussions, not enough approvals from maintainers (2 more required), not enough approvals from different teams (1 more required, approved so far: ITL), "squash! " found in commit messages' one-liners (waiting on @dimakuv)
a discussion (no related file):
Previously, dimakuv (Dmitrii Kuvaiskii) wrote…
Please check Jenkins. It failed.
Yeah, I made a last minute change and it failed to compile... Fixed, hopefully.
Previously, dimakuv (Dmitrii Kuvaiskii) wrote…
a that
->that a
I added a squash commit.
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.
Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: all files reviewed, all discussions resolved, not enough approvals from maintainers (1 more required), "squash! " found in commit messages' one-liners
LibOS/shim/src/fs/chroot/encrypted.c
line 390 at r1 (raw file):
assert(hdl->type == TYPE_CHROOT_ENCRYPTED); if (hdl->inode->type != S_IFREG) return 0;
Lol :)
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.
Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: all files reviewed, all discussions resolved, "squash! " found in commit messages' one-liners
LibOS/shim/src/fs/chroot/encrypted.c
line 389 at r2 (raw file):
static void chroot_encrypted_hdrop(struct shim_handle* hdl) { assert(hdl->type == TYPE_CHROOT_ENCRYPTED); if (hdl->inode->type != S_IFREG)
Don't we want to add an assert here, similar to other places? not blocking
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.
Reviewable status: all files reviewed, all discussions resolved, "squash! " found in commit messages' one-liners
LibOS/shim/src/fs/chroot/encrypted.c
line 389 at r2 (raw file):
Previously, boryspoplawski (Borys Popławski) wrote…
Don't we want to add an assert here, similar to other places? not blocking
I added the assertion in the other places because they return -EISDIR. In flush
and hdrop
, I think we don't care.
The `hdrop` callback incorrectly assumed that a handle pointed to a regular file. This commit also removes this assumption from other callbacks: while in most cases they should not be called for a directory handle, this is not yet a part of a documented contract. Signed-off-by: Paweł Marczewski <[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.
Reviewed all commit messages.
Reviewable status: all files reviewed, all discussions resolved, not enough approvals from maintainers (1 more required)
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.
Reviewed all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved
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.
Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved
Description of the changes
The
hdrop
callback incorrectly assumed a that handle pointed to a regular file.This commit also removes this assumption from other callbacks: while in most cases they should not be called for a directory handle, this is not yet a part of a documented contract.
Bug reported in #371 (comment).
How to test this PR?
busybox
as specified in RFC: protected files redesign #371 (comment)/tmp/testdir
on hostgramine-direct busybox ls /tmp/testdir
This crashes on master, and is fixed in this PR.
This change is