TencentOS-kernel/net/sched
Thadeu Lima de Souza Cascardo b3d85fe8ab net_sched: cls_route: remove from list when handle is 0
upstream: 9ad36309e2719a884f946678e0296be10f0bb4c1

When a route filter is replaced and the old filter has a 0 handle, the old
one won't be removed from the hashtable, while it will still be freed.

The test was there since before commit 1109c00547fc ("net: sched: RCU
cls_route"), when a new filter was not allocated when there was an old one.
The old filter was reused and the reinserting would only be necessary if an
old filter was replaced. That was still wrong for the same case where the
old handle was 0.

Remove the old filter from the list independently from its handle value.

This fixes CVE-2022-2588, also reported as ZDI-CAN-17440.

Reported-by: Zhenpeng Lin <zplin@u.northwestern.edu>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Reviewed-by: Kamal Mostafa <kamal@canonical.com>
Cc: <stable@vger.kernel.org>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Link: https://lore.kernel.org/r/20220809170518.164662-1-cascardo@canonical.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Bin Lai <robinlai@tencent.com>
2022-08-30 17:34:06 +08:00
..
Kconfig Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
Makefile Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
act_api.c net: sched: bump refcount for new action in ACT replace mode 2021-05-20 16:07:03 +08:00
act_bpf.c bpf: Add socket assign support 2022-06-21 10:27:10 +08:00
act_connmark.c net_sched: defer tcf_idr_insert() in tcf_action_init_1() 2021-03-16 16:38:07 +08:00
act_csum.c net_sched: defer tcf_idr_insert() in tcf_action_init_1() 2021-03-16 16:38:07 +08:00
act_ct.c net_sched: defer tcf_idr_insert() in tcf_action_init_1() 2021-03-16 16:38:07 +08:00
act_ctinfo.c net_sched: defer tcf_idr_insert() in tcf_action_init_1() 2021-03-16 16:38:07 +08:00
act_gact.c net_sched: defer tcf_idr_insert() in tcf_action_init_1() 2021-03-16 16:38:07 +08:00
act_ife.c net_sched: defer tcf_idr_insert() in tcf_action_init_1() 2021-03-16 16:38:07 +08:00
act_ipt.c net_sched: defer tcf_idr_insert() in tcf_action_init_1() 2021-03-16 16:38:07 +08:00
act_meta_mark.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
act_meta_skbprio.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
act_meta_skbtcindex.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
act_mirred.c net_sched: defer tcf_idr_insert() in tcf_action_init_1() 2021-03-16 16:38:07 +08:00
act_mpls.c net/sched: act_mpls: ensure LSE is pullable before reading it 2021-03-16 16:41:57 +08:00
act_nat.c net_sched: defer tcf_idr_insert() in tcf_action_init_1() 2021-03-16 16:38:07 +08:00
act_pedit.c net_sched: defer tcf_idr_insert() in tcf_action_init_1() 2021-03-16 16:38:07 +08:00
act_police.c net_sched: defer tcf_idr_insert() in tcf_action_init_1() 2021-03-16 16:38:07 +08:00
act_sample.c net_sched: defer tcf_idr_insert() in tcf_action_init_1() 2021-03-16 16:38:07 +08:00
act_simple.c net_sched: defer tcf_idr_insert() in tcf_action_init_1() 2021-03-16 16:38:07 +08:00
act_skbedit.c net_sched: defer tcf_idr_insert() in tcf_action_init_1() 2021-03-16 16:38:07 +08:00
act_skbmod.c net_sched: defer tcf_idr_insert() in tcf_action_init_1() 2021-03-16 16:38:07 +08:00
act_tunnel_key.c net/sched: act_tunnel_key: fix OOB write in case of IPv6 ERSPAN tunnels 2021-03-16 16:38:17 +08:00
act_vlan.c net_sched: defer tcf_idr_insert() in tcf_action_init_1() 2021-03-16 16:38:07 +08:00
cls_api.c net: sched: fix police ext initialization 2021-04-12 12:52:42 +08:00
cls_basic.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
cls_bpf.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
cls_cgroup.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
cls_flow.c sched: consistently handle layer3 header accesses in the presence of VLANs 2021-03-16 16:31:44 +08:00
cls_flower.c sched: consistently handle layer3 header accesses in the presence of VLANs 2021-03-16 16:31:44 +08:00
cls_fw.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
cls_matchall.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
cls_route.c net_sched: cls_route: remove from list when handle is 0 2022-08-30 17:34:06 +08:00
cls_rsvp.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
cls_rsvp.h Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
cls_rsvp6.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
cls_tcindex.c net_sched: avoid shift-out-of-bounds in tcindex_set_parms() 2021-04-12 12:51:39 +08:00
cls_u32.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
em_canid.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
em_cmp.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
em_ipset.c sched: consistently handle layer3 header accesses in the presence of VLANs 2021-03-16 16:31:44 +08:00
em_ipt.c sched: consistently handle layer3 header accesses in the presence of VLANs 2021-03-16 16:31:44 +08:00
em_meta.c sched: consistently handle layer3 header accesses in the presence of VLANs 2021-03-16 16:31:44 +08:00
em_nbyte.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
em_text.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
em_u32.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
ematch.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
sch_api.c net: sched: avoid duplicates in classes dump 2021-04-12 12:52:58 +08:00
sch_atm.c net_sched: fix a memory leak in atm_tc_init() 2021-03-16 16:31:44 +08:00
sch_blackhole.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
sch_cake.c sched: consistently handle layer3 header accesses in the presence of VLANs 2021-03-16 16:31:44 +08:00
sch_cbq.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
sch_cbs.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
sch_choke.c net: sched: validate stab values 2021-04-12 12:53:27 +08:00
sch_codel.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
sch_drr.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
sch_dsmark.c sched: consistently handle layer3 header accesses in the presence of VLANs 2021-03-16 16:31:44 +08:00
sch_etf.c sched: etf: do not assume all sockets are full blown 2021-03-16 16:26:52 +08:00
sch_fifo.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
sch_fq.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
sch_fq_codel.c fq_codel: fix TCA_FQ_CODEL_DROP_BATCH_SIZE sanity checks 2021-03-16 16:27:33 +08:00
sch_generic.c net: sch_generic: fix the missing new qdisc assignment bug 2021-03-16 16:41:00 +08:00
sch_gred.c net: sched: validate stab values 2021-04-12 12:53:27 +08:00
sch_hfsc.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
sch_hhf.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
sch_htb.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
sch_ingress.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
sch_mq.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
sch_mqprio.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
sch_multiq.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
sch_netem.c netem: fix zero division in tabledist 2021-03-16 16:39:31 +08:00
sch_pie.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
sch_plug.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
sch_prio.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
sch_qfq.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
sch_red.c net: sched: validate stab values 2021-04-12 12:53:27 +08:00
sch_sfb.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
sch_sfq.c net: sched: validate stab values 2021-04-12 12:53:27 +08:00
sch_skbprio.c net_sched: sch_skbprio: add message validation to skbprio_change() 2021-03-16 16:27:34 +08:00
sch_taprio.c net/sched: sch_taprio: ensure to reset/destroy all child qdiscs 2021-04-12 12:51:10 +08:00
sch_tbf.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
sch_teql.c net: sched: sch_teql: fix null-pointer dereference 2021-05-20 16:06:57 +08:00