mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
SELinux: Improve read/write performance
It reduces the selinux overhead on read/write by only revalidating permissions in selinux_file_permission if the task or inode labels have changed or the policy has changed since the open-time check. A new LSM hook, security_dentry_open, is added to capture the necessary state at open time to allow this optimization. (see http://marc.info/?l=selinux&m=118972995207740&w=2) Signed-off-by: Yuichi Nakamura<[email protected]> Acked-by: Stephen Smalley <[email protected]> Signed-off-by: James Morris <[email protected]>
This commit is contained in:
parent
3232c110b5
commit
788e7dd4c2
7 changed files with 89 additions and 1 deletions
|
|
@ -757,6 +757,10 @@ static struct file *__dentry_open(struct dentry *dentry, struct vfsmount *mnt,
|
|||
f->f_op = fops_get(inode->i_fop);
|
||||
file_move(f, &inode->i_sb->s_files);
|
||||
|
||||
error = security_dentry_open(f);
|
||||
if (error)
|
||||
goto cleanup_all;
|
||||
|
||||
if (!open && f->f_op)
|
||||
open = f->f_op->open;
|
||||
if (open) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue