diff mbox series

[net] cls_matchall: fix tcf_unbind_filter missing

Message ID 1534238906-16097-1-git-send-email-liuhangbin@gmail.com
State Accepted, archived
Delegated to: David Miller
Headers show
Series [net] cls_matchall: fix tcf_unbind_filter missing | expand

Commit Message

Hangbin Liu Aug. 14, 2018, 9:28 a.m. UTC
Fix tcf_unbind_filter missing in cls_matchall as this will trigger
WARN_ON() in cbq_destroy_class().

Fixes: fd62d9f5c575f ("net/sched: matchall: Fix configuration race")
Reported-by: Li Shuang <shuali@redhat.com>
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
---
 net/sched/cls_matchall.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Cong Wang Aug. 14, 2018, 10:32 p.m. UTC | #1
On Tue, Aug 14, 2018 at 2:28 AM Hangbin Liu <liuhangbin@gmail.com> wrote:
>
> Fix tcf_unbind_filter missing in cls_matchall as this will trigger
> WARN_ON() in cbq_destroy_class().
>
> Fixes: fd62d9f5c575f ("net/sched: matchall: Fix configuration race")
> Reported-by: Li Shuang <shuali@redhat.com>
> Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>

Acked-by: Cong Wang <xiyou.wangcong@gmail.com>
David Miller Aug. 16, 2018, 7:09 p.m. UTC | #2
From: Hangbin Liu <liuhangbin@gmail.com>
Date: Tue, 14 Aug 2018 17:28:26 +0800

> Fix tcf_unbind_filter missing in cls_matchall as this will trigger
> WARN_ON() in cbq_destroy_class().
> 
> Fixes: fd62d9f5c575f ("net/sched: matchall: Fix configuration race")
> Reported-by: Li Shuang <shuali@redhat.com>
> Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>

Applied and queued up for -stable, thanks.
diff mbox series

Patch

diff --git a/net/sched/cls_matchall.c b/net/sched/cls_matchall.c
index 47b207e..7ad65da 100644
--- a/net/sched/cls_matchall.c
+++ b/net/sched/cls_matchall.c
@@ -111,6 +111,8 @@  static void mall_destroy(struct tcf_proto *tp, struct netlink_ext_ack *extack)
 	if (!head)
 		return;
 
+	tcf_unbind_filter(tp, &head->res);
+
 	if (!tc_skip_hw(head->flags))
 		mall_destroy_hw_filter(tp, head, (unsigned long) head, extack);