openwrt/target/linux/generic/backport-4.19
Kevin Darbyshire-Bryant 7a57e82f28 kernel: act_ctinfo: backport memory leak fix
[ Upstream commit 09d4f10a5e78d76a53e3e584f1e6a701b6d24108 ]

Implement a cleanup method to properly free ci->params

BUG: memory leak
unreferenced object 0xffff88811746e2c0 (size 64):
 comm "syz-executor617", pid 7106, jiffies 4294943055 (age 14.250s)
 hex dump (first 32 bytes):
   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
   c0 34 60 84 ff ff ff ff 00 00 00 00 00 00 00 00  .4`.............
 backtrace:
   [<0000000015aa236f>] kmemleak_alloc_recursive include/linux/kmemleak.h:43 [inline]
   [<0000000015aa236f>] slab_post_alloc_hook mm/slab.h:586 [inline]
   [<0000000015aa236f>] slab_alloc mm/slab.c:3320 [inline]
   [<0000000015aa236f>] kmem_cache_alloc_trace+0x145/0x2c0 mm/slab.c:3549
   [<000000002c946bd1>] kmalloc include/linux/slab.h:556 [inline]
   [<000000002c946bd1>] kzalloc include/linux/slab.h:670 [inline]
   [<000000002c946bd1>] tcf_ctinfo_init+0x21a/0x530 net/sched/act_ctinfo.c:236
   [<0000000086952cca>] tcf_action_init_1+0x400/0x5b0 net/sched/act_api.c:944
   [<000000005ab29bf8>] tcf_action_init+0x135/0x1c0 net/sched/act_api.c:1000
   [<00000000392f56f9>] tcf_action_add+0x9a/0x200 net/sched/act_api.c:1410
   [<0000000088f3c5dd>] tc_ctl_action+0x14d/0x1bb net/sched/act_api.c:1465
   [<000000006b39d986>] rtnetlink_rcv_msg+0x178/0x4b0 net/core/rtnetlink.c:5424
   [<00000000fd6ecace>] netlink_rcv_skb+0x61/0x170 net/netlink/af_netlink.c:2477
   [<0000000047493d02>] rtnetlink_rcv+0x1d/0x30 net/core/rtnetlink.c:5442
   [<00000000bdcf8286>] netlink_unicast_kernel net/netlink/af_netlink.c:1302 [inline]
   [<00000000bdcf8286>] netlink_unicast+0x223/0x310 net/netlink/af_netlink.c:1328
   [<00000000fc5b92d9>] netlink_sendmsg+0x2c0/0x570 net/netlink/af_netlink.c:1917
   [<00000000da84d076>] sock_sendmsg_nosec net/socket.c:639 [inline]
   [<00000000da84d076>] sock_sendmsg+0x54/0x70 net/socket.c:659
   [<0000000042fb2eee>] ____sys_sendmsg+0x2d0/0x300 net/socket.c:2330
   [<000000008f23f67e>] ___sys_sendmsg+0x8a/0xd0 net/socket.c:2384
   [<00000000d838e4f6>] __sys_sendmsg+0x80/0xf0 net/socket.c:2417
   [<00000000289a9cb1>] __do_sys_sendmsg net/socket.c:2426 [inline]
   [<00000000289a9cb1>] __se_sys_sendmsg net/socket.c:2424 [inline]
   [<00000000289a9cb1>] __x64_sys_sendmsg+0x23/0x30 net/socket.c:2424

Fixes: 24ec483cec98 ("net: sched: Introduce act_ctinfo action")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: syzbot <syzkaller@googlegroups.com>
Cc: Kevin 'ldir' Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
Cc: Cong Wang <xiyou.wangcong@gmail.com>
Cc: Toke Høiland-Jørgensen <toke@redhat.com>
Acked-by: Kevin 'ldir' Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
2020-01-24 11:25:26 +00:00
..
010-Kbuild-don-t-hardcode-path-to-awk-in-scripts-ld-vers.patch
011-kbuild-export-SUBARCH.patch kernel: bump 4.19 to 4.19.65 2019-08-09 18:30:33 +02:00
020-backport_netfilter_rtcache.patch kernel: nf_conntrack_rtcache: fix WARNING on rmmod 2019-11-23 18:07:14 +00:00
047-v4.21-mtd-keep-original-flags-for-every-struct-mtd_info.patch kernel: Make the patches apply on top of 4.19 2018-12-15 14:28:48 +01:00
048-v4.21-mtd-improve-calculating-partition-boundaries-when-ch.patch kernel: bump 4.19 to 4.19.23 2019-02-15 21:53:27 +01:00
080-v5.1-0001-bcma-keep-a-direct-pointer-to-the-struct-device.patch kernel: backport bcma patches that improve printing functions 2019-01-10 16:47:43 +01:00
080-v5.1-0002-bcma-use-dev_-printing-functions.patch kernel: backport bcma patches that improve printing functions 2019-01-10 16:47:43 +01:00
095-Allow-class-e-address-assignment-via-ifconfig-ioctl.patch kernel: bump 4.19 to 4.19.62 2019-07-31 16:51:46 +02:00
101-arm-cns3xxx-use-actual-size-reads-for-PCIe.patch cns3xxx: use actual size reads for PCIe (4.19) 2019-01-28 18:17:32 +01:00
200-v5.2-usb-dwc2-Set-lpm-mode-parameters-depend-on-HW-configuration.patch kernel: bump 4.19 to 4.19.86 2019-11-29 09:59:49 +01:00
210-arm64-sve-Disentangle-uapi-asm-ptrace.h-from-uapi-as.patch kernel: Fix arm64 include files 2019-10-20 12:33:40 +02:00
343-netfilter-nft_flow_offload-handle-netdevice-events-f.patch kernel: bump 4.19 to 4.19.84 2019-11-19 14:59:03 +01:00
370-netfilter-nf_flow_table-fix-offloaded-connection-tim.patch kernel: bump 4.19 to 4.19.84 2019-11-19 14:59:03 +01:00
371-netfilter-nf_flow_table-fix-up-ct-state-of-flows-aft.patch kernel: bump 4.19 to 4.19.84 2019-11-19 14:59:03 +01:00
380-v5.3-net-sched-Introduce-act_ctinfo-action.patch kernel: act_ctinfo: backport memory leak fix 2020-01-24 11:25:26 +00:00
450-v5.0-mtd-spinand-winbond-Add-support-for-W25N01GV.patch kernel: mtd: spinand: Backport chip definitions 2019-10-24 23:07:47 +02:00
451-v5.0-mtd-spinand-Add-initial-support-for-Toshiba-TC58CVG2.patch kernel: mtd: spinand: Backport chip definitions 2019-10-24 23:07:47 +02:00
452-v5.0-mtd-spinand-add-support-for-GigaDevice-GD5FxGQ4xA.patch kernel: mtd: spinand: Backport chip definitions 2019-10-24 23:07:47 +02:00
455-v5.1-mtd-spinand-Add-support-for-all-Toshiba-Memory-produ.patch kernel: mtd: spinand: Backport chip definitions 2019-10-24 23:07:47 +02:00
456-v5.1-mtd-spinand-Add-support-for-GigaDevice-GD5F1GQ4UExxG.patch kernel: mtd: spinand: Backport chip definitions 2019-10-24 23:07:47 +02:00
460-v5.0-mtd-spi-nor-Add-support-for-mx25u12835f.patch kernel: refresh patches 2019-08-24 23:11:15 +02:00
460-v5.3-mtd-spinand-Define-macros-for-page-read-ops-with-thr.patch kernel: mtd: spinand: Backport chip definitions 2019-10-24 23:07:47 +02:00
461-v5.3-mtd-spinand-Add-support-for-two-byte-device-IDs.patch kernel: mtd: spinand: Backport chip definitions 2019-10-24 23:07:47 +02:00
462-v5.3-mtd-spinand-Add-support-for-GigaDevice-GD5F1GQ4UFxxG.patch kernel: mtd: spinand: Backport chip definitions 2019-10-24 23:07:47 +02:00
463-v5.3-mtd-spinand-Add-initial-support-for-Paragon-PN26G0xA.patch kernel: mtd: spinand: Backport chip definitions 2019-10-24 23:07:47 +02:00
700-v5.1-net-phylink-only-call-mac_config-during-resolve-when.patch kernel: move phylink patches from mvebu to generic 2020-01-21 22:32:48 +01:00
701-v5.2-net-phylink-ensure-inband-AN-works-correctly.patch kernel: move phylink patches from mvebu to generic 2020-01-21 22:32:48 +01:00
702-v4.20-net-ethernet-Add-helper-for-MACs-which-support-asym-.patch kernel: add backported phy/phylink/sfp patches 2020-01-21 22:32:48 +01:00
703-v4.20-net-ethernet-Add-helper-for-set_pauseparam-for-Asym-.patch kernel: add backported phy/phylink/sfp patches 2020-01-21 22:32:48 +01:00
704-v4.20-net-phy-Stop-with-excessive-soft-reset.patch kernel: add backported phy/phylink/sfp patches 2020-01-21 22:32:48 +01:00
705-v5.1-net-phy-provide-full-set-of-accessor-functions-to-MM.patch kernel: add backported phy/phylink/sfp patches 2020-01-21 22:32:48 +01:00
706-v5.1-net-phy-add-register-modifying-helpers-returning-1-o.patch kernel: add backported phy/phylink/sfp patches 2020-01-21 22:32:48 +01:00
707-v5.1-net-phy-add-genphy_c45_check_and_restart_aneg.patch kernel: add backported phy/phylink/sfp patches 2020-01-21 22:32:48 +01:00
708-v5.3-net-phylink-remove-netdev-from-phylink-mii-ioctl-emu.patch kernel: add backported phy/phylink/sfp patches 2020-01-21 22:32:48 +01:00
709-v5.3-net-phylink-support-for-link-gpio-interrupt.patch kernel: add backported phy/phylink/sfp patches 2020-01-21 22:32:48 +01:00
710-v5.3-net-phy-allow-Clause-45-access-via-mii-ioctl.patch kernel: add backported phy/phylink/sfp patches 2020-01-21 22:32:48 +01:00
711-v5.3-net-sfp-add-mandatory-attach-detach-methods-for-sfp-.patch kernel: add backported phy/phylink/sfp patches 2020-01-21 22:32:48 +01:00
712-v5.3-net-sfp-remove-sfp-bus-use-of-netdevs.patch kernel: add backported phy/phylink/sfp patches 2020-01-21 22:32:48 +01:00
713-v5.2-net-phylink-avoid-reducing-support-mask.patch kernel: add backported phy/phylink/sfp patches 2020-01-21 22:32:48 +01:00
714-v5.3-net-sfp-Stop-SFP-polling-and-interrupt-handling-duri.patch kernel: add backported phy/phylink/sfp patches 2020-01-21 22:32:48 +01:00
715-v5.3-net-phylink-don-t-start-and-stop-SGMII-PHYs-in-SFP-m.patch kernel: add backported phy/phylink/sfp patches 2020-01-21 22:32:48 +01:00
716-v5.4-net-sfp-move-fwnode-parsing-into-sfp-bus-layer.patch kernel: add backported phy/phylink/sfp patches 2020-01-21 22:32:48 +01:00
717-v5.5-net-sfp-rework-upstream-interface.patch kernel: add backported phy/phylink/sfp patches 2020-01-21 22:32:48 +01:00
718-v5.5-net-sfp-fix-sfp_bus_put-kernel-documentation.patch kernel: add backported phy/phylink/sfp patches 2020-01-21 22:32:48 +01:00
719-v5.5-net-sfp-fix-sfp_bus_add_upstream-warning.patch kernel: add backported phy/phylink/sfp patches 2020-01-21 22:32:48 +01:00
720-v5.5-net-sfp-move-sfp-sub-state-machines-into-separate-fu.patch kernel: add backported phy/phylink/sfp patches 2020-01-21 22:32:48 +01:00
721-v5.5-net-sfp-move-tx-disable-on-device-down-to-main-state.patch kernel: add backported phy/phylink/sfp patches 2020-01-21 22:32:48 +01:00
722-v5.5-net-sfp-rename-sfp_sm_ins_next-as-sfp_sm_mod_next.patch kernel: add backported phy/phylink/sfp patches 2020-01-21 22:32:48 +01:00
723-v5.5-net-sfp-handle-module-remove-outside-state-machine.patch kernel: add backported phy/phylink/sfp patches 2020-01-21 22:32:48 +01:00
724-v5.5-net-sfp-rename-T_PROBE_WAIT-to-T_SERIAL.patch kernel: add backported phy/phylink/sfp patches 2020-01-21 22:32:48 +01:00
725-v5.5-net-sfp-parse-SFP-power-requirement-earlier.patch kernel: add backported phy/phylink/sfp patches 2020-01-21 22:32:48 +01:00
726-v5.5-net-sfp-avoid-power-switch-on-address-change-modules.patch kernel: add backported phy/phylink/sfp patches 2020-01-21 22:32:48 +01:00
727-v5.5-net-sfp-control-TX_DISABLE-and-phy-only-from-main-st.patch kernel: add backported phy/phylink/sfp patches 2020-01-21 22:32:48 +01:00
728-v5.5-net-sfp-split-the-PHY-probe-from-sfp_sm_mod_init.patch kernel: add backported phy/phylink/sfp patches 2020-01-21 22:32:48 +01:00
729-v5.5-net-sfp-eliminate-mdelay-from-PHY-probe.patch kernel: add backported phy/phylink/sfp patches 2020-01-21 22:32:48 +01:00
730-v5.5-net-sfp-allow-fault-processing-to-transition-to-othe.patch kernel: add backported phy/phylink/sfp patches 2020-01-21 22:32:48 +01:00
731-v5.5-net-sfp-ensure-TX_FAULT-has-deasserted-before-probin.patch kernel: add backported phy/phylink/sfp patches 2020-01-21 22:32:48 +01:00
732-v5.5-net-sfp-track-upstream-s-attachment-state-in-state-m.patch kernel: add backported phy/phylink/sfp patches 2020-01-21 22:32:48 +01:00
733-v5.5-net-sfp-split-power-mode-switching-from-probe.patch kernel: add backported phy/phylink/sfp patches 2020-01-21 22:32:48 +01:00
734-v5.5-net-sfp-move-module-insert-reporting-out-of-probe.patch kernel: add backported phy/phylink/sfp patches 2020-01-21 22:32:48 +01:00
735-v5.5-net-sfp-allow-sfp-to-probe-slow-to-initialise-GPON-m.patch kernel: add backported phy/phylink/sfp patches 2020-01-21 22:32:48 +01:00
736-v5.5-net-sfp-allow-modules-with-slow-diagnostics-to-probe.patch kernel: add backported phy/phylink/sfp patches 2020-01-21 22:32:48 +01:00
737-v5.5-net-phy-add-core-phylib-sfp-support.patch kernel: add backported phy/phylink/sfp patches 2020-01-21 22:32:48 +01:00
738-v5.5-net-phy-marvell10g-add-SFP-support.patch kernel: add backported phy/phylink/sfp patches 2020-01-21 22:32:48 +01:00
739-v5.5-net-phylink-update-to-use-phy_support_asym_pause.patch kernel: add backported phy/phylink/sfp patches 2020-01-21 22:32:48 +01:00
740-v5.5-net-phy-avoid-matching-all-ones-clause-45-PHY-IDs.patch kernel: add backported phy/phylink/sfp patches 2020-01-21 22:32:48 +01:00
741-v5.5-net-phylink-fix-link-mode-modification-in-PHY-mode.patch kernel: add backported phy/phylink/sfp patches 2020-01-21 22:32:48 +01:00
742-v5.5-net-sfp-add-support-for-module-quirks.patch kernel: add backported phy/phylink/sfp patches 2020-01-21 22:32:48 +01:00
743-v5.5-net-sfp-add-some-quirks-for-GPON-modules.patch kernel: add backported phy/phylink/sfp patches 2020-01-21 22:32:48 +01:00
744-v5.5-net-sfp-soft-status-and-control-support.patch kernel: add backported phy/phylink/sfp patches 2020-01-21 22:32:48 +01:00