YueHaibing
895a5e96db
net-sysfs: Fix mem leak in netdev_register_kobject
...
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>
2019-03-03 21:10:57 -08:00
..
2018-12-19 00:28:05 +01:00
2018-12-25 17:07:49 +09:00
2018-12-06 13:26:07 -08:00
2019-03-03 13:01:49 -08:00
2018-10-23 10:57:06 -07:00
2019-01-23 11:18:00 -08:00
2019-02-12 13:30:43 -05:00
2018-12-27 13:53:32 -08:00
2019-02-19 00:17:03 +01:00
2019-01-16 15:46:46 -08:00
2019-02-23 18:36:06 -08:00
2018-10-23 10:57:06 -07:00
2019-01-22 11:33:46 +01:00
2019-02-18 18:05:33 +01:00
2019-03-03 21:10:57 -08:00
2019-02-01 14:49:10 -08:00
2019-01-27 23:11:55 -08:00
2018-10-04 09:40:52 -07:00
2019-02-25 09:34:52 -08:00
2018-12-03 15:40:30 -08:00
2018-12-24 16:19:56 -08:00
2019-03-01 16:41:27 -08:00
2019-03-02 00:53:23 -08:00
2018-11-10 16:55:11 -08:00
2018-09-17 18:43:42 -07:00
2019-02-12 10:36:42 +01:00
2019-01-31 08:58:46 -08:00
2018-12-03 14:15:26 -08:00
2018-10-22 19:59:20 -07:00
2019-02-22 14:00:40 +01:00
2018-09-28 12:46:07 +08:00
2019-02-26 13:23:17 -08:00
2018-11-27 16:37:20 -08:00
2019-02-16 10:41:42 +01:00
2019-02-27 21:45:24 -08:00
2018-12-14 11:44:31 -08:00
2019-01-27 10:38:04 -08:00
2019-02-27 12:47:08 -08:00
2019-01-16 13:35:21 -08:00
2019-02-12 13:37:23 -05:00
2019-02-21 16:23:56 -08:00
2019-01-31 09:43:27 -08:00
2018-12-18 13:13:56 +01:00
2019-01-27 10:40:01 -08:00
2019-02-06 10:54:07 -08:00
2019-03-02 14:10:18 -08:00
2019-02-28 10:33:40 -08:00
2019-02-21 10:19:20 -08:00
2018-10-15 12:23:19 -07:00
2019-02-16 17:38:01 -08:00
2018-12-12 16:34:22 -08:00
2019-02-26 14:50:50 -08:00
2019-01-28 23:07:08 -08:00
2019-02-20 20:06:28 -08:00
2019-02-08 22:32:05 -08:00
2019-02-11 15:50:56 +01:00
2019-02-23 18:41:06 -08:00
2019-02-21 16:32:25 +01:00
2019-02-18 10:58:54 +01:00
2019-02-22 11:49:28 -08:00
2018-12-19 11:21:37 -08:00
2019-02-25 10:40:57 -08:00