|
@@ -1608,6 +1608,15 @@ shmem_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t dev)
|
|
int error = -ENOSPC;
|
|
int error = -ENOSPC;
|
|
|
|
|
|
if (inode) {
|
|
if (inode) {
|
|
|
|
+ error = security_inode_init_security(inode, dir, NULL, NULL,
|
|
|
|
+ NULL);
|
|
|
|
+ if (error) {
|
|
|
|
+ if (error != -EOPNOTSUPP) {
|
|
|
|
+ iput(inode);
|
|
|
|
+ return error;
|
|
|
|
+ }
|
|
|
|
+ error = 0;
|
|
|
|
+ }
|
|
if (dir->i_mode & S_ISGID) {
|
|
if (dir->i_mode & S_ISGID) {
|
|
inode->i_gid = dir->i_gid;
|
|
inode->i_gid = dir->i_gid;
|
|
if (S_ISDIR(mode))
|
|
if (S_ISDIR(mode))
|
|
@@ -1617,7 +1626,6 @@ shmem_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t dev)
|
|
dir->i_ctime = dir->i_mtime = CURRENT_TIME;
|
|
dir->i_ctime = dir->i_mtime = CURRENT_TIME;
|
|
d_instantiate(dentry, inode);
|
|
d_instantiate(dentry, inode);
|
|
dget(dentry); /* Extra count - pin the dentry in core */
|
|
dget(dentry); /* Extra count - pin the dentry in core */
|
|
- error = 0;
|
|
|
|
}
|
|
}
|
|
return error;
|
|
return error;
|
|
}
|
|
}
|
|
@@ -1747,6 +1755,16 @@ static int shmem_symlink(struct inode *dir, struct dentry *dentry, const char *s
|
|
if (!inode)
|
|
if (!inode)
|
|
return -ENOSPC;
|
|
return -ENOSPC;
|
|
|
|
|
|
|
|
+ error = security_inode_init_security(inode, dir, NULL, NULL,
|
|
|
|
+ NULL);
|
|
|
|
+ if (error) {
|
|
|
|
+ if (error != -EOPNOTSUPP) {
|
|
|
|
+ iput(inode);
|
|
|
|
+ return error;
|
|
|
|
+ }
|
|
|
|
+ error = 0;
|
|
|
|
+ }
|
|
|
|
+
|
|
info = SHMEM_I(inode);
|
|
info = SHMEM_I(inode);
|
|
inode->i_size = len-1;
|
|
inode->i_size = len-1;
|
|
if (len <= (char *)inode - (char *)info) {
|
|
if (len <= (char *)inode - (char *)info) {
|