Skip to contentSkip to conversation

fs: Delete group check before ACL

PATCH New Wang Boshi 1 participant 1 message Nov 10, 2022 VFS

lore
Share & tools
lore

Wang Boshi

author
#0 lore raw

PATCH 1/1 fs: Delete group check before ACL

Skipping full file ACL checks without no Group permissions causes we can't deny access from specific users or groups which we ban according ACL_USER, ACL_GROUP and ACL_MASK rules, because they may pass due to Other permissions.

Example:
date > test_file
setfacl -m u:1000:rwx,g:2000:rwx,u::rwx,g::rwx,o::rwx,m::0 test_file capsh --groups=1000 --gid=1000 --uid=1000 -- -c "cat test_file" capsh --groups=2000 --gid=2000 --uid=2000 -- -c "cat test_file"

---
 fs/namei.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/namei.c +1 -1
index 578c2110df02..d5772a31b5fc 100644
@@ -347,7 +347,7 @@ static int acl_permission_check(struct user_namespace *mnt_userns,
 	}
 
 	/* Do we have ACL's? */
-	if (IS_POSIXACL(inode) && (mode & S_IRWXG)) {
+	if (IS_POSIXACL(inode)) {
 		int error = check_acl(mnt_userns, inode, mask);
 		if (error != -EAGAIN)
 			return error;
Signature · 1 line
2.29.2