Yang Yingliang
42ca63f980
net/802/garp: fix memleak in garp_request_join()
...
I got kmemleak report when doing fuzz test:
BUG: memory leak
unreferenced object 0xffff88810c909b80 (size 64):
comm "syz", pid 957, jiffies 4295220394 (age 399.090s)
hex dump (first 32 bytes):
01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 08 00 00 00 01 02 00 04 ................
backtrace:
[<00000000ca1f2e2e>] garp_request_join+0x285/0x3d0
[<00000000bf153351>] vlan_gvrp_request_join+0x15b/0x190
[<0000000024005e72>] vlan_dev_open+0x706/0x980
[<00000000dc20c4d4>] __dev_open+0x2bb/0x460
[<0000000066573004>] __dev_change_flags+0x501/0x650
[<0000000035b42f83>] rtnl_configure_link+0xee/0x280
[<00000000a5e69de0>] __rtnl_newlink+0xed5/0x1550
[<00000000a5258f4a>] rtnl_newlink+0x66/0x90
[<00000000506568ee>] rtnetlink_rcv_msg+0x439/0xbd0
[<00000000b7eaeae1>] netlink_rcv_skb+0x14d/0x420
[<00000000c373ce66>] netlink_unicast+0x550/0x750
[<00000000ec74ce74>] netlink_sendmsg+0x88b/0xda0
[<00000000381ff246>] sock_sendmsg+0xc9/0x120
[<000000008f6a2db3>] ____sys_sendmsg+0x6e8/0x820
[<000000008d9c1735>] ___sys_sendmsg+0x145/0x1c0
[<00000000aa39dd8b>] __sys_sendmsg+0xfe/0x1d0
Calling garp_request_leave() after garp_request_join(), the attr->state
is set to GARP_APPLICANT_VO, garp_attr_destroy() won't be called in last
transmit event in garp_uninit_applicant(), the attr of applicant will be
leaked. To fix this leak, iterate and free each attr of applicant before
rerturning from garp_uninit_applicant().
Reported-by: Hulk Robot <hulkci@huawei.com >
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com >
Signed-off-by: David S. Miller <davem@davemloft.net >
2021-07-01 11:21:57 -07:00
..
2021-03-24 17:52:11 -07:00
2021-06-02 14:01:55 -07:00
2021-07-01 11:21:57 -07:00
2021-06-18 11:58:03 -07:00
2021-06-18 19:47:02 -07:00
2021-06-10 14:08:09 -07:00
2021-03-30 16:54:50 -07:00
2021-06-18 19:47:02 -07:00
2021-06-26 07:12:45 +02:00
2021-05-19 00:33:40 +02:00
2021-06-25 13:13:50 +02:00
2021-06-29 10:46:23 -07:00
2021-06-29 11:28:21 -07:00
2021-06-29 15:45:27 -07:00
2021-06-30 15:51:09 -07:00
2021-06-30 15:51:09 -07:00
2021-06-01 17:01:33 -07:00
2021-06-29 11:28:21 -07:00
2021-06-02 14:01:55 -07:00
2021-06-29 10:46:23 -07:00
2021-04-13 14:35:02 -07:00
2021-06-22 10:40:54 -07:00
2021-06-16 12:13:01 -07:00
2021-06-03 10:59:49 +02:00
2021-06-30 15:51:09 -07:00
2021-06-29 15:45:27 -07:00
2021-06-12 13:06:33 -07:00
2021-06-29 11:28:21 -07:00
2021-05-26 07:03:39 +02:00
2021-06-07 14:08:30 -07:00
2021-03-28 17:56:55 -07:00
2021-06-08 16:31:25 -07:00
2021-04-27 14:16:14 -07:00
2021-06-23 18:12:00 +02:00
2021-04-06 22:42:16 +02:00
2021-04-27 14:17:00 -07:00
2021-06-29 15:45:27 -07:00
2021-06-07 14:08:30 -07:00
2021-06-29 15:45:27 -07:00
2021-06-15 11:19:04 -07:00
2021-06-29 11:28:21 -07:00
2021-05-17 19:57:08 -05:00
2021-06-29 11:28:21 -07:00
2021-07-01 11:13:10 -07:00
2021-06-30 15:51:09 -07:00
2021-03-14 15:00:43 -07:00
2021-06-29 11:28:21 -07:00
2021-06-30 15:51:09 -07:00
2021-04-20 16:44:04 -07:00
2021-03-10 12:45:15 -08:00
2021-06-30 15:51:09 -07:00
2021-06-29 15:45:27 -07:00
2021-07-01 11:16:38 -07:00
2021-06-29 11:28:21 -07:00
2021-06-29 11:28:21 -07:00
2021-06-28 11:45:29 -07:00
2021-06-28 14:09:03 -07:00
2021-06-30 15:51:09 -07:00
2021-06-29 15:45:27 -07:00
2021-06-29 11:28:21 -07:00
2021-06-30 15:51:09 -07:00
2021-06-23 13:05:09 +02:00
2021-06-10 14:08:09 -07:00
2021-06-29 15:45:27 -07:00
2021-06-30 15:51:09 -07:00
2021-06-03 15:13:56 -07:00
2021-06-11 12:55:28 -07:00
2021-05-11 13:56:16 -07:00
2021-06-21 14:41:54 -07:00
2021-04-12 13:27:11 -07:00