projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e134d20
)
security: testing the wrong variable in create_by_name()
author
Dan Carpenter
<
[email protected]
>
Thu, 22 Apr 2010 10:05:35 +0000
(12:05 +0200)
committer
James Morris
<
[email protected]
>
Thu, 22 Apr 2010 11:17:41 +0000
(21:17 +1000)
There is a typo here. We should be testing "*dentry" instead of
"dentry". If "*dentry" is an ERR_PTR, it gets dereferenced in either
mkdir() or create() which would cause an OOPs.
Signed-off-by: Dan Carpenter <
[email protected]
>
Signed-off-by: James Morris <
[email protected]
>
security/inode.c
patch
|
blob
|
history
diff --git
a/security/inode.c
b/security/inode.c
index c3a793881d04f0c578049f986ce98cb778d71895..1c812e874504ef90e1b8748e28d6d9e73d6a5912 100644
(file)
--- a/
security/inode.c
+++ b/
security/inode.c
@@
-161,13
+161,13
@@
static int create_by_name(const char *name, mode_t mode,
mutex_lock(&parent->d_inode->i_mutex);
*dentry = lookup_one_len(name, parent, strlen(name));
- if (!IS_ERR(dentry)) {
+ if (!IS_ERR(
*
dentry)) {
if ((mode & S_IFMT) == S_IFDIR)
error = mkdir(parent->d_inode, *dentry, mode);
else
error = create(parent->d_inode, *dentry, mode);
} else
- error = PTR_ERR(dentry);
+ error = PTR_ERR(
*
dentry);
mutex_unlock(&parent->d_inode->i_mutex);
return error;