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