-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
lib/vfscore: Fix behavior of writable open on directories #953
Conversation
✅ Checkpatch passed Beep boop! I ran Unikraft's
|
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.
Hi, I've left a comment.
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.
unikraft/lib/vfscore/syscalls.c
Line 197 in ab99b0a
goto out_drele; |
goto out_unlock;
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.
Oh nice, good catch, thanks! Gonna fix asap.
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.
Pushed fix.
Previously the open syscall, when called on a directory with write mode would either fail with EINVAL or, worse, finish successfully, whereas the expected behavior is to return EISDIR. This change corrects this behavior, bringing open() in line with expectations. Signed-off-by: Andrei Tatar <andrei@unikraft.io>
ab99b0a
to
3fc62ef
Compare
That's all from me, thanks. Reviewed-by: Tu Dinh Ngoc dinhngoc.tu@irit.fr |
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.
Approved-by: Razvan Deaconescu razvand@unikraft.io
Description of changes
Previously the open syscall, when called on a directory with write mode would either fail with EINVAL or, worse, finish successfully, whereas the expected behavior is to return EISDIR.
This change corrects this behavior, bringing open() in line with expectations.
Prerequisite checklist
checkpatch.uk
on your commit series before opening this PR;Base target
Additional configuration
Minimal test code; all 4 cases fail with EISDIR on Linux, none should open the dir successfully.