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:
bca14dd
)
tomoyo: fix potential use after free
author
Dan Carpenter
<
[email protected]
>
Sat, 13 Mar 2010 11:14:22 +0000
(14:14 +0300)
committer
James Morris
<
[email protected]
>
Sun, 14 Mar 2010 20:51:29 +0000
(07:51 +1100)
The original code returns a freed pointer. This function is expected to
return NULL on errors.
Signed-off-by: Dan Carpenter <
[email protected]
>
Acked-by: Tetsuo Handa <
[email protected]
>
Signed-off-by: James Morris <
[email protected]
>
security/tomoyo/common.c
patch
|
blob
|
history
diff --git
a/security/tomoyo/common.c
b/security/tomoyo/common.c
index ff51f1026b576af78b0ba5138bd8404822a6a130..ef89947a774bbf419aadc0ba6b942985b75b5b50 100644
(file)
--- a/
security/tomoyo/common.c
+++ b/
security/tomoyo/common.c
@@
-886,6
+886,7
@@
static struct tomoyo_profile *tomoyo_find_or_assign_new_profile(const unsigned
ptr = kmalloc(sizeof(*ptr), GFP_KERNEL);
if (!tomoyo_memory_ok(ptr)) {
kfree(ptr);
+ ptr = NULL;
goto ok;
}
for (i = 0; i < TOMOYO_MAX_CONTROL_INDEX; i++)