mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
SELinux: do not check open perms if they are not known to policy
When I introduced open perms policy didn't understand them and I implemented them as a policycap. When I added the checking of open perm to truncate I forgot to conditionalize it on the userspace defined policy capability. Running an old policy with a new kernel will not check open on open(2) but will check it on truncate. Conditionalize the truncate check the same as the open check. Signed-off-by: Eric Paris <[email protected]> Cc: [email protected] # 3.4.x Signed-off-by: James Morris <[email protected]>
This commit is contained in:
parent
64919e6091
commit
3d2195c332
1 changed files with 1 additions and 1 deletions
|
|
@ -2717,7 +2717,7 @@ static int selinux_inode_setattr(struct dentry *dentry, struct iattr *iattr)
|
|||
ATTR_ATIME_SET | ATTR_MTIME_SET | ATTR_TIMES_SET))
|
||||
return dentry_has_perm(cred, dentry, FILE__SETATTR);
|
||||
|
||||
if (ia_valid & ATTR_SIZE)
|
||||
if (selinux_policycap_openperm && (ia_valid & ATTR_SIZE))
|
||||
av |= FILE__OPEN;
|
||||
|
||||
return dentry_has_perm(cred, dentry, av);
|
||||
|
|
|
|||
Loading…
Reference in a new issue