Skip to contentSkip to conversation

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

DISCUSSION Stephen Rothwell 2 participants 2 messages Jun 27, 2016

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

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.

Signature · 32 lines
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;
  			}
#1 lore raw
Quoted 14 lines · Stephen Rothwell

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")

Quoted 9 lines

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.