aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2018-08-13 19:37:42 -0700
committerDavid S. Miller <davem@davemloft.net>2018-08-13 19:37:42 -0700
commite8ae5e92beeec01e8badfecbc9adfd6f94ec87c8 (patch)
tree7561cfb1fc63e0da05620f14051e181be76e8654
parentnfp: clean up return types in kdoc comments (diff)
parentnet_sched: Fix missing res info when create new tc_index filter (diff)
downloadwireguard-linux-e8ae5e92beeec01e8badfecbc9adfd6f94ec87c8.tar.xz
wireguard-linux-e8ae5e92beeec01e8badfecbc9adfd6f94ec87c8.zip
Merge branch 'net_sched-Fix-two-tc_index-filter-init-issues'
Hangbin Liu says: ==================== net_sched: Fix two tc_index filter init issues These two patches fix two tc_index filter init issues. The first one fixes missing exts info in new filter, which will cause NULL pointer dereference when delete tcindex filter. The second one fixes missing res info when create new filter, which will make filter unbind failed. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/sched/cls_tcindex.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/net/sched/cls_tcindex.c b/net/sched/cls_tcindex.c
index 32f4bbd82f35..9ccc93f257db 100644
--- a/net/sched/cls_tcindex.c
+++ b/net/sched/cls_tcindex.c
@@ -447,11 +447,6 @@ tcindex_set_parms(struct net *net, struct tcf_proto *tp, unsigned long base,
tcf_bind_filter(tp, &cr.res, base);
}
- if (old_r)
- tcf_exts_change(&r->exts, &e);
- else
- tcf_exts_change(&cr.exts, &e);
-
if (old_r && old_r != r) {
err = tcindex_filter_result_init(old_r);
if (err < 0) {
@@ -462,12 +457,15 @@ tcindex_set_parms(struct net *net, struct tcf_proto *tp, unsigned long base,
oldp = p;
r->res = cr.res;
+ tcf_exts_change(&r->exts, &e);
+
rcu_assign_pointer(tp->root, cp);
if (r == &new_filter_result) {
struct tcindex_filter *nfp;
struct tcindex_filter __rcu **fp;
+ f->result.res = r->res;
tcf_exts_change(&f->result.exts, &r->exts);
fp = cp->h + (handle % cp->hash);