Alluxio / alluxio

Alluxio, data orchestration for analytics and machine learning in the cloud
https://www.alluxio.io
Apache License 2.0
6.81k stars 2.94k forks source link

FS operation permission checks are not fully POSIX compliant #15187

Open jiacheliu3 opened 2 years ago

jiacheliu3 commented 2 years ago

Alluxio Version: 2.8.0-SNAPSHOT (as of 2022/3)

Describe the bug Some operations are not POSIX compliant in terms of permission checking.

For example, rm is only checking the WRITE perm on the parent dir. https://github.com/Alluxio/alluxio/blob/5c2619a67c840a82ecaee38ff2d3666b9277cd70/core/server/master/src/main/java/alluxio/master/file/DefaultFileSystemMaster.java#L1845 According to ref, we will need at least WRITE_EXECUTE on the parent dir.

Similarly for umount, the same WRITE perm is checked but because umount is internally doing rm -R on the mount point dir, we should nee the same (if not stricter) perm check on the mount point.

To Reproduce Steps to reproduce the behavior (as minimally and precisely as possible)

Expected behavior A clear and concise description of what you expected to happen.

Urgency Describe the impact and urgency of the bug.

Are you planning to fix it Please indicate if you are already working on a PR.

Additional context Add any other context about the problem here.

jiacheliu3 commented 2 years ago

@bobbai00 did a cross comparison of the permission check behavior comparison between Alluxio, HDFS and vanilla Linux.

Screen Shot 2022-03-25 at 9 47 46 AM

Permission Check Comparison Alluxio vs. Linux vs. HDFS.xlsx

The comparison is on the permission requirement of rm -R. @madanadit @yuzhu @ggezer @apc999 @tcrain

The most significant difference is that Alluxio checks file permissions, while HDFS/Linux checks dir permissions only. If we do the same there can be a performance improvement.

I think the behavior of Alluxio is forced to be consistent with the UFS in many cases, because users may call certain operations on UFS through Alluxio and expect that to be the same as directly on UFS.

yuzhu commented 2 years ago

I am curious who owns the directory? in each of these cases, is the operator the owner or not the owner?

bobbai00 commented 2 years ago

Hi David, in each case(Linux, Alluxio, and HDFS), the owner of the “test” directory, its subdirectories and files is the user who creates these folders and files, not the user who tries to delete “test”. And when I needs to try different permission compositions, I switch to the owner(who is also a “sudoer”) and uses command “setfacl” to change another user’s permissions.

David Zhu @.***>于2022年3月29日 周二下午1:30写道:

I am curious who owns the directory? in each of these cases, is the operator the owner or not the owner?

— Reply to this email directly, view it on GitHub https://github.com/Alluxio/alluxio/issues/15187#issuecomment-1081420832, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKKWDEEPNJMBNY7CWAWTOWTVCKIQ5ANCNFSM5RJRAJBA . You are receiving this because you were mentioned.Message ID: @.***>

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in two weeks if no further activity occurs. Thank you for your contributions.