-
Notifications
You must be signed in to change notification settings - Fork 54.3k
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
Richacl #109
Richacl #109
Commits on Oct 23, 2011
-
vfs: Indicate that the permission functions take all the MAY_* flags
Acked-by: J. Bruce Fields <[email protected]> Acked-by: David Howells <[email protected]> Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Aneesh Kumar K.V <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for d5d1fb4 - Browse repository at this point
Copy the full SHA d5d1fb4View commit details -
vfs: Add hex format for MAY_* flag values
We are going to add more flags and having them in hex format make it simpler Acked-by: J. Bruce Fields <[email protected]> Acked-by: David Howells <[email protected]> Signed-off-by: Aneesh Kumar K.V <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 0f69c40 - Browse repository at this point
Copy the full SHA 0f69c40View commit details -
vfs: Pass all mask flags down to iop->check_acl
Some file permission models differentiate between writing to a file (MAY_WRITE) and appending to it (MAY_WRITE | MAY_APPEND). Pass all the mask flags down to iop->check_acl so that filesystems can distinguish between writing and appending. All users of iop->check_acl pass the mask value back into posix_acl_permission(); strip off the additional mask flags there. Acked-by: J. Bruce Fields <[email protected]> Acked-by: David Howells <[email protected]> Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Aneesh Kumar K.V <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for bf56180 - Browse repository at this point
Copy the full SHA bf56180View commit details -
vfs: Add a comment to inode_permission()
Acked-by: J. Bruce Fields <[email protected]> Acked-by: David Howells <[email protected]> Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Aneesh Kumar K.V <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 518cbba - Browse repository at this point
Copy the full SHA 518cbbaView commit details -
vfs: Add generic IS_ACL() test for acl support
When IS_POSIXACL() is true, the vfs does not apply the umask. Other acl models will need the same exception, so introduce a separate IS_ACL() test. The IS_POSIX_ACL() test is still needed so that nfsd can determine when the underlying file system supports POSIX ACLs (as opposed to some other kind). Acked-by: J. Bruce Fields <[email protected]> Acked-by: David Howells <[email protected]> Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Aneesh Kumar K.V <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 89e1033 - Browse repository at this point
Copy the full SHA 89e1033View commit details -
vfs: Add IS_RICHACL() test for richacl support
Introduce a new MS_RICHACL super-block flag and a new IS_RICHACL() test which file systems like nfs can use. IS_ACL() is true if IS_POSIXACL() or IS_RICHACL() is true. Acked-by: J. Bruce Fields <[email protected]> Acked-by: David Howells <[email protected]> Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Aneesh Kumar K.V <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 45481f1 - Browse repository at this point
Copy the full SHA 45481f1View commit details -
vfs: Optimize out IS_RICHACL() if CONFIG_FS_RICHACL is not defined
if CONFIG_FS_RICHACL is not defined optimize out the ACL check function. Acked-by: J. Bruce Fields <[email protected]> Acked-by: David Howells <[email protected]> Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Aneesh Kumar K.V <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for c684918 - Browse repository at this point
Copy the full SHA c684918View commit details -
vfs: Add new file and directory create permission flags
Some permission models distinguish between the permission to create a non-directory and a directory. Pass this information down to inode_permission() as mask flags Acked-by: J. Bruce Fields <[email protected]> Acked-by: David Howells <[email protected]> Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Aneesh Kumar K.V <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 004723e - Browse repository at this point
Copy the full SHA 004723eView commit details -
vfs: Add delete child and delete self permission flags
Normally, deleting a file requires write access to the parent directory. Some permission models use a different permission on the parent directory to indicate delete access. In addition, a process can have per-file delete access even without delete access on the parent directory. Introduce two new inode_permission() mask flags and use them in may_delete() Acked-by: J. Bruce Fields <[email protected]> Acked-by: David Howells <[email protected]> Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Aneesh Kumar K.V <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 1654a09 - Browse repository at this point
Copy the full SHA 1654a09View commit details -
vfs: Make the inode passed to inode_change_ok non-const
We will need to call iop->permission and iop->get_acl from inode_change_ok() for additional permission checks, and both take a non-const inode. Acked-by: J. Bruce Fields <[email protected]> Acked-by: David Howells <[email protected]> Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Aneesh Kumar K.V <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 3437a82 - Browse repository at this point
Copy the full SHA 3437a82View commit details -
vfs: Add permission flags for setting file attributes
Some permission models can allow processes to take ownership of a file, change the file permissions, and set the file timestamps. Introduce new permission mask flags and check for those permissions in inode_change_ok(). Acked-by: J. Bruce Fields <[email protected]> Acked-by: David Howells <[email protected]> Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Aneesh Kumar K.V <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for e963a4c - Browse repository at this point
Copy the full SHA e963a4cView commit details -
vfs: Make acl_permission_check() work for richacls
Acked-by: J. Bruce Fields <[email protected]> Acked-by: David Howells <[email protected]> Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Aneesh Kumar K.V <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 26dc449 - Browse repository at this point
Copy the full SHA 26dc449View commit details -
richacl: In-memory representation and helper functions
A richacl consists of an NFSv4 acl and an owner, group, and other mask. These three masks correspond to the owner, group, and other file permission bits, but they contain NFSv4 permissions instead of POSIX permissions. Each entry in the NFSv4 acl applies to the file owner (OWNER@), the owning group (GROUP@), literally everyone (EVERYONE@), or to a specific uid or gid. As in the standard POSIX file permission model, each process is the owner, group, or other file class. A richacl grants a requested access only if the NFSv4 acl in the richacl grants the access (according to the NFSv4 permission check algorithm), and the file mask that applies to the process includes the requested permissions. Acked-by: J. Bruce Fields <[email protected]> Acked-by: David Howells <[email protected]> Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Aneesh Kumar K.V <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for e210ab8 - Browse repository at this point
Copy the full SHA e210ab8View commit details -
richacl: Permission mapping functions
We need to map from POSIX permissions to NFSv4 permissions when a chmod() is done, from NFSv4 permissions to POSIX permissions when an acl is set (which implicitly sets the file permission bits), and from the MAY_READ/MAY_WRITE/MAY_EXEC/MAY_APPEND flags to NFSv4 permissions when doing an access check in a richacl. Acked-by: J. Bruce Fields <[email protected]> Acked-by: David Howells <[email protected]> Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Aneesh Kumar K.V <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 36ee026 - Browse repository at this point
Copy the full SHA 36ee026View commit details -
richacl: Compute maximum file masks from an acl
Compute upper bound owner, group, and other file masks with as few permissions as possible without denying any permissions that the NFSv4 acl in a richacl grants. This algorithm is used when a file inherits an acl at create time and when an acl is set via a mechanism that does not specify file modes (such as via nfsd). When user-space sets an acl, the file masks are passed in as part of the xattr. When setting a richacl, the file masks determine what the file permission bits will be set to; see richacl_masks_to_mode(). Acked-by: J. Bruce Fields <[email protected]> Acked-by: David Howells <[email protected]> Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Aneesh Kumar K.V <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for dc240c0 - Browse repository at this point
Copy the full SHA dc240c0View commit details -
richacl: Update the file masks in chmod()
Doing a chmod() sets the file mode, which includes the file permission bits. When a file has a richacl, the permissions that the richacl grants need to be limited to what the new file permission bits allow. This is done by setting the file masks in the richacl to what the file permission bits map to. The richacl access check algorithm takes the file masks into account, which ensures that the richacl cannot grant too many permissions. It is possible to explicitly add permissions to the file masks which go beyond what the file permission bits can grant (like the ACE4_WRITE_ACL permission). The POSIX.1 standard calls this an alternate file access control mechanism. A subsequent chmod() would ensure that those permissions are disabled again. Acked-by: J. Bruce Fields <[email protected]> Acked-by: David Howells <[email protected]> Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Aneesh Kumar K.V <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 6be646b - Browse repository at this point
Copy the full SHA 6be646bView commit details -
richacl: Permission check algorithm
As in the standard POSIX file permission model, each process is the owner, group, or other file class. A process is - in the owner file class if it owns the file, - in the group file class if it is in the file's owning group or it matches any of the user or group entries, and - in the other file class otherwise. Each file class is associated with a file mask. A richacl grants a requested access if the NFSv4 acl in the richacl grants the requested permissions (according to the NFSv4 permission check algorithm) and the file mask that applies to the process includes the requested permissions. Acked-by: J. Bruce Fields <[email protected]> Acked-by: David Howells <[email protected]> Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Aneesh Kumar K.V <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 61bf134 - Browse repository at this point
Copy the full SHA 61bf134View commit details -
richacl: Create-time inheritance
When a new file is created, it can inherit an acl from its parent directory; this is similar to how default acls work in POSIX (draft) ACLs. As with POSIX ACLs, if a file inherits an acl from its parent directory, the intersection between the create mode and the permissions granted by the inherited acl determines the file masks and file permission bits, and the umask is ignored. Acked-by: J. Bruce Fields <[email protected]> Acked-by: David Howells <[email protected]> Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Aneesh Kumar K.V <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 9d9bef3 - Browse repository at this point
Copy the full SHA 9d9bef3View commit details -
richacl: Check if an acl is equivalent to a file mode
This function is used to avoid storing richacls on disk if the acl can be computed from the file permission bits. Acked-by: J. Bruce Fields <[email protected]> Acked-by: David Howells <[email protected]> Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Aneesh Kumar K.V <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 8013f16 - Browse repository at this point
Copy the full SHA 8013f16View commit details -
richacl: Automatic Inheritance
Automatic Inheritance (AI) allows changes to the acl of a directory to recursively propagate down to files and directories in the directory. To implement this, the kernel keeps track of which permissions have been inherited, and makes sure that permission propagation is turned off when the file permission bits of a file are changed (upon create or chmod). The actual permission propagation is implemented in user space. AI works as follows: - When the ACL4_AUTO_INHERIT flag in the acl of a file is cleared, the file is not affected by AI. - When the ACL4_AUTO_INHERIT flag in the acl of a directory is set and a file or subdirectory is created in that directory, files created in the directory will have the ACL4_AUTO_INHERIT flag set, and all inherited aces will have the ACE4_INHERITED_ACE flag set. This allows user space to distinguish between aces which have been inherited, and aces which have been explicitly added. - When the ACL4_PROTECTED acl flag in the acl of a file is set, AI will not modify the acl of the file. This does not affect propagation of permissions from the file to its children (if the file is a directory). Linux does not have a way of creating files without setting the file permission bits, so all files created inside a directory with ACL4_AUTO_INHERIT set will also have the ACL4_PROTECTED flag set. This effectively disables AI. Protocols which support creating files without specifying permissions can explicitly clear the ACL4_PROTECTED flag after creating a file (and reset the file masks to "undo" applying the create mode; see richacl_compute_max_masks()). This is a workaround; a per-create or per-process flag indicating to ignore the create mode when AI is in effect would fix this problem. Acked-by: J. Bruce Fields <[email protected]> Acked-by: David Howells <[email protected]> Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Aneesh Kumar K.V <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 5882a81 - Browse repository at this point
Copy the full SHA 5882a81View commit details -
richacl: xattr mapping functions
Map between "system.richacl" xattrs and the in-kernel representation. Acked-by: J. Bruce Fields <[email protected]> Acked-by: David Howells <[email protected]> Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Aneesh Kumar K.V <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 862d861 - Browse repository at this point
Copy the full SHA 862d861View commit details -
vfs: Cache richacl in struct inode
Cache richacls in struct inode so that this doesn't have to be done individually in each filesystem. Acked-by: J. Bruce Fields <[email protected]> Acked-by: David Howells <[email protected]> Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Aneesh Kumar K.V <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 69d9df5 - Browse repository at this point
Copy the full SHA 69d9df5View commit details -
vfs: Add richacl permission check
Acked-by: J. Bruce Fields <[email protected]> Acked-by: David Howells <[email protected]> Signed-off-by: Aneesh Kumar K.V <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for e86e410 - Browse repository at this point
Copy the full SHA e86e410View commit details -
ext4: Use IS_POSIXACL() to check for POSIX ACL support
Use IS_POSIXACL() instead of a file system specific mount flag since we have IS_POSIXACL() in the vfs already, anyway. Acked-by: J. Bruce Fields <[email protected]> Acked-by: David Howells <[email protected]> Signed-off-by: Aneesh Kumar K.V <[email protected]> Signed-off-by: Andreas Gruenbacher <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 434e398 - Browse repository at this point
Copy the full SHA 434e398View commit details -
ext4: Implement rich acl for ext4
Support the richacl permission model in ext4. The richacls are stored in "system.richacl" xattrs.This need to be enabled by tune2fs or during mkfs.ext4 Acked-by: J. Bruce Fields <[email protected]> Acked-by: David Howells <[email protected]> Signed-off-by: Aneesh Kumar K.V <[email protected]> Signed-off-by: Andreas Gruenbacher <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 69b47fd - Browse repository at this point
Copy the full SHA 69b47fdView commit details -
ext4: Add Ext4 compat richacl feature flag
This feature flag can be used to enable richacl on the file system. Once enabled the "acl" mount option will enable richacl instead of posix acl Acked-by: J. Bruce Fields <[email protected]> Acked-by: David Howells <[email protected]> Signed-off-by: Aneesh Kumar K.V <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for e17ad31 - Browse repository at this point
Copy the full SHA e17ad31View commit details
Commits on Feb 12, 2012
-
ext4: Add temporary richacl mount option for ext4
This helps in easy testing of the patchset. The mount option will be later removed in favour of a feature flag. ***Should be folded before merging*** Signed-off-by: Aneesh Kumar K.V <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 13fc237 - Browse repository at this point
Copy the full SHA 13fc237View commit details