YueHaibing
d28a029290
net-sysfs: Fix mem leak in netdev_register_kobject
...
[ Upstream commit 895a5e96dbd6386c8e78e5b78e067dcc67b7f0ab ]
syzkaller report this:
BUG: memory leak
unreferenced object 0xffff88837a71a500 (size 256):
comm "syz-executor.2", pid 9770, jiffies 4297825125 (age 17.843s)
hex dump (first 32 bytes):
00 00 00 00 ad 4e ad de ff ff ff ff 00 00 00 00 .....N..........
ff ff ff ff ff ff ff ff 20 c0 ef 86 ff ff ff ff ........ .......
backtrace:
[<00000000db12624b>] netdev_register_kobject+0x124/0x2e0 net/core/net-sysfs.c:1751
[<00000000dc49a994>] register_netdevice+0xcc1/0x1270 net/core/dev.c:8516
[<00000000e5f3fea0>] tun_set_iff drivers/net/tun.c:2649 [inline]
[<00000000e5f3fea0>] __tun_chr_ioctl+0x2218/0x3d20 drivers/net/tun.c:2883
[<000000001b8ac127>] vfs_ioctl fs/ioctl.c:46 [inline]
[<000000001b8ac127>] do_vfs_ioctl+0x1a5/0x10e0 fs/ioctl.c:690
[<0000000079b269f8>] ksys_ioctl+0x89/0xa0 fs/ioctl.c:705
[<00000000de649beb>] __do_sys_ioctl fs/ioctl.c:712 [inline]
[<00000000de649beb>] __se_sys_ioctl fs/ioctl.c:710 [inline]
[<00000000de649beb>] __x64_sys_ioctl+0x74/0xb0 fs/ioctl.c:710
[<000000007ebded1e>] do_syscall_64+0xc8/0x580 arch/x86/entry/common.c:290
[<00000000db315d36>] entry_SYSCALL_64_after_hwframe+0x49/0xbe
[<00000000115be9bb>] 0xffffffffffffffff
It should call kset_unregister to free 'dev->queues_kset'
in error path of register_queue_kobjects, otherwise will cause a mem leak.
Reported-by: Hulk Robot <hulkci@huawei.com>
Fixes: 1d24eb4815d1 ("xps: Transmit Packet Steering")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-23 08:44:22 +01:00
..
2018-10-10 08:52:04 +02:00
2019-01-13 10:05:33 +01:00
2018-04-13 19:50:25 +02:00
2018-05-16 10:06:51 +02:00
2019-02-23 09:05:14 +01:00
2019-03-23 08:44:17 +01:00
2019-02-20 10:13:10 +01:00
2019-03-23 08:44:18 +01:00
2018-09-05 09:18:34 +02:00
2019-02-06 19:43:04 +01:00
2019-03-23 08:44:18 +01:00
2019-03-23 08:44:22 +01:00
2018-09-19 22:48:58 +02:00
2019-02-20 10:13:15 +01:00
2018-02-25 11:03:38 +01:00
2018-07-22 14:25:54 +02:00
2019-02-20 10:13:15 +01:00
2017-02-18 16:39:27 +01:00
2015-11-23 14:56:15 -05:00
2019-02-08 11:25:32 +01:00
2019-02-23 09:05:14 +01:00
2019-03-23 08:44:18 +01:00
2017-05-25 14:30:13 +02:00
2018-09-15 09:40:40 +02:00
2018-11-10 07:41:35 -08:00
2018-06-16 09:54:25 +02:00
2019-02-06 19:43:06 +01:00
2015-10-07 04:27:43 -07:00
2018-12-01 09:46:34 +01:00
2019-03-23 08:44:20 +01:00
2018-09-09 20:04:32 +02:00
2018-03-11 16:19:47 +01:00
2018-12-01 09:46:40 +01:00
2018-10-20 09:52:36 +02:00
2018-08-09 12:19:28 +02:00
2019-02-06 19:43:06 +01:00
2018-09-29 03:08:51 -07:00
2019-02-06 19:43:03 +01:00
2019-03-23 08:44:17 +01:00
2016-01-31 11:29:00 -08:00
2018-07-22 14:25:54 +02:00
2018-05-16 10:06:51 +02:00
2019-02-06 19:43:06 +01:00
2018-04-13 19:50:23 +02:00
2019-02-06 19:43:03 +01:00
2019-01-26 09:42:51 +01:00
2019-01-26 09:42:51 +01:00
2016-06-24 10:18:16 -07:00
2019-02-20 10:13:14 +01:00
2018-11-10 07:41:34 -08:00
2019-02-23 09:05:13 +01:00
2015-08-09 22:43:52 -07:00
2019-03-23 08:44:20 +01:00
2019-02-23 09:05:14 +01:00
2019-02-20 10:13:20 +01:00
2019-01-13 10:05:28 +01:00
2018-02-25 11:03:37 +01:00
2015-09-29 20:40:32 -07:00
2019-03-23 08:44:21 +01:00
2016-09-15 08:27:50 +02:00