[LU-4703] setxattr(2) will succeed by a non root user, against a file the user doesn't own. Created: 04/Mar/14 Updated: 12/Mar/14 Resolved: 12/Mar/14 |
|
| Status: | Resolved |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | Lustre 2.5.0, Lustre 2.6.0, Lustre 2.4.2 |
| Fix Version/s: | Lustre 2.6.0, Lustre 2.5.1, Lustre 2.4.3 |
| Type: | Bug | Priority: | Blocker |
| Reporter: | Li Dongyang (Inactive) | Assignee: | Nathaniel Clark |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | patch | ||
| Environment: |
CentOS 6.4 |
||
| Issue Links: |
|
||||||||||||||||
| Severity: | 3 | ||||||||||||||||
| Rank (Obsolete): | 12938 | ||||||||||||||||
| Description |
|
[root@localhost ~]# mount -t lustre 192.168.122.225@tcp:/testfs /mnt/
[dyl900@localhost mnt]$ setfacl -m u:dyl900:rwx ./mxa900
On our production system, this allows a user access other users' files... |
| Comments |
| Comment by Li Dongyang (Inactive) [ 04/Mar/14 ] |
|
for master: http://review.whamcloud.com/#/c/9469/ (This is the one for mdd_xattr_set().) |
| Comment by John Hammond [ 05/Mar/14 ] |
|
Looking at this, I think mdd_xattr_sanity_check() could be improved somewhat. Currently it looks like: static int mdd_xattr_sanity_check(const struct lu_env *env,
struct mdd_object *obj,
const struct lu_attr *attr)
{
struct lu_ucred *uc = lu_ucred_assert(env);
ENTRY;
if (mdd_is_immutable(obj) || mdd_is_append(obj))
RETURN(-EPERM);
if ((uc->uc_fsuid != attr->la_uid) && !md_capable(uc, CFS_CAP_FOWNER))
RETURN(-EPERM);
RETURN(0);
}
|
| Comment by Andreas Dilger [ 05/Mar/14 ] |
|
Patch from |
| Comment by Andreas Dilger [ 05/Mar/14 ] |
|
I just verified that this bug does not exist in any release earlier than 2.4.0. It was added in commit 7b3bfb09, which moved the ACL handling out of the OSD and into the MDD so that ZFS does not have to handle ACL checking itself. |
| Comment by Bob Glossman (Inactive) [ 05/Mar/14 ] |
|
for b2_5: http://review.whamcloud.com/9513 |
| Comment by Nathaniel Clark [ 06/Mar/14 ] |
|
Test for issue http://review.whamcloud.com/9508 |
| Comment by Bob Glossman (Inactive) [ 07/Mar/14 ] |
|
for b2_4: http://review.whamcloud.com/9558 |
| Comment by Andreas Dilger [ 08/Mar/14 ] |
|
Note that it should be possible to disable ACL support on ldiskfs MDSes either temporarily or permanently to provide a short-term workaround for this bug. There is no mechanism to disable ACL support on ZFS filesystems at this time. The MDS can be mounted with the "-o noacl" option to disable ACL support temporarily, or by unmounting the MDS, running "tune2fs -o ^acl /dev/<mdsdev>" to turn off ACL support in the ldiskfs superblock, and then mount the MDS again. Disabling the ACL can be verified on the client by checking "lctl get_param mdc.*.import | grep connect_flags" and checking whether the "acl" feature is listed (it will normally be second). |
| Comment by Nathaniel Clark [ 12/Mar/14 ] |
|
sanity/102p for b2_5 http://review.whamcloud.com/9604 |
| Comment by Peter Jones [ 12/Mar/14 ] |
|
Landed for 2.4.3, 2.5.1 and 2.6 |