linux/net/sched
Jesper Dangaard Brouer 84c46dd865 qdisc: catch misconfig of attaching qdisc to tx_queue_len zero device
It is a clear misconfiguration to attach a qdisc to a device with
tx_queue_len zero, because some qdisc's (namely, pfifo, bfifo, gred,
htb, plug and sfb) inherit/copy this value as their queue length.

Why should the kernel catch such a misconfiguration?  Because prior to
introducing the IFF_NO_QUEUE device flag, userspace found a loophole
in the qdisc config system that allowed them to achieve the equivalent
of IFF_NO_QUEUE, which is to remove the qdisc code path entirely from
a device.  The loophole on older kernels is setting tx_queue_len=0,
*prior* to device qdisc init (the config time is significant, simply
setting tx_queue_len=0 doesn't trigger the loophole).

This loophole is currently used by Docker[1] to get better performance
and scalability out of the veth device.  The Docker developers were
warned[1] that they needed to adjust the tx_queue_len if ever
attaching a qdisc.  The OpenShift project didn't remember this warning
and attached a qdisc, this were caught and fixed in[2].

[1] https://github.com/docker/libcontainer/pull/193
[2] https://github.com/openshift/origin/pull/11126

Instead of fixing every userspace program that used this loophole, and
forgot to reset the tx_queue_len, prior to attaching a qdisc.  Let's
catch the misconfiguration on the kernel side.

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-11-07 20:15:55 -05:00
..
act_api.c net_sched actions: use nla_parse_nested() 2016-10-29 15:01:01 -04:00
act_bpf.c netlink: Add nla_memdup() to wrap kmemdup() use on nlattr 2016-10-29 14:57:42 -04:00
act_connmark.c net_sched: move tc_action into tcf_common 2016-07-25 21:49:19 -07:00
act_csum.c net sched: stylistic cleanups 2016-09-19 22:04:14 -04:00
act_gact.c net sched: stylistic cleanups 2016-09-19 22:04:14 -04:00
act_ife.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-10-02 22:20:41 -04:00
act_ipt.c net_sched: move tc_action into tcf_common 2016-07-25 21:49:19 -07:00
act_meta_mark.c
act_meta_skbprio.c
act_meta_skbtcindex.c net sched ife action: Introduce skb tcindex metadata encap decap 2016-09-19 21:55:28 -04:00
act_mirred.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-10-30 12:42:58 -04:00
act_nat.c net_sched: move tc_action into tcf_common 2016-07-25 21:49:19 -07:00
act_pedit.c net_sched: move tc_action into tcf_common 2016-07-25 21:49:19 -07:00
act_police.c net sched: stylistic cleanups 2016-09-19 22:04:14 -04:00
act_simple.c net_sched: move tc_action into tcf_common 2016-07-25 21:49:19 -07:00
act_skbedit.c skbedit: allow the user to specify bitmask for mark 2016-10-27 16:07:25 -04:00
act_skbmod.c net_sched: Introduce skbmod action 2016-09-15 19:33:47 -04:00
act_tunnel_key.c net/sched: act_tunnel_key: Remove rcu_read_lock protection 2016-09-15 19:18:18 -04:00
act_vlan.c net/sched: act_vlan: Push skb->data to mac_header prior calling skb_vlan_*() functions 2016-10-03 21:40:50 -04:00
cls_api.c net sched filters: fix notification of filter delete with proper handle 2016-10-27 17:12:33 -04:00
cls_basic.c net_sched: properly handle failure case of tcf_exts_init() 2016-08-22 17:02:31 -07:00
cls_bpf.c netlink: Add nla_memdup() to wrap kmemdup() use on nlattr 2016-10-29 14:57:42 -04:00
cls_cgroup.c net_sched: properly handle failure case of tcf_exts_init() 2016-08-22 17:02:31 -07:00
cls_flow.c net sched: stylistic cleanups 2016-09-19 22:04:14 -04:00
cls_flower.c net/sched: cls_flower: Support matching on SCTP ports 2016-11-03 16:26:39 -04:00
cls_fw.c net sched: stylistic cleanups 2016-09-19 22:04:14 -04:00
cls_matchall.c net/sched: Add match-all classifier hw offloading. 2016-07-24 23:11:59 -07:00
cls_route.c net_sched: check NULL on error path in route4_change() 2016-09-23 06:51:49 -04:00
cls_rsvp6.c
cls_rsvp.c [NET_SCHED]: Remove unnecessary includes 2007-07-10 22:16:41 -07:00
cls_rsvp.h net_sched: properly handle failure case of tcf_exts_init() 2016-08-22 17:02:31 -07:00
cls_tcindex.c net sched: stylistic cleanups 2016-09-19 22:04:14 -04:00
cls_u32.c net sched: stylistic cleanups 2016-09-19 22:04:14 -04:00
em_canid.c
em_cmp.c
em_ipset.c
em_meta.c net/sched: em_meta: Fix 'meta vlan' to correctly recognize zero VID frames 2016-10-23 17:31:25 -04:00
em_nbyte.c
em_text.c
em_u32.c
ematch.c
Kconfig net sched ife action: Introduce skb tcindex metadata encap decap 2016-09-19 21:55:28 -04:00
Makefile net sched ife action: Introduce skb tcindex metadata encap decap 2016-09-19 21:55:28 -04:00
sch_api.c qdisc: catch misconfig of attaching qdisc to tx_queue_len zero device 2016-11-07 20:15:55 -05:00
sch_atm.c
sch_blackhole.c
sch_cbq.c
sch_choke.c
sch_codel.c sched: replace __skb_dequeue with __qdisc_dequeue_head 2016-09-19 01:47:18 -04:00
sch_drr.c
sch_dsmark.c
sch_fifo.c sched: don't use skb queue helpers 2016-09-19 01:47:18 -04:00
sch_fq_codel.c
sch_fq.c net_sched: sch_fq: account for schedule/timers drifts 2016-09-23 07:19:06 -04:00
sch_generic.c sched: add and use qdisc_skb_head helpers 2016-09-19 01:47:18 -04:00
sch_gred.c
sch_hfsc.c net/sched/sch_hfsc.c: remove unused cl_myfadj 2016-08-08 16:06:47 -07:00
sch_hhf.c
sch_htb.c sch_htb: do not report fake rate estimators 2016-10-26 17:13:49 -04:00
sch_ingress.c
sch_mq.c net: sched: convert qdisc linked list to hashtable 2016-08-10 17:19:02 -07:00
sch_mqprio.c net: sched: convert qdisc linked list to hashtable 2016-08-10 17:19:02 -07:00
sch_multiq.c
sch_netem.c sched: add and use qdisc_skb_head helpers 2016-09-19 01:47:18 -04:00
sch_pie.c sched: replace __skb_dequeue with __qdisc_dequeue_head 2016-09-19 01:47:18 -04:00
sch_plug.c
sch_prio.c
sch_qfq.c sch_qfq: keep backlog updated with qlen 2016-09-23 06:52:31 -04:00
sch_red.c
sch_sfb.c sch_sfb: keep backlog updated with qlen 2016-09-23 06:52:31 -04:00
sch_sfq.c
sch_tbf.c
sch_teql.c net: use core MTU range checking in core net infra 2016-10-20 14:51:09 -04:00