mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-05 05:42:36 +00:00
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6: SELinux: fix memory leakage in /security/selinux/hooks.c
This commit is contained in:
commit
4d9c73f60e
1 changed files with 2 additions and 1 deletions
|
@ -1285,6 +1285,8 @@ static int inode_doinit_with_dentry(struct inode *inode, struct dentry *opt_dent
|
||||||
rc = inode->i_op->getxattr(dentry, XATTR_NAME_SELINUX,
|
rc = inode->i_op->getxattr(dentry, XATTR_NAME_SELINUX,
|
||||||
context, len);
|
context, len);
|
||||||
if (rc == -ERANGE) {
|
if (rc == -ERANGE) {
|
||||||
|
kfree(context);
|
||||||
|
|
||||||
/* Need a larger buffer. Query for the right size. */
|
/* Need a larger buffer. Query for the right size. */
|
||||||
rc = inode->i_op->getxattr(dentry, XATTR_NAME_SELINUX,
|
rc = inode->i_op->getxattr(dentry, XATTR_NAME_SELINUX,
|
||||||
NULL, 0);
|
NULL, 0);
|
||||||
|
@ -1292,7 +1294,6 @@ static int inode_doinit_with_dentry(struct inode *inode, struct dentry *opt_dent
|
||||||
dput(dentry);
|
dput(dentry);
|
||||||
goto out_unlock;
|
goto out_unlock;
|
||||||
}
|
}
|
||||||
kfree(context);
|
|
||||||
len = rc;
|
len = rc;
|
||||||
context = kmalloc(len+1, GFP_NOFS);
|
context = kmalloc(len+1, GFP_NOFS);
|
||||||
if (!context) {
|
if (!context) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue