alistair23-linux/net/sched
Jiri Pirko 80532384af net: sched: fix memleak for chain zero
There's a memleak happening for chain 0. The thing is, chain 0 needs to
be always present, not created on demand. Therefore tcf_block_get upon
creation of block calls the tcf_chain_create function directly. The
chain is created with refcnt == 1, which is not correct in this case and
causes the memleak. So move the refcnt increment into tcf_chain_get
function even for the case when chain needs to be created.

Reported-by: Jakub Kicinski <kubakici@wp.pl>
Fixes: 5bc1701881 ("net: sched: introduce multichain support for filters")
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Tested-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-09-07 19:17:20 -07:00
..
act_api.c net: sched: don't use GFP_KERNEL under spin lock 2017-09-05 14:48:29 -07:00
act_bpf.c net/sched: Change act_api and act_xxx modules to use IDR 2017-08-30 14:38:51 -07:00
act_connmark.c net/sched: Change act_api and act_xxx modules to use IDR 2017-08-30 14:38:51 -07:00
act_csum.c net/sched: Change act_api and act_xxx modules to use IDR 2017-08-30 14:38:51 -07:00
act_gact.c net/sched: Change act_api and act_xxx modules to use IDR 2017-08-30 14:38:51 -07:00
act_ife.c net/sched: Change act_api and act_xxx modules to use IDR 2017-08-30 14:38:51 -07:00
act_ipt.c net/sched: Change act_api and act_xxx modules to use IDR 2017-08-30 14:38:51 -07:00
act_meta_mark.c
act_meta_skbprio.c
act_meta_skbtcindex.c
act_mirred.c net/sched: Change act_api and act_xxx modules to use IDR 2017-08-30 14:38:51 -07:00
act_nat.c net/sched: Change act_api and act_xxx modules to use IDR 2017-08-30 14:38:51 -07:00
act_pedit.c net/sched: Change act_api and act_xxx modules to use IDR 2017-08-30 14:38:51 -07:00
act_police.c net/sched: Change act_api and act_xxx modules to use IDR 2017-08-30 14:38:51 -07:00
act_sample.c net/sched: Change act_api and act_xxx modules to use IDR 2017-08-30 14:38:51 -07:00
act_simple.c net/sched: Change act_api and act_xxx modules to use IDR 2017-08-30 14:38:51 -07:00
act_skbedit.c net/sched: Change act_api and act_xxx modules to use IDR 2017-08-30 14:38:51 -07:00
act_skbmod.c net/sched: Change act_api and act_xxx modules to use IDR 2017-08-30 14:38:51 -07:00
act_tunnel_key.c net/sched: Change act_api and act_xxx modules to use IDR 2017-08-30 14:38:51 -07:00
act_vlan.c net/sched: Change act_api and act_xxx modules to use IDR 2017-08-30 14:38:51 -07:00
cls_api.c net: sched: fix memleak for chain zero 2017-09-07 19:17:20 -07:00
cls_basic.c net_sched: add reverse binding for tc class 2017-08-31 11:40:52 -07:00
cls_bpf.c net_sched: add reverse binding for tc class 2017-08-31 11:40:52 -07:00
cls_cgroup.c net_sched: use void pointer for filter handle 2017-08-07 14:12:17 -07:00
cls_flow.c net_sched: use void pointer for filter handle 2017-08-07 14:12:17 -07:00
cls_flower.c net_sched: add reverse binding for tc class 2017-08-31 11:40:52 -07:00
cls_fw.c net_sched: add reverse binding for tc class 2017-08-31 11:40:52 -07:00
cls_matchall.c net_sched: add reverse binding for tc class 2017-08-31 11:40:52 -07:00
cls_route.c net_sched: add reverse binding for tc class 2017-08-31 11:40:52 -07:00
cls_rsvp.c
cls_rsvp.h net_sched: add reverse binding for tc class 2017-08-31 11:40:52 -07:00
cls_rsvp6.c
cls_tcindex.c net_sched: add reverse binding for tc class 2017-08-31 11:40:52 -07:00
cls_u32.c net_sched: add reverse binding for tc class 2017-08-31 11:40:52 -07:00
em_canid.c
em_cmp.c
em_ipset.c
em_meta.c
em_nbyte.c
em_text.c
em_u32.c
ematch.c
Kconfig
Makefile
sch_api.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-09-01 17:42:05 -07:00
sch_atm.c net_sched: remove tc class reference counting 2017-08-25 17:19:10 -07:00
sch_blackhole.c
sch_cbq.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-09-01 17:42:05 -07:00
sch_choke.c
sch_codel.c
sch_drr.c net_sched: remove tc class reference counting 2017-08-25 17:19:10 -07:00
sch_dsmark.c net_sched: remove tc class reference counting 2017-08-25 17:19:10 -07:00
sch_fifo.c
sch_fq.c
sch_fq_codel.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-09-01 17:42:05 -07:00
sch_generic.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-09-01 17:42:05 -07:00
sch_gred.c
sch_hfsc.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-09-01 17:42:05 -07:00
sch_hhf.c sch_hhf: fix null pointer dereference on init failure 2017-08-30 15:26:11 -07:00
sch_htb.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-09-01 17:42:05 -07:00
sch_ingress.c net_sched: remove tc class reference counting 2017-08-25 17:19:10 -07:00
sch_mq.c net_sched: remove tc class reference counting 2017-08-25 17:19:10 -07:00
sch_mqprio.c net_sched: remove tc class reference counting 2017-08-25 17:19:10 -07:00
sch_multiq.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-09-01 17:42:05 -07:00
sch_netem.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-09-01 17:42:05 -07:00
sch_pie.c
sch_plug.c
sch_prio.c sched: Use __qdisc_drop instead of kfree_skb in sch_prio and sch_qfq 2017-09-06 21:20:07 -07:00
sch_qfq.c sched: Use __qdisc_drop instead of kfree_skb in sch_prio and sch_qfq 2017-09-06 21:20:07 -07:00
sch_red.c net_sched: remove tc class reference counting 2017-08-25 17:19:10 -07:00
sch_sfb.c net_sched: remove tc class reference counting 2017-08-25 17:19:10 -07:00
sch_sfq.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-09-01 17:42:05 -07:00
sch_tbf.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-09-01 17:42:05 -07:00
sch_teql.c