Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1431668 > unrolled thread

linux-next: manual merge of the net-next tree with the net tree

Started byStephen Rothwell <sfr@canb.auug.org.au>
First post2016-06-27 03:50 +0200
Last post2016-06-27 07:00 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  linux-next: manual merge of the net-next tree with the net tree Stephen Rothwell <sfr@canb.auug.org.au> - 2016-06-27 03:50 +0200
    Re: linux-next: manual merge of the net-next tree with the net tree Eric Dumazet <eric.dumazet@gmail.com> - 2016-06-27 07:00 +0200

#1431668 — linux-next: manual merge of the net-next tree with the net tree

FromStephen Rothwell <sfr@canb.auug.org.au>
Date2016-06-27 03:50 +0200
Subjectlinux-next: manual merge of the net-next tree with the net tree
Message-ID<rOtQt-257-5@gated-at.bofh.it>
Hi all,

Today's linux-next merge of the net-next tree got a conflict in:

  net/sched/sch_netem.c

between commit:

  21de12ee5568 ("netem: fix a use after free")

from the net tree and commit:

  520ac30f4551 ("net_sched: drop packets after root qdisc lock is released")

from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc net/sched/sch_netem.c
index 178f1630a036,ccca8ca4c722..000000000000
--- a/net/sched/sch_netem.c
+++ b/net/sched/sch_netem.c
@@@ -650,14 -617,17 +617,17 @@@ deliver
  #endif
  
  			if (q->qdisc) {
 +				unsigned int pkt_len = qdisc_pkt_len(skb);
- 				int err = qdisc_enqueue(skb, q->qdisc);
+ 				struct sk_buff *to_free = NULL;
+ 				int err;
  
+ 				err = qdisc_enqueue(skb, q->qdisc, &to_free);
+ 				kfree_skb_list(to_free);
 -				if (unlikely(err != NET_XMIT_SUCCESS)) {
 -					if (net_xmit_drop_count(err)) {
 -						qdisc_qstats_drop(sch);
 -						qdisc_tree_reduce_backlog(sch, 1,
 -									  qdisc_pkt_len(skb));
 -					}
 +				if (err != NET_XMIT_SUCCESS &&
 +				    net_xmit_drop_count(err)) {
 +					qdisc_qstats_drop(sch);
 +					qdisc_tree_reduce_backlog(sch, 1,
 +								  pkt_len);
  				}
  				goto tfifo_dequeue;
  			}

[toc] | [next] | [standalone]


#1431717

FromEric Dumazet <eric.dumazet@gmail.com>
Date2016-06-27 07:00 +0200
Message-ID<rOwOm-3YT-21@gated-at.bofh.it>
In reply to#1431668
On Mon, 2016-06-27 at 11:46 +1000, Stephen Rothwell wrote:
> Hi all,
> 
> Today's linux-next merge of the net-next tree got a conflict in:
> 
>   net/sched/sch_netem.c
> 
> between commit:
> 
>   21de12ee5568 ("netem: fix a use after free")
> 
> from the net tree and commit:
> 
>   520ac30f4551 ("net_sched: drop packets after root qdisc lock is released")
> 
> from the net-next tree.
> 
> I fixed it up (see below) and can carry the fix as necessary. This
> is now fixed as far as linux-next is concerned, but any non trivial
> conflicts should be mentioned to your upstream maintainer when your tree
> is submitted for merging.  You may also want to consider cooperating
> with the maintainer of the conflicting tree to minimise any particularly
> complex conflicts.
> 

Looks good, although the 'use after free' does not happen anymore on
net-next since we defer skb freeing.

I spotted the bug in stable tree when cooking the net-next patch
actually ;)

Thanks.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web