linux/net/sched
Jiri Pirko 94e2557d08 net: sched: move block device tracking into tcf_block_get/put_ext()
Inserting the device to block xarray in qdisc_create() is not suitable
place to do this. As it requires use of tcf_block() callback, it causes
multiple issues. It is called for all qdisc types, which is incorrect.

So, instead, move it to more suitable place, which is tcf_block_get_ext()
and make sure it is only done for qdiscs that use block infrastructure
and also only for blocks which are shared.

Symmetrically, alter the cleanup path, move the xarray entry removal
into tcf_block_put_ext().

Fixes: 913b47d342 ("net/sched: Introduce tc block netdev tracking infra")
Reported-by: Ido Schimmel <idosch@nvidia.com>
Closes: https://lore.kernel.org/all/ZY1hBb8GFwycfgvd@shredder/
Reported-by: Kui-Feng Lee <sinquersw@gmail.com>
Closes: https://lore.kernel.org/all/ce8d3e55-b8bc-409c-ace9-5cf1c4f7c88e@gmail.com/
Reported-and-tested-by: syzbot+84339b9e7330daae4d66@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/all/0000000000007c85f5060dcc3a28@google.com/
Reported-and-tested-by: syzbot+806b0572c8d06b66b234@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/all/00000000000082f2f2060dcc3a92@google.com/
Reported-and-tested-by: syzbot+0039110f932d438130f9@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/all/0000000000007fbc8c060dcc3a5c@google.com/
Signed-off-by: Jiri Pirko <jiri@nvidia.com>
Tested-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Victor Nogueira <victor@mojatatu.com>
Tested-by: Victor Nogueira <victor@mojatatu.com>
Reviewed-by: Jamal Hadi Salim <jhs@mojatatu.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2024-01-05 11:19:08 +00:00
..
act_api.c net/sched: introduce ACT_P_BOUND return code 2024-01-03 18:36:24 -08:00
act_bpf.c net/sched: introduce ACT_P_BOUND return code 2024-01-03 18:36:24 -08:00
act_connmark.c net/sched: introduce ACT_P_BOUND return code 2024-01-03 18:36:24 -08:00
act_csum.c net/sched: introduce ACT_P_BOUND return code 2024-01-03 18:36:24 -08:00
act_ct.c net/sched: introduce ACT_P_BOUND return code 2024-01-03 18:36:24 -08:00
act_ctinfo.c net/sched: introduce ACT_P_BOUND return code 2024-01-03 18:36:24 -08:00
act_gact.c net/sched: introduce ACT_P_BOUND return code 2024-01-03 18:36:24 -08:00
act_gate.c net/sched: introduce ACT_P_BOUND return code 2024-01-03 18:36:24 -08:00
act_ife.c net/sched: introduce ACT_P_BOUND return code 2024-01-03 18:36:24 -08:00
act_meta_mark.c
act_meta_skbprio.c
act_meta_skbtcindex.c
act_mirred.c net/sched: introduce ACT_P_BOUND return code 2024-01-03 18:36:24 -08:00
act_mpls.c net/sched: introduce ACT_P_BOUND return code 2024-01-03 18:36:24 -08:00
act_nat.c net/sched: introduce ACT_P_BOUND return code 2024-01-03 18:36:24 -08:00
act_pedit.c net/sched: introduce ACT_P_BOUND return code 2024-01-03 18:36:24 -08:00
act_police.c net/sched: introduce ACT_P_BOUND return code 2024-01-03 18:36:24 -08:00
act_sample.c net/sched: introduce ACT_P_BOUND return code 2024-01-03 18:36:24 -08:00
act_simple.c net/sched: introduce ACT_P_BOUND return code 2024-01-03 18:36:24 -08:00
act_skbedit.c net/sched: introduce ACT_P_BOUND return code 2024-01-03 18:36:24 -08:00
act_skbmod.c net/sched: introduce ACT_P_BOUND return code 2024-01-03 18:36:24 -08:00
act_tunnel_key.c net/sched: introduce ACT_P_BOUND return code 2024-01-03 18:36:24 -08:00
act_vlan.c net/sched: introduce ACT_P_BOUND return code 2024-01-03 18:36:24 -08:00
cls_api.c net: sched: move block device tracking into tcf_block_get/put_ext() 2024-01-05 11:19:08 +00:00
cls_basic.c net: sched: Fill in missing MODULE_DESCRIPTION for classifiers 2023-11-01 21:49:09 -07:00
cls_bpf.c net: sched: cls_bpf: Undo tcf_bind_filter in case of an error 2023-07-17 07:33:39 +01:00
cls_cgroup.c net: sched: Fill in missing MODULE_DESCRIPTION for classifiers 2023-11-01 21:49:09 -07:00
cls_flow.c treewide: Convert del_timer*() to timer_shutdown*() 2022-12-25 13:38:09 -08:00
cls_flower.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-08-03 14:34:37 -07:00
cls_fw.c net: sched: Fill in missing MODULE_DESCRIPTION for classifiers 2023-11-01 21:49:09 -07:00
cls_matchall.c net: sched: cls_matchall: Undo tcf_bind_filter in case of failure after mall_set_parms 2023-07-17 07:33:38 +01:00
cls_route.c net: sched: Fill in missing MODULE_DESCRIPTION for classifiers 2023-11-01 21:49:09 -07:00
cls_u32.c net/sched: cls_u32: replace int refcounts with proper refcounts 2023-11-18 19:38:23 -08:00
em_canid.c
em_cmp.c net: sched: fix misspellings using misspell-fixer tool 2020-11-10 17:00:28 -08:00
em_ipset.c
em_ipt.c
em_meta.c net: implement lockless SO_PRIORITY 2023-10-01 19:09:54 +01:00
em_nbyte.c net: sched: Return the correct errno code 2021-02-06 11:15:28 -08:00
em_text.c net: sched: em_text: fix possible memory leak in em_text_destroy() 2024-01-01 13:08:15 +00:00
em_u32.c
ematch.c net_sched: reject TCF_EM_SIMPLE case for complex ematch module 2022-12-19 09:43:18 +00:00
Kconfig bpf: Add fd-based tcx multi-prog infra with link support 2023-07-19 10:07:27 -07:00
Makefile net/sched: Retire ipt action 2024-01-02 12:41:16 +00:00
sch_api.c net: sched: move block device tracking into tcf_block_get/put_ext() 2024-01-05 11:19:08 +00:00
sch_blackhole.c
sch_cake.c net: move gso declarations and functions to their own files 2023-06-10 00:11:41 -07:00
sch_cbs.c net/sched: cbs: Use units.h instead of the copy of a definition 2023-11-30 23:15:48 -08:00
sch_choke.c net: sched: Fill in missing MODULE_DESCRIPTION for qdiscs 2023-11-01 21:49:09 -07:00
sch_codel.c net: sched: remove redundant NULL check in change hook function 2022-09-01 08:06:45 +02:00
sch_drr.c net: sched: Fill in missing MODULE_DESCRIPTION for qdiscs 2023-11-01 21:49:09 -07:00
sch_etf.c net: sched: Fill in missing MODULE_DESCRIPTION for qdiscs 2023-11-01 21:49:09 -07:00
sch_ets.c net: sched: Fill in missing MODULE_DESCRIPTION for qdiscs 2023-11-01 21:49:09 -07:00
sch_fifo.c net: sched: Fill in missing MODULE_DESCRIPTION for qdiscs 2023-11-01 21:49:09 -07:00
sch_fq.c net_sched: sch_fq: better validate TCA_FQ_WEIGHTS and TCA_FQ_PRIOMAP 2023-11-08 18:30:21 -08:00
sch_fq_codel.c Revert "net: sched: fq_codel: remove redundant resource cleanup in fq_codel_init()" 2022-10-19 13:47:09 +01:00
sch_fq_pie.c netlink: make range pointers in policies const 2023-10-26 16:24:09 -07:00
sch_frag.c net: dst: remove unnecessary input parameter in dst_alloc and dst_init 2023-09-12 11:42:25 +02:00
sch_generic.c net: sched: move block device tracking into tcf_block_get/put_ext() 2024-01-05 11:19:08 +00:00
sch_gred.c net: sched: Fill in missing MODULE_DESCRIPTION for qdiscs 2023-11-01 21:49:09 -07:00
sch_hfsc.c net: sched: Fill in missing MODULE_DESCRIPTION for qdiscs 2023-11-01 21:49:09 -07:00
sch_hhf.c net: sched: remove redundant NULL check in change hook function 2022-09-01 08:06:45 +02:00
sch_htb.c net: sched: Fill in missing MODULE_DESCRIPTION for qdiscs 2023-11-01 21:49:09 -07:00
sch_ingress.c net: sched: Fill in missing MODULE_DESCRIPTION for qdiscs 2023-11-01 21:49:09 -07:00
sch_mq.c net: sched: add rcu annotations around qdisc->qdisc_sleeping 2023-06-07 10:25:39 +01:00
sch_mqprio.c net: sched: Fill in missing MODULE_DESCRIPTION for qdiscs 2023-11-01 21:49:09 -07:00
sch_mqprio_lib.c net: sched: Fill in missing MODULE_DESCRIPTION for qdiscs 2023-11-01 21:49:09 -07:00
sch_mqprio_lib.h net/sched: mqprio: allow per-TC user input of FP adminStatus 2023-04-13 22:22:10 -07:00
sch_multiq.c net: sched: Fill in missing MODULE_DESCRIPTION for qdiscs 2023-11-01 21:49:09 -07:00
sch_netem.c net: sched: Fill in missing MODULE_DESCRIPTION for qdiscs 2023-11-01 21:49:09 -07:00
sch_pie.c net: sched: add rcu annotations around qdisc->qdisc_sleeping 2023-06-07 10:25:39 +01:00
sch_plug.c net: sched: Fill in missing MODULE_DESCRIPTION for qdiscs 2023-11-01 21:49:09 -07:00
sch_prio.c net: sched: Fill in missing MODULE_DESCRIPTION for qdiscs 2023-11-01 21:49:09 -07:00
sch_qfq.c net: sched: Fill in missing MODULE_DESCRIPTION for qdiscs 2023-11-01 21:49:09 -07:00
sch_red.c net: sched: Fill in missing MODULE_DESCRIPTION for qdiscs 2023-11-01 21:49:09 -07:00
sch_sfb.c Networking fixes for 6.1-rc2, including fixes from netfilter 2022-10-20 17:24:59 -07:00
sch_sfq.c net: sched: Fill in missing MODULE_DESCRIPTION for qdiscs 2023-11-01 21:49:09 -07:00
sch_skbprio.c net: sched: Fill in missing MODULE_DESCRIPTION for qdiscs 2023-11-01 21:49:09 -07:00
sch_taprio.c net: sched: Fill in missing MODULE_DESCRIPTION for qdiscs 2023-11-01 21:49:09 -07:00
sch_tbf.c net: sched: Fill in missing MODULE_DESCRIPTION for qdiscs 2023-11-01 21:49:09 -07:00
sch_teql.c net: sched: Fill in missing MODULE_DESCRIPTION for qdiscs 2023-11-01 21:49:09 -07:00