1
0
mirror of https://git.openwrt.org/openwrt/openwrt.git synced 2024-10-19 14:08:17 +02:00
openwrt/target/linux
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
..
apm821xx apm821xx: mbl_gen_hdd_img.sh: switch to /bin/sh 2019-12-31 01:28:08 +01:00
ar71xx ar71xx: change u-boot-env to read-write for gl-ar150/-domino/mifi 2020-01-23 13:56:53 +01:00
arc770 arc770: gen_axs10x_sdcard_img.sh: switch to /bin/sh 2019-12-31 01:27:32 +01:00
archs38 archs38: gen_axs10x_sdcard_img.sh: switch to /bin/sh 2019-12-31 01:26:35 +01:00
armvirt treewide: Remove self from MAINTAINER entries 2019-12-23 13:18:04 -08:00
at91 at91: gen_at91_sdcard_img.sh: switch to /bin/sh 2019-12-31 01:25:44 +01:00
ath25 ath25: split up DEVICE_TITLE 2019-10-19 13:16:57 +02:00
ath79 ath79: fix SUPPORTED_DEVICES not matching ar71xx board names 2020-01-23 16:09:58 +01:00
bcm53xx kernel: remove further obsolete kernel version switches 2020-01-18 19:39:05 +01:00
brcm47xx brcm47xx: fix switch port order for Netgear WN2500RP V1 2020-01-20 12:35:44 +01:00
brcm63xx kernel: bump 4.19 to 4.19.95 2020-01-20 13:41:49 +01:00
brcm2708 kernel: bump 4.19 to 4.19.97 2020-01-20 13:41:49 +01:00
cns3xxx kernel: bump 4.19 to 4.19.86 2019-11-29 09:59:49 +01:00
gemini gemini: dns313_gen_hdd_img.sh: switch to /bin/sh 2019-12-31 01:23:24 +01:00
generic kernel: act_ctinfo: backport memory leak fix 2020-01-24 11:25:26 +00:00
imx6 kernel: Deactivate CONFIG_SFP in generic config 2019-12-23 15:25:36 +01:00
ipq40xx ipq40xx: add support for Aruba AP-303H 2020-01-14 09:38:32 +01:00
ipq806x ipq806x: refresh kernel patches 2020-01-08 14:33:03 +01:00
kirkwood kirkwood: exploit BOARD_NAME to set DEVICE_DTS and SUPPORTED_DEVICES 2020-01-23 14:27:12 +01:00
lantiq lantiq: reorganize 02_network board.d files 2020-01-14 22:04:44 +01:00
layerscape kernel: bump 4.14 to 4.14.166 2020-01-20 13:41:49 +01:00
malta malta: enable HighMem on MIPS32 2020-01-15 22:35:48 +01:00
mediatek mediatek: split base-files into subtargets 2020-01-14 13:34:34 +01:00
mpc85xx treewide: move mktplinkfw to tplink-v1-image in image-commands.mk 2020-01-08 16:15:29 +01:00
mvebu mvebu: add uDPU update patches 2020-01-21 22:32:48 +01:00
mxs mxs: gen_sdcard_ext4_ext4.sh: use /bin/sh 2019-12-31 01:19:48 +01:00
octeon octeon: remove redundant network setup 2020-01-18 19:39:05 +01:00
octeontx kernel: bump 4.14 to 4.14.160 2019-12-24 17:45:54 +01:00
omap omap: gen_omap_sdcard_img.sh: use /bin/sh 2019-12-31 01:17:09 +01:00
oxnas kernel: bump 4.14 to 4.14.158 2019-12-10 09:50:42 +01:00
pistachio pistachio: split up DEVICE_TITLE 2019-10-12 23:37:00 +02:00
ramips ramips: apply LED_POLARITY rt3050-esw on MT7628AN/MT7688 2020-01-19 10:55:31 +01:00
rb532 rb532: gen_image.sh: use /bin/sh 2019-12-31 01:16:17 +01:00
samsung samsung: add subtarget condition for device 2020-01-03 00:04:22 +01:00
sunxi sunxi: tidy up and sort alphabetically in image Makefiles 2020-01-23 14:21:19 +01:00
tegra x86,tegra,mvebu: image: use common reproducible IMG_PART_SIGNATURE 2019-11-11 16:37:13 +01:00
uml treewide: Remove self from MAINTAINER entries 2019-12-23 13:18:04 -08:00
x86 kernel: bump 4.19 to 4.19.90 2019-12-24 15:34:43 +01:00
zynq zynq: derive DEVICE_DTS from device definition name 2020-01-21 14:26:04 +01:00
Makefile