All of lore.kernel.org
 help / color / mirror / Atom feed
* Patch "cls_u32: complete the check for non-forced case in u32_destroy()" has been added to the 4.1-stable tree
@ 2015-09-30  3:31 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2015-09-30  3:31 UTC (permalink / raw)
  To: xiyou.wangcong, akshat.1984, cwang, davem, gregkh, jhs
  Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    cls_u32: complete the check for non-forced case in u32_destroy()

to the 4.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     cls_u32-complete-the-check-for-non-forced-case-in-u32_destroy.patch
and it can be found in the queue-4.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From foo@baz Wed Sep 30 05:18:31 CEST 2015
From: WANG Cong <xiyou.wangcong@gmail.com>
Date: Tue, 25 Aug 2015 16:38:12 -0700
Subject: cls_u32: complete the check for non-forced case in u32_destroy()

From: WANG Cong <xiyou.wangcong@gmail.com>

[ Upstream commit a6c1aea044e490da3e59124ec55991fe316818d5 ]

In commit 1e052be69d04 ("net_sched: destroy proto tp when all filters are gone")
I added a check in u32_destroy() to see if all real filters are gone
for each tp, however, that is only done for root_ht, same is needed
for others.

This can be reproduced by the following tc commands:

tc filter add dev eth0 parent 1:0 prio 5 handle 15: protocol ip u32 divisor 256
tc filter add dev eth0 protocol ip parent 1: prio 5 handle 15:2:2 u32
ht 15:2: match ip src 10.0.0.2 flowid 1:10
tc filter add dev eth0 protocol ip parent 1: prio 5 handle 15:2:3 u32
ht 15:2: match ip src 10.0.0.3 flowid 1:10

Fixes: 1e052be69d04 ("net_sched: destroy proto tp when all filters are gone")
Reported-by: Akshat Kakkar <akshat.1984@gmail.com>
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Cong Wang <cwang@twopensource.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 net/sched/cls_u32.c |   13 +++++++++++++
 1 file changed, 13 insertions(+)

--- a/net/sched/cls_u32.c
+++ b/net/sched/cls_u32.c
@@ -490,6 +490,19 @@ static bool u32_destroy(struct tcf_proto
 					return false;
 			}
 		}
+
+		if (tp_c->refcnt > 1)
+			return false;
+
+		if (tp_c->refcnt == 1) {
+			struct tc_u_hnode *ht;
+
+			for (ht = rtnl_dereference(tp_c->hlist);
+			     ht;
+			     ht = rtnl_dereference(ht->next))
+				if (!ht_empty(ht))
+					return false;
+		}
 	}
 
 	if (root_ht && --root_ht->refcnt == 0)


Patches currently in stable-queue which might be from xiyou.wangcong@gmail.com are

queue-4.1/net-revert-net_sched-move-tp-root-allocation-into-fw_init.patch
queue-4.1/cls_u32-complete-the-check-for-non-forced-case-in-u32_destroy.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-09-30  3:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-30  3:31 Patch "cls_u32: complete the check for non-forced case in u32_destroy()" has been added to the 4.1-stable tree gregkh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.