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:
e81fbf6
)
net_sched: hold tcf_lock in netdevice notifier
author
Cong Wang
<
[email protected]
>
Wed, 16 Jul 2014 21:25:31 +0000
(14:25 -0700)
committer
David S. Miller
<
[email protected]
>
Mon, 21 Jul 2014 03:31:42 +0000
(20:31 -0700)
We modify mirred action (m->tcfm_dev) in netdev event, we need to
prevent on-going mirred actions from reading freed m->tcfm_dev.
So we need to acquire this spin lock.
Cc: Jamal Hadi Salim <
[email protected]
>
Cc: "David S. Miller" <
[email protected]
>
Signed-off-by: Cong Wang <
[email protected]
>
Signed-off-by: Cong Wang <
[email protected]
>
Signed-off-by: David S. Miller <
[email protected]
>
net/sched/act_mirred.c
patch
|
blob
|
history
diff --git
a/net/sched/act_mirred.c
b/net/sched/act_mirred.c
index 4f912c0e225b674dfa117060ee547b99feb972ca..eb48306033d91ef131fd67fcd432f73ed55a43cb 100644
(file)
--- a/
net/sched/act_mirred.c
+++ b/
net/sched/act_mirred.c
@@
-218,10
+218,12
@@
static int mirred_device_event(struct notifier_block *unused,
if (event == NETDEV_UNREGISTER)
list_for_each_entry(m, &mirred_list, tcfm_list) {
+ spin_lock_bh(&m->tcf_lock);
if (m->tcfm_dev == dev) {
dev_put(dev);
m->tcfm_dev = NULL;
}
+ spin_unlock_bh(&m->tcf_lock);
}
return NOTIFY_DONE;