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-28 13:19:59 -08:00
2018-12-13 18:41:38 -08:00
2018-12-13 18:41:38 -08:00
2019-02-15 20:23:50 -08:00
2018-12-03 13:55:43 -08:00
2017-11-21 15:57:07 -08:00
2018-03-05 12:52:45 -05:00
2018-08-03 21:12:12 +02:00
2018-12-28 21:24:56 -08:00
2018-05-28 22:59:54 -04:00
2018-03-29 14:10:30 -04:00
2018-10-08 10:39:05 -07:00
2019-02-10 19:57:34 -08:00
2018-12-20 11:53:36 -08:00
2018-08-11 12:37:10 -07:00
2019-03-02 14:10:18 -08:00
2018-12-19 15:50:02 -08:00
2018-09-19 21:06:46 -07:00
2019-01-20 01:11:48 +01:00
2017-08-07 14:16:22 -07:00
2018-10-15 12:23:19 -07:00
2019-01-17 22:08:14 -08:00
2018-12-24 16:19:56 -08:00
2018-05-16 07:24:30 +02:00
2019-03-03 21:10:57 -08:00
2017-11-02 11:10:55 +01:00
2018-05-24 23:01:15 -04:00
2018-10-23 12:58:17 -07:00
2018-12-27 13:04:52 -08:00
2017-12-13 13:18:46 -05:00
2018-07-19 23:23:01 -07:00
2018-09-13 15:36:41 -07:00
2018-12-30 11:35:36 -08:00
2017-03-02 08:42:29 +01:00
2018-07-11 12:10:19 -06:00
2019-02-17 15:48:43 -08:00
2019-01-29 00:05:03 +01:00
2018-08-14 10:01:24 -07:00
2018-10-20 00:40:45 +02:00
2018-11-12 09:09:51 -08:00
2019-02-13 21:05:18 -08:00
2018-12-04 21:21:18 -08:00
2018-12-11 19:12:21 -08:00
2017-11-02 11:10:55 +01:00
2018-08-04 13:05:39 -07:00
2018-09-01 01:35:53 +02:00