netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Patch net] fq_codel: fix a use-after-free
@ 2015-07-13 19:30 Cong Wang
  2015-07-14  6:23 ` Eric Dumazet
  2015-07-16  0:20 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Cong Wang @ 2015-07-13 19:30 UTC (permalink / raw)
  To: netdev; +Cc: Cong Wang, John Fastabend, Cong Wang

Fixes: 25331d6ce42b ("net: sched: implement qstat helper routines")
Cc: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Cong Wang <cwang@twopensource.com>
---
 net/sched/sch_fq_codel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/sched/sch_fq_codel.c b/net/sched/sch_fq_codel.c
index d75993f..06e7c84 100644
--- a/net/sched/sch_fq_codel.c
+++ b/net/sched/sch_fq_codel.c
@@ -155,10 +155,10 @@ static unsigned int fq_codel_drop(struct Qdisc *sch)
 	skb = dequeue_head(flow);
 	len = qdisc_pkt_len(skb);
 	q->backlogs[idx] -= len;
-	kfree_skb(skb);
 	sch->q.qlen--;
 	qdisc_qstats_drop(sch);
 	qdisc_qstats_backlog_dec(sch, skb);
+	kfree_skb(skb);
 	flow->dropped++;
 	return idx;
 }
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Patch net] fq_codel: fix a use-after-free
  2015-07-13 19:30 [Patch net] fq_codel: fix a use-after-free Cong Wang
@ 2015-07-14  6:23 ` Eric Dumazet
  2015-07-16  0:20 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Eric Dumazet @ 2015-07-14  6:23 UTC (permalink / raw)
  To: Cong Wang; +Cc: netdev, John Fastabend, Cong Wang

On Mon, 2015-07-13 at 12:30 -0700, Cong Wang wrote:
> Fixes: 25331d6ce42b ("net: sched: implement qstat helper routines")
> Cc: John Fastabend <john.fastabend@gmail.com>
> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
> Signed-off-by: Cong Wang <cwang@twopensource.com>
> ---
>  net/sched/sch_fq_codel.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/sched/sch_fq_codel.c b/net/sched/sch_fq_codel.c
> index d75993f..06e7c84 100644
> --- a/net/sched/sch_fq_codel.c
> +++ b/net/sched/sch_fq_codel.c
> @@ -155,10 +155,10 @@ static unsigned int fq_codel_drop(struct Qdisc *sch)
>  	skb = dequeue_head(flow);
>  	len = qdisc_pkt_len(skb);
>  	q->backlogs[idx] -= len;
> -	kfree_skb(skb);
>  	sch->q.qlen--;
>  	qdisc_qstats_drop(sch);
>  	qdisc_qstats_backlog_dec(sch, skb);
> +	kfree_skb(skb);
>  	flow->dropped++;
>  	return idx;
>  }

Thanks Cong

Acked-by: Eric Dumazet <edumazet@google.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Patch net] fq_codel: fix a use-after-free
  2015-07-13 19:30 [Patch net] fq_codel: fix a use-after-free Cong Wang
  2015-07-14  6:23 ` Eric Dumazet
@ 2015-07-16  0:20 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2015-07-16  0:20 UTC (permalink / raw)
  To: xiyou.wangcong; +Cc: netdev, john.fastabend, cwang

From: Cong Wang <xiyou.wangcong@gmail.com>
Date: Mon, 13 Jul 2015 12:30:07 -0700

> Fixes: 25331d6ce42b ("net: sched: implement qstat helper routines")
> Cc: John Fastabend <john.fastabend@gmail.com>
> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
> Signed-off-by: Cong Wang <cwang@twopensource.com>

Applied and queued up for -stable, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-07-16  0:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-13 19:30 [Patch net] fq_codel: fix a use-after-free Cong Wang
2015-07-14  6:23 ` Eric Dumazet
2015-07-16  0:20 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).