Skip to content

Commit

Permalink
compat: Unlock qdisc root lock in case of failure when dumping stats.
Browse files Browse the repository at this point in the history
Linux versions prior to 4.8 have a bug where the root qdisc lock is
not released in tc_fill_qdisc (in sch_api.c) in some failure cases.
This can cause a lockup when dumping cake stats from multiple
qdiscs, for example. Fix this by explicitly unlocking the qdisc
lock in the failure case.
  • Loading branch information
heistp committed Mar 4, 2019
1 parent 29d707e commit 65d6571
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sch_cake.c
Expand Up @@ -3049,6 +3049,9 @@ static int cake_dump_stats(struct Qdisc *sch, struct gnet_dump *d)

nla_put_failure:
nla_nest_cancel(d->skb, stats);
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0)
sch_tree_unlock(sch);
#endif
return -1;
}

Expand Down

0 comments on commit 65d6571

Please sign in to comment.