aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-10-02 00:29:06 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-10-02 00:29:06 -0400
commit50dddff3cb9af328dd42bafe3437c7f47e8b38a9 (patch)
tree4603bea68685bba3901ea0968e7b248818fb4bdf /net
parenta44f867247d58b378dba0059c915a65ca8f93ba5 (diff)
parent439e9575e777bdad1d9da15941e02adf34f4c392 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) Don't halt the firmware in r8152 driver, from Hayes Wang. 2) Handle full sized 802.1ad frames in bnx2 and tg3 drivers properly, from Vlad Yasevich. 3) Don't sleep while holding tx_clean_lock in netxen driver, fix from Manish Chopra. 4) Certain kinds of ipv6 routes can end up endlessly failing the route validation test, causing it to be re-looked up over and over again. This particularly kills input route caching in TCP sockets. Fix from Hannes Frederic Sowa. 5) netvsc_start_xmit() has a use-after-free access to skb->len, fix from K Y Srinivasan. 6) Fix matching of inverted containers in ematch module, from Ignacy Gawędzki. 7) Aggregation of GRO frames via SKB ->frag_list for linear skbs isn't handled properly, regression fix from Eric Dumazet. 8) Don't test return value of ipv4_neigh_lookup(), which returns an error pointer, against NULL. From WANG Cong. 9) Fix an old regression where we mistakenly allow a double add of the same tunnel. Fixes from Steffen Klassert. 10) macvtap device delete and open can run in parallel and corrupt lists etc., fix from Vlad Yasevich. 11) Fix build error with IPV6=m NETFILTER_XT_TARGET_TPROXY=y, from Pablo Neira Ayuso. 12) rhashtable_destroy() triggers lockdep splats, fix also from Pablo. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (32 commits) bna: Update Maintainer Email r8152: disable power cut for RTL8153 r8152: remove clearing bp bnx2: Correctly receive full sized 802.1ad fragmes tg3: Allow for recieve of full-size 8021AD frames r8152: fix setting RTL8152_UNPLUG netxen: Fix bug in Tx completion path. netxen: Fix BUG "sleeping function called from invalid context" ipv6: remove rt6i_genid hyperv: Fix a bug in netvsc_start_xmit() net: stmmac: fix stmmac_pci_probe failed when CONFIG_HAVE_CLK is selected ematch: Fix matching of inverted containers. gro: fix aggregation for skb using frag_list neigh: check error pointer instead of NULL for ipv4_neigh_lookup() ip6_gre: Return an error when adding an existing tunnel. ip6_vti: Return an error when adding an existing tunnel. ip6_tunnel: Return an error when adding an existing tunnel. ip6gre: add a rtnl link alias for ip6gretap net/mlx4_core: Allow not to specify probe_vf in SRIOV IB mode r8152: fix the carrier off when autoresuming ...
Diffstat (limited to 'net')
-rw-r--r--net/core/skbuff.c3
-rw-r--r--net/ipv4/ip_tunnel.c11
-rw-r--r--net/ipv4/route.c2
-rw-r--r--net/ipv6/addrconf.c3
-rw-r--r--net/ipv6/addrconf_core.c7
-rw-r--r--net/ipv6/ip6_fib.c20
-rw-r--r--net/ipv6/ip6_gre.c3
-rw-r--r--net/ipv6/ip6_tunnel.c6
-rw-r--r--net/ipv6/ip6_vti.c6
-rw-r--r--net/ipv6/route.c4
-rw-r--r--net/netfilter/Kconfig1
-rw-r--r--net/netfilter/nfnetlink.c64
-rw-r--r--net/netfilter/nft_hash.c12
-rw-r--r--net/netfilter/nft_rbtree.c2
-rw-r--r--net/sched/ematch.c6
15 files changed, 129 insertions, 21 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index da1378a3e2c7..8d289697cc7a 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -3152,6 +3152,9 @@ int skb_gro_receive(struct sk_buff **head, struct sk_buff *skb)
3152 NAPI_GRO_CB(skb)->free = NAPI_GRO_FREE_STOLEN_HEAD; 3152 NAPI_GRO_CB(skb)->free = NAPI_GRO_FREE_STOLEN_HEAD;
3153 goto done; 3153 goto done;
3154 } 3154 }
3155 /* switch back to head shinfo */
3156 pinfo = skb_shinfo(p);
3157
3155 if (pinfo->frag_list) 3158 if (pinfo->frag_list)
3156 goto merge; 3159 goto merge;
3157 if (skb_gro_len(p) != pinfo->gso_size) 3160 if (skb_gro_len(p) != pinfo->gso_size)
diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c
index bd41dd1948b6..bda4bb8ae260 100644
--- a/net/ipv4/ip_tunnel.c
+++ b/net/ipv4/ip_tunnel.c
@@ -764,9 +764,14 @@ int ip_tunnel_ioctl(struct net_device *dev, struct ip_tunnel_parm *p, int cmd)
764 764
765 t = ip_tunnel_find(itn, p, itn->fb_tunnel_dev->type); 765 t = ip_tunnel_find(itn, p, itn->fb_tunnel_dev->type);
766 766
767 if (!t && (cmd == SIOCADDTUNNEL)) { 767 if (cmd == SIOCADDTUNNEL) {
768 t = ip_tunnel_create(net, itn, p); 768 if (!t) {
769 err = PTR_ERR_OR_ZERO(t); 769 t = ip_tunnel_create(net, itn, p);
770 err = PTR_ERR_OR_ZERO(t);
771 break;
772 }
773
774 err = -EEXIST;
770 break; 775 break;
771 } 776 }
772 if (dev != itn->fb_tunnel_dev && cmd == SIOCCHGTUNNEL) { 777 if (dev != itn->fb_tunnel_dev && cmd == SIOCCHGTUNNEL) {
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 173e7ea54c70..cbadb942c332 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -746,7 +746,7 @@ static void __ip_do_redirect(struct rtable *rt, struct sk_buff *skb, struct flow
746 } 746 }
747 747
748 n = ipv4_neigh_lookup(&rt->dst, NULL, &new_gw); 748 n = ipv4_neigh_lookup(&rt->dst, NULL, &new_gw);
749 if (n) { 749 if (!IS_ERR(n)) {
750 if (!(n->nud_state & NUD_VALID)) { 750 if (!(n->nud_state & NUD_VALID)) {
751 neigh_event_send(n, NULL); 751 neigh_event_send(n, NULL);
752 } else { 752 } else {
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 3342ee64f2e3..3e118dfddd02 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -4780,10 +4780,11 @@ static void __ipv6_ifa_notify(int event, struct inet6_ifaddr *ifp)
4780 4780
4781 if (ip6_del_rt(ifp->rt)) 4781 if (ip6_del_rt(ifp->rt))
4782 dst_free(&ifp->rt->dst); 4782 dst_free(&ifp->rt->dst);
4783
4784 rt_genid_bump_ipv6(net);
4783 break; 4785 break;
4784 } 4786 }
4785 atomic_inc(&net->ipv6.dev_addr_genid); 4787 atomic_inc(&net->ipv6.dev_addr_genid);
4786 rt_genid_bump_ipv6(net);
4787} 4788}
4788 4789
4789static void ipv6_ifa_notify(int event, struct inet6_ifaddr *ifp) 4790static void ipv6_ifa_notify(int event, struct inet6_ifaddr *ifp)
diff --git a/net/ipv6/addrconf_core.c b/net/ipv6/addrconf_core.c
index e6960457f625..98cc4cd570e2 100644
--- a/net/ipv6/addrconf_core.c
+++ b/net/ipv6/addrconf_core.c
@@ -8,6 +8,13 @@
8#include <net/addrconf.h> 8#include <net/addrconf.h>
9#include <net/ip.h> 9#include <net/ip.h>
10 10
11/* if ipv6 module registers this function is used by xfrm to force all
12 * sockets to relookup their nodes - this is fairly expensive, be
13 * careful
14 */
15void (*__fib6_flush_trees)(struct net *);
16EXPORT_SYMBOL(__fib6_flush_trees);
17
11#define IPV6_ADDR_SCOPE_TYPE(scope) ((scope) << 16) 18#define IPV6_ADDR_SCOPE_TYPE(scope) ((scope) << 16)
12 19
13static inline unsigned int ipv6_addr_scope2type(unsigned int scope) 20static inline unsigned int ipv6_addr_scope2type(unsigned int scope)
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
index 76b7f5ee8f4c..97b9fa8de377 100644
--- a/net/ipv6/ip6_fib.c
+++ b/net/ipv6/ip6_fib.c
@@ -1605,6 +1605,24 @@ static void fib6_prune_clones(struct net *net, struct fib6_node *fn)
1605 fib6_clean_tree(net, fn, fib6_prune_clone, 1, NULL); 1605 fib6_clean_tree(net, fn, fib6_prune_clone, 1, NULL);
1606} 1606}
1607 1607
1608static int fib6_update_sernum(struct rt6_info *rt, void *arg)
1609{
1610 __u32 sernum = *(__u32 *)arg;
1611
1612 if (rt->rt6i_node &&
1613 rt->rt6i_node->fn_sernum != sernum)
1614 rt->rt6i_node->fn_sernum = sernum;
1615
1616 return 0;
1617}
1618
1619static void fib6_flush_trees(struct net *net)
1620{
1621 __u32 new_sernum = fib6_new_sernum();
1622
1623 fib6_clean_all(net, fib6_update_sernum, &new_sernum);
1624}
1625
1608/* 1626/*
1609 * Garbage collection 1627 * Garbage collection
1610 */ 1628 */
@@ -1788,6 +1806,8 @@ int __init fib6_init(void)
1788 NULL); 1806 NULL);
1789 if (ret) 1807 if (ret)
1790 goto out_unregister_subsys; 1808 goto out_unregister_subsys;
1809
1810 __fib6_flush_trees = fib6_flush_trees;
1791out: 1811out:
1792 return ret; 1812 return ret;
1793 1813
diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c
index 5f19dfbc4c6a..f304471477dc 100644
--- a/net/ipv6/ip6_gre.c
+++ b/net/ipv6/ip6_gre.c
@@ -314,6 +314,8 @@ static struct ip6_tnl *ip6gre_tunnel_locate(struct net *net,
314 struct ip6gre_net *ign = net_generic(net, ip6gre_net_id); 314 struct ip6gre_net *ign = net_generic(net, ip6gre_net_id);
315 315
316 t = ip6gre_tunnel_find(net, parms, ARPHRD_IP6GRE); 316 t = ip6gre_tunnel_find(net, parms, ARPHRD_IP6GRE);
317 if (t && create)
318 return NULL;
317 if (t || !create) 319 if (t || !create)
318 return t; 320 return t;
319 321
@@ -1724,4 +1726,5 @@ MODULE_LICENSE("GPL");
1724MODULE_AUTHOR("D. Kozlov (xeb@mail.ru)"); 1726MODULE_AUTHOR("D. Kozlov (xeb@mail.ru)");
1725MODULE_DESCRIPTION("GRE over IPv6 tunneling device"); 1727MODULE_DESCRIPTION("GRE over IPv6 tunneling device");
1726MODULE_ALIAS_RTNL_LINK("ip6gre"); 1728MODULE_ALIAS_RTNL_LINK("ip6gre");
1729MODULE_ALIAS_RTNL_LINK("ip6gretap");
1727MODULE_ALIAS_NETDEV("ip6gre0"); 1730MODULE_ALIAS_NETDEV("ip6gre0");
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
index f9de5a695072..69a84b464009 100644
--- a/net/ipv6/ip6_tunnel.c
+++ b/net/ipv6/ip6_tunnel.c
@@ -364,8 +364,12 @@ static struct ip6_tnl *ip6_tnl_locate(struct net *net,
364 (t = rtnl_dereference(*tp)) != NULL; 364 (t = rtnl_dereference(*tp)) != NULL;
365 tp = &t->next) { 365 tp = &t->next) {
366 if (ipv6_addr_equal(local, &t->parms.laddr) && 366 if (ipv6_addr_equal(local, &t->parms.laddr) &&
367 ipv6_addr_equal(remote, &t->parms.raddr)) 367 ipv6_addr_equal(remote, &t->parms.raddr)) {
368 if (create)
369 return NULL;
370
368 return t; 371 return t;
372 }
369 } 373 }
370 if (!create) 374 if (!create)
371 return NULL; 375 return NULL;
diff --git a/net/ipv6/ip6_vti.c b/net/ipv6/ip6_vti.c
index 7f52fd9fa7b0..5833a2244467 100644
--- a/net/ipv6/ip6_vti.c
+++ b/net/ipv6/ip6_vti.c
@@ -253,8 +253,12 @@ static struct ip6_tnl *vti6_locate(struct net *net, struct __ip6_tnl_parm *p,
253 (t = rtnl_dereference(*tp)) != NULL; 253 (t = rtnl_dereference(*tp)) != NULL;
254 tp = &t->next) { 254 tp = &t->next) {
255 if (ipv6_addr_equal(local, &t->parms.laddr) && 255 if (ipv6_addr_equal(local, &t->parms.laddr) &&
256 ipv6_addr_equal(remote, &t->parms.raddr)) 256 ipv6_addr_equal(remote, &t->parms.raddr)) {
257 if (create)
258 return NULL;
259
257 return t; 260 return t;
261 }
258 } 262 }
259 if (!create) 263 if (!create)
260 return NULL; 264 return NULL;
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index f23fbd28a501..bafde82324c5 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -314,7 +314,6 @@ static inline struct rt6_info *ip6_dst_alloc(struct net *net,
314 314
315 memset(dst + 1, 0, sizeof(*rt) - sizeof(*dst)); 315 memset(dst + 1, 0, sizeof(*rt) - sizeof(*dst));
316 rt6_init_peer(rt, table ? &table->tb6_peers : net->ipv6.peers); 316 rt6_init_peer(rt, table ? &table->tb6_peers : net->ipv6.peers);
317 rt->rt6i_genid = rt_genid_ipv6(net);
318 INIT_LIST_HEAD(&rt->rt6i_siblings); 317 INIT_LIST_HEAD(&rt->rt6i_siblings);
319 } 318 }
320 return rt; 319 return rt;
@@ -1098,9 +1097,6 @@ static struct dst_entry *ip6_dst_check(struct dst_entry *dst, u32 cookie)
1098 * DST_OBSOLETE_FORCE_CHK which forces validation calls down 1097 * DST_OBSOLETE_FORCE_CHK which forces validation calls down
1099 * into this function always. 1098 * into this function always.
1100 */ 1099 */
1101 if (rt->rt6i_genid != rt_genid_ipv6(dev_net(rt->dst.dev)))
1102 return NULL;
1103
1104 if (!rt->rt6i_node || (rt->rt6i_node->fn_sernum != cookie)) 1100 if (!rt->rt6i_node || (rt->rt6i_node->fn_sernum != cookie))
1105 return NULL; 1101 return NULL;
1106 1102
diff --git a/net/netfilter/Kconfig b/net/netfilter/Kconfig
index b5c1d3aadb41..6d77cce481d5 100644
--- a/net/netfilter/Kconfig
+++ b/net/netfilter/Kconfig
@@ -847,6 +847,7 @@ config NETFILTER_XT_TARGET_TPROXY
847 tristate '"TPROXY" target transparent proxying support' 847 tristate '"TPROXY" target transparent proxying support'
848 depends on NETFILTER_XTABLES 848 depends on NETFILTER_XTABLES
849 depends on NETFILTER_ADVANCED 849 depends on NETFILTER_ADVANCED
850 depends on (IPV6 || IPV6=n)
850 depends on IP_NF_MANGLE 851 depends on IP_NF_MANGLE
851 select NF_DEFRAG_IPV4 852 select NF_DEFRAG_IPV4
852 select NF_DEFRAG_IPV6 if IP6_NF_IPTABLES 853 select NF_DEFRAG_IPV6 if IP6_NF_IPTABLES
diff --git a/net/netfilter/nfnetlink.c b/net/netfilter/nfnetlink.c
index c138b8fbe280..f37f0716a9fc 100644
--- a/net/netfilter/nfnetlink.c
+++ b/net/netfilter/nfnetlink.c
@@ -222,6 +222,51 @@ replay:
222 } 222 }
223} 223}
224 224
225struct nfnl_err {
226 struct list_head head;
227 struct nlmsghdr *nlh;
228 int err;
229};
230
231static int nfnl_err_add(struct list_head *list, struct nlmsghdr *nlh, int err)
232{
233 struct nfnl_err *nfnl_err;
234
235 nfnl_err = kmalloc(sizeof(struct nfnl_err), GFP_KERNEL);
236 if (nfnl_err == NULL)
237 return -ENOMEM;
238
239 nfnl_err->nlh = nlh;
240 nfnl_err->err = err;
241 list_add_tail(&nfnl_err->head, list);
242
243 return 0;
244}
245
246static void nfnl_err_del(struct nfnl_err *nfnl_err)
247{
248 list_del(&nfnl_err->head);
249 kfree(nfnl_err);
250}
251
252static void nfnl_err_reset(struct list_head *err_list)
253{
254 struct nfnl_err *nfnl_err, *next;
255
256 list_for_each_entry_safe(nfnl_err, next, err_list, head)
257 nfnl_err_del(nfnl_err);
258}
259
260static void nfnl_err_deliver(struct list_head *err_list, struct sk_buff *skb)
261{
262 struct nfnl_err *nfnl_err, *next;
263
264 list_for_each_entry_safe(nfnl_err, next, err_list, head) {
265 netlink_ack(skb, nfnl_err->nlh, nfnl_err->err);
266 nfnl_err_del(nfnl_err);
267 }
268}
269
225static void nfnetlink_rcv_batch(struct sk_buff *skb, struct nlmsghdr *nlh, 270static void nfnetlink_rcv_batch(struct sk_buff *skb, struct nlmsghdr *nlh,
226 u_int16_t subsys_id) 271 u_int16_t subsys_id)
227{ 272{
@@ -230,6 +275,7 @@ static void nfnetlink_rcv_batch(struct sk_buff *skb, struct nlmsghdr *nlh,
230 const struct nfnetlink_subsystem *ss; 275 const struct nfnetlink_subsystem *ss;
231 const struct nfnl_callback *nc; 276 const struct nfnl_callback *nc;
232 bool success = true, done = false; 277 bool success = true, done = false;
278 static LIST_HEAD(err_list);
233 int err; 279 int err;
234 280
235 if (subsys_id >= NFNL_SUBSYS_COUNT) 281 if (subsys_id >= NFNL_SUBSYS_COUNT)
@@ -287,6 +333,7 @@ replay:
287 type = nlh->nlmsg_type; 333 type = nlh->nlmsg_type;
288 if (type == NFNL_MSG_BATCH_BEGIN) { 334 if (type == NFNL_MSG_BATCH_BEGIN) {
289 /* Malformed: Batch begin twice */ 335 /* Malformed: Batch begin twice */
336 nfnl_err_reset(&err_list);
290 success = false; 337 success = false;
291 goto done; 338 goto done;
292 } else if (type == NFNL_MSG_BATCH_END) { 339 } else if (type == NFNL_MSG_BATCH_END) {
@@ -333,6 +380,7 @@ replay:
333 * original skb. 380 * original skb.
334 */ 381 */
335 if (err == -EAGAIN) { 382 if (err == -EAGAIN) {
383 nfnl_err_reset(&err_list);
336 ss->abort(skb); 384 ss->abort(skb);
337 nfnl_unlock(subsys_id); 385 nfnl_unlock(subsys_id);
338 kfree_skb(nskb); 386 kfree_skb(nskb);
@@ -341,11 +389,24 @@ replay:
341 } 389 }
342ack: 390ack:
343 if (nlh->nlmsg_flags & NLM_F_ACK || err) { 391 if (nlh->nlmsg_flags & NLM_F_ACK || err) {
392 /* Errors are delivered once the full batch has been
393 * processed, this avoids that the same error is
394 * reported several times when replaying the batch.
395 */
396 if (nfnl_err_add(&err_list, nlh, err) < 0) {
397 /* We failed to enqueue an error, reset the
398 * list of errors and send OOM to userspace
399 * pointing to the batch header.
400 */
401 nfnl_err_reset(&err_list);
402 netlink_ack(skb, nlmsg_hdr(oskb), -ENOMEM);
403 success = false;
404 goto done;
405 }
344 /* We don't stop processing the batch on errors, thus, 406 /* We don't stop processing the batch on errors, thus,
345 * userspace gets all the errors that the batch 407 * userspace gets all the errors that the batch
346 * triggers. 408 * triggers.
347 */ 409 */
348 netlink_ack(skb, nlh, err);
349 if (err) 410 if (err)
350 success = false; 411 success = false;
351 } 412 }
@@ -361,6 +422,7 @@ done:
361 else 422 else
362 ss->abort(skb); 423 ss->abort(skb);
363 424
425 nfnl_err_deliver(&err_list, oskb);
364 nfnl_unlock(subsys_id); 426 nfnl_unlock(subsys_id);
365 kfree_skb(nskb); 427 kfree_skb(nskb);
366} 428}
diff --git a/net/netfilter/nft_hash.c b/net/netfilter/nft_hash.c
index 28fb8f38e6ba..8892b7b6184a 100644
--- a/net/netfilter/nft_hash.c
+++ b/net/netfilter/nft_hash.c
@@ -180,15 +180,17 @@ static int nft_hash_init(const struct nft_set *set,
180static void nft_hash_destroy(const struct nft_set *set) 180static void nft_hash_destroy(const struct nft_set *set)
181{ 181{
182 const struct rhashtable *priv = nft_set_priv(set); 182 const struct rhashtable *priv = nft_set_priv(set);
183 const struct bucket_table *tbl; 183 const struct bucket_table *tbl = priv->tbl;
184 struct nft_hash_elem *he, *next; 184 struct nft_hash_elem *he, *next;
185 unsigned int i; 185 unsigned int i;
186 186
187 tbl = rht_dereference(priv->tbl, priv); 187 for (i = 0; i < tbl->size; i++) {
188 for (i = 0; i < tbl->size; i++) 188 for (he = rht_entry(tbl->buckets[i], struct nft_hash_elem, node);
189 rht_for_each_entry_safe(he, next, tbl->buckets[i], priv, node) 189 he != NULL; he = next) {
190 next = rht_entry(he->node.next, struct nft_hash_elem, node);
190 nft_hash_elem_destroy(set, he); 191 nft_hash_elem_destroy(set, he);
191 192 }
193 }
192 rhashtable_destroy(priv); 194 rhashtable_destroy(priv);
193} 195}
194 196
diff --git a/net/netfilter/nft_rbtree.c b/net/netfilter/nft_rbtree.c
index e1836ff88199..46214f245665 100644
--- a/net/netfilter/nft_rbtree.c
+++ b/net/netfilter/nft_rbtree.c
@@ -234,13 +234,11 @@ static void nft_rbtree_destroy(const struct nft_set *set)
234 struct nft_rbtree_elem *rbe; 234 struct nft_rbtree_elem *rbe;
235 struct rb_node *node; 235 struct rb_node *node;
236 236
237 spin_lock_bh(&nft_rbtree_lock);
238 while ((node = priv->root.rb_node) != NULL) { 237 while ((node = priv->root.rb_node) != NULL) {
239 rb_erase(node, &priv->root); 238 rb_erase(node, &priv->root);
240 rbe = rb_entry(node, struct nft_rbtree_elem, node); 239 rbe = rb_entry(node, struct nft_rbtree_elem, node);
241 nft_rbtree_elem_destroy(set, rbe); 240 nft_rbtree_elem_destroy(set, rbe);
242 } 241 }
243 spin_unlock_bh(&nft_rbtree_lock);
244} 242}
245 243
246static bool nft_rbtree_estimate(const struct nft_set_desc *desc, u32 features, 244static bool nft_rbtree_estimate(const struct nft_set_desc *desc, u32 features,
diff --git a/net/sched/ematch.c b/net/sched/ematch.c
index 3a633debb6df..ad57f4444b9c 100644
--- a/net/sched/ematch.c
+++ b/net/sched/ematch.c
@@ -526,9 +526,11 @@ pop_stack:
526 match_idx = stack[--stackp]; 526 match_idx = stack[--stackp];
527 cur_match = tcf_em_get_match(tree, match_idx); 527 cur_match = tcf_em_get_match(tree, match_idx);
528 528
529 if (tcf_em_early_end(cur_match, res)) 529 if (tcf_em_early_end(cur_match, res)) {
530 if (tcf_em_is_inverted(cur_match))
531 res = !res;
530 goto pop_stack; 532 goto pop_stack;
531 else { 533 } else {
532 match_idx++; 534 match_idx++;
533 goto proceed; 535 goto proceed;
534 } 536 }