Re: [PATCH] net: sched: fix a use-after-free error on chain on the error exit path

2017-05-20 Thread Jiri Pirko
Fri, May 19, 2017 at 07:17:59PM CEST, xiyou.wangc...@gmail.com wrote: >On Thu, May 18, 2017 at 7:07 AM, Colin King wrote: >> diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c >> index 4020b8d932a1..82ebdc3fcb2e 100644 >> --- a/net/sched/cls_api.c >> +++ b/net/sched/cls_api.c >> @@ -511,6 +511

Re: [PATCH] net: sched: fix a use-after-free error on chain on the error exit path

2017-05-19 Thread Cong Wang
On Thu, May 18, 2017 at 7:07 AM, Colin King wrote: > diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c > index 4020b8d932a1..82ebdc3fcb2e 100644 > --- a/net/sched/cls_api.c > +++ b/net/sched/cls_api.c > @@ -511,6 +511,7 @@ static int tc_ctl_tfilter(struct sk_buff *skb, struct > nlmsghdr *n,

Re: [PATCH] net: sched: fix a use-after-free error on chain on the error exit path

2017-05-18 Thread David Miller
From: Colin King Date: Thu, 18 May 2017 15:07:02 +0100 > From: Colin Ian King > > Set chain to null after the call to tcf_chain_destroy so that we don't > call tcf_chain_put on the error exit path, thus avoiding a use-after-free > error. > > Detected by CoverityScan, CID#1436357 ("Use after fr

[PATCH] net: sched: fix a use-after-free error on chain on the error exit path

2017-05-18 Thread Colin King
From: Colin Ian King Set chain to null after the call to tcf_chain_destroy so that we don't call tcf_chain_put on the error exit path, thus avoiding a use-after-free error. Detected by CoverityScan, CID#1436357 ("Use after free") Signed-off-by: Colin Ian King --- net/sched/cls_api.c | 1 + 1