Liu Shixin
a158ee32d4
netlabel: Fix memory leak in netlbl_mgmt_add_common
...
[ Upstream commit b8f6b0522c298ae9267bd6584e19b942a0636910 ]
Hulk Robot reported memory leak in netlbl_mgmt_add_common.
The problem is non-freed map in case of netlbl_domhsh_add() failed.
BUG: memory leak
unreferenced object 0xffff888100ab7080 (size 96):
comm "syz-executor537", pid 360, jiffies 4294862456 (age 22.678s)
hex dump (first 32 bytes):
05 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
fe 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 ................
backtrace:
[<0000000008b40026>] netlbl_mgmt_add_common.isra.0+0xb2a/0x1b40
[<000000003be10950>] netlbl_mgmt_add+0x271/0x3c0
[<00000000c70487ed>] genl_family_rcv_msg_doit.isra.0+0x20e/0x320
[<000000001f2ff614>] genl_rcv_msg+0x2bf/0x4f0
[<0000000089045792>] netlink_rcv_skb+0x134/0x3d0
[<0000000020e96fdd>] genl_rcv+0x24/0x40
[<0000000042810c66>] netlink_unicast+0x4a0/0x6a0
[<000000002e1659f0>] netlink_sendmsg+0x789/0xc70
[<000000006e43415f>] sock_sendmsg+0x139/0x170
[<00000000680a73d7>] ____sys_sendmsg+0x658/0x7d0
[<0000000065cbb8af>] ___sys_sendmsg+0xf8/0x170
[<0000000019932b6c>] __sys_sendmsg+0xd3/0x190
[<00000000643ac172>] do_syscall_64+0x37/0x90
[<000000009b79d6dc>] entry_SYSCALL_64_after_hwframe+0x44/0xae
Fixes: 63c416887437 ("netlabel: Add network address selectors to the NetLabel/LSM domain mapping")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Liu Shixin <liushixin2@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-07-14 16:56:22 +02:00
..
2021-04-07 15:00:08 +02:00
2021-01-17 14:16:55 +01:00
2021-04-07 15:00:08 +02:00
2020-10-31 12:26:30 -07:00
2020-07-25 17:49:04 -07:00
2021-06-23 14:42:41 +02:00
2021-07-14 16:55:34 +02:00
2021-01-27 11:55:07 +01:00
2020-10-15 12:33:24 -07:00
2021-06-23 14:42:53 +02:00
2021-06-10 13:39:25 +02:00
2021-07-14 16:55:41 +02:00
2020-10-12 15:29:27 +02:00
2021-06-23 14:42:44 +02:00
2021-01-23 16:04:01 +01:00
2021-03-30 14:32:01 +02:00
2020-08-23 17:36:59 -05:00
2021-06-10 13:39:17 +02:00
2021-06-30 08:47:20 -04:00
2021-06-03 09:00:50 +02:00
2021-06-18 10:00:03 +02:00
2021-07-14 16:56:14 +02:00
2021-07-14 16:56:14 +02:00
2021-03-07 12:34:05 +01:00
2020-07-24 15:41:54 -07:00
2021-02-13 13:55:02 +01:00
2021-03-17 17:06:11 +01:00
2020-08-27 07:55:59 -07:00
2021-02-10 09:29:14 +01:00
2020-07-24 15:41:54 -07:00
2021-07-14 16:55:42 +02:00
2021-04-14 08:42:13 +02:00
2021-03-17 17:06:11 +01:00
2021-07-14 16:56:17 +02:00
2021-04-14 08:42:08 +02:00
2021-06-23 14:42:43 +02:00
2021-07-14 16:56:22 +02:00
2021-06-16 12:01:36 +02:00
2020-08-23 17:36:59 -05:00
2021-06-16 12:01:35 +02:00
2021-06-03 09:00:47 +02:00
2021-06-30 08:47:22 -04:00
2020-08-23 17:36:59 -05:00
2021-03-07 12:34:07 +01:00
2021-07-14 16:56:16 +02:00
2021-06-23 14:42:42 +02:00
2020-11-12 09:18:06 +01:00
2020-11-20 10:04:58 -08:00
2021-02-17 11:02:28 +01:00
2021-07-14 16:56:19 +02:00
2021-05-19 10:13:06 +02:00
2021-06-03 09:00:48 +02:00
2021-07-14 16:55:42 +02:00
2021-02-07 15:37:12 +01:00
2021-06-10 13:39:22 +02:00
2021-06-10 13:39:18 +02:00
2021-06-23 14:42:46 +02:00
2021-05-14 09:50:41 +02:00
2020-10-02 19:11:11 -07:00
2021-06-30 08:47:19 -04:00
2021-06-18 10:00:06 +02:00
2021-05-19 10:13:06 +02:00
2021-07-14 16:56:19 +02:00
2021-06-18 10:00:06 +02:00
2020-06-30 15:57:34 -07:00
2020-09-30 18:01:26 -07:00
2021-06-23 14:42:44 +02:00