projects
/
oweals
/
netifd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cfeabca
)
move device cleanup to common code, fixes use-after-free in tunnel code
author
Felix Fietkau
<nbd@openwrt.org>
Mon, 19 Mar 2012 20:38:13 +0000
(21:38 +0100)
committer
Felix Fietkau
<nbd@openwrt.org>
Mon, 19 Mar 2012 20:38:13 +0000
(21:38 +0100)
bridge.c
patch
|
blob
|
history
device.c
patch
|
blob
|
history
diff --git
a/bridge.c
b/bridge.c
index 9967985d0dc98751f24efa0f33dfa26c83ca32d8..da07d9c855214dbf89e6a2c65e62df7e8d4734d5 100644
(file)
--- a/
bridge.c
+++ b/
bridge.c
@@
-343,7
+343,6
@@
bridge_free(struct device *dev)
{
struct bridge_state *bst;
- device_cleanup(dev);
bst = container_of(dev, struct bridge_state, dev);
vlist_flush_all(&bst->members);
free(bst);
diff --git
a/device.c
b/device.c
index 46177a2728cb3488012df7963cf623311a750afa..47b5875c230446f74fc321d8b845a861d9dd2688 100644
(file)
--- a/
device.c
+++ b/
device.c
@@
-112,7
+112,6
@@
static void simple_device_free(struct device *dev)
{
if (dev->parent.dev)
device_remove_user(&dev->parent);
- device_cleanup(dev);
free(dev);
}
@@
-162,8
+161,6
@@
static void alias_device_free(struct device *dev)
{
struct alias_device *alias;
- device_cleanup(dev);
-
alias = container_of(dev, struct alias_device, dev);
avl_delete(&aliases, &alias->avl);
free(alias);
@@
-483,6
+480,7
@@
device_free(struct device *dev)
{
__devlock++;
free(dev->config);
+ device_cleanup(dev);
dev->type->free(dev);
__devlock--;
}