mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
evm: calculate HMAC after initializing posix acl on tmpfs
Included in the EVM hmac calculation is the i_mode. Any changes to the i_mode need to be reflected in the hmac. shmem_mknod() currently calls generic_acl_init(), which modifies the i_mode, after calling security_inode_init_security(). This patch reverses the order in which they are called. Change-Id: I1b05e94748a5e59f49afe566b34e2cb79bd3cc5f Reported-by: Sven Vermeulen <sven.vermeulen@siphos.be> Signed-off-by: Mimi Zohar <zohar@us.ibm.com> Acked-by: Hugh Dickins <hughd@google.com>
This commit is contained in:
parent
6304999985
commit
45f6507597
1 changed files with 8 additions and 8 deletions
16
mm/shmem.c
16
mm/shmem.c
|
@ -1939,6 +1939,13 @@ shmem_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t dev)
|
||||||
|
|
||||||
inode = shmem_get_inode(dir->i_sb, dir, mode, dev, VM_NORESERVE);
|
inode = shmem_get_inode(dir->i_sb, dir, mode, dev, VM_NORESERVE);
|
||||||
if (inode) {
|
if (inode) {
|
||||||
|
#ifdef CONFIG_TMPFS_POSIX_ACL
|
||||||
|
error = generic_acl_init(inode, dir);
|
||||||
|
if (error) {
|
||||||
|
iput(inode);
|
||||||
|
return error;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
error = security_inode_init_security(inode, dir,
|
error = security_inode_init_security(inode, dir,
|
||||||
&dentry->d_name,
|
&dentry->d_name,
|
||||||
shmem_initxattrs, NULL);
|
shmem_initxattrs, NULL);
|
||||||
|
@ -1948,15 +1955,8 @@ shmem_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t dev)
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef CONFIG_TMPFS_POSIX_ACL
|
|
||||||
error = generic_acl_init(inode, dir);
|
|
||||||
if (error) {
|
|
||||||
iput(inode);
|
|
||||||
return error;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
error = 0;
|
error = 0;
|
||||||
#endif
|
|
||||||
dir->i_size += BOGO_DIRENT_SIZE;
|
dir->i_size += BOGO_DIRENT_SIZE;
|
||||||
dir->i_ctime = dir->i_mtime = CURRENT_TIME;
|
dir->i_ctime = dir->i_mtime = CURRENT_TIME;
|
||||||
d_instantiate(dentry, inode);
|
d_instantiate(dentry, inode);
|
||||||
|
|
Loading…
Reference in a new issue