Liu Shixin
9b1e991266
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:53:29 +02:00
..
2020-11-05 11:43:20 +01:00
2021-01-17 14:05:31 +01:00
2021-04-07 14:47:41 +02:00
2020-10-01 13:17:58 +02:00
2020-07-31 18:39:31 +02:00
2021-06-23 14:41:23 +02:00
2021-06-10 13:37:09 +02:00
2019-07-25 18:00:41 -07:00
2020-04-21 09:04:53 +02:00
2021-06-23 14:41:30 +02:00
2021-06-10 13:37:10 +02:00
2021-07-14 16:53:04 +02:00
2020-11-05 11:43:34 +01:00
2021-06-30 08:47:47 -04:00
2021-01-23 15:57:59 +01:00
2021-04-07 14:47:38 +02:00
2020-01-04 19:18:58 +01:00
2020-04-23 10:36:45 +02:00
2021-06-03 08:59:12 +02:00
2020-01-09 10:20:06 +01:00
2021-05-14 09:44:10 +02:00
2021-06-18 09:58:57 +02:00
2019-09-26 08:56:17 +02:00
2021-07-14 16:53:26 +02:00
2021-07-14 16:53:26 +02:00
2021-03-07 12:20:42 +01:00
2019-09-27 10:27:14 +02:00
2021-02-13 13:52:54 +01:00
2020-07-22 09:32:47 +02:00
2021-02-10 09:25:28 +01:00
2020-10-01 13:17:15 +02:00
2021-07-14 16:53:04 +02:00
2021-04-14 08:24:18 +02:00
2021-03-17 17:03:31 +01:00
2021-04-14 08:24:15 +02:00
2021-06-23 14:41:25 +02:00
2021-07-14 16:53:29 +02:00
2021-06-16 11:59:34 +02:00
2020-04-29 16:33:08 +02:00
2021-06-16 11:59:33 +02:00
2021-06-03 08:59:13 +02:00
2021-06-30 08:47:48 -04:00
2019-10-28 13:33:41 -07:00
2019-12-04 22:30:54 +01:00
2021-06-23 14:41:25 +02:00
2021-06-23 14:41:24 +02:00
2020-11-24 13:29:05 +01:00
2020-12-08 10:40:23 +01:00
2021-02-17 10:35:18 +01:00
2021-07-14 16:53:27 +02:00
2021-05-19 10:08:27 +02:00
2021-06-03 08:59:08 +02:00
2021-07-14 16:53:05 +02:00
2021-02-07 15:35:46 +01:00
2021-06-10 13:37:08 +02:00
2021-06-03 08:59:13 +02:00
2021-06-23 14:41:26 +02:00
2021-05-14 09:44:30 +02:00
2019-08-10 15:25:47 -07:00
2021-06-30 08:47:45 -04:00
2021-06-18 09:59:00 +02:00
2021-05-22 11:38:27 +02:00
2021-07-14 16:53:26 +02:00
2021-06-18 09:59:00 +02:00
2020-04-01 11:02:18 +02:00
2021-06-23 14:41:25 +02:00