Yanfei Xu
6f5ddde410
blkcg: fix memory leak in blk_iolatency_init
BUG: memory leak
unreferenced object 0xffff888129acdb80 (size 96):
comm "syz-executor.1", pid 12661, jiffies 4294962682 (age 15.220s)
hex dump (first 32 bytes):
20 47 c9 85 ff ff ff ff 20 d4 8e 29 81 88 ff ff G...... ..)....
01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace:
[<ffffffff82264ec8>] kmalloc include/linux/slab.h:591 [inline]
[<ffffffff82264ec8>] kzalloc include/linux/slab.h:721 [inline]
[<ffffffff82264ec8>] blk_iolatency_init+0x28/0x190 block/blk-iolatency.c:724
[<ffffffff8225b8c4>] blkcg_init_queue+0xb4/0x1c0 block/blk-cgroup.c:1185
[<ffffffff822253da>] blk_alloc_queue+0x22a/0x2e0 block/blk-core.c:566
[<ffffffff8223b175>] blk_mq_init_queue_data block/blk-mq.c:3100 [inline]
[<ffffffff8223b175>] __blk_mq_alloc_disk+0x25/0xd0 block/blk-mq.c:3124
[<ffffffff826a9303>] loop_add+0x1c3/0x360 drivers/block/loop.c:2344
[<ffffffff826a966e>] loop_control_get_free drivers/block/loop.c:2501 [inline]
[<ffffffff826a966e>] loop_control_ioctl+0x17e/0x2e0 drivers/block/loop.c:2516
[<ffffffff81597eec>] vfs_ioctl fs/ioctl.c:51 [inline]
[<ffffffff81597eec>] __do_sys_ioctl fs/ioctl.c:874 [inline]
[<ffffffff81597eec>] __se_sys_ioctl fs/ioctl.c:860 [inline]
[<ffffffff81597eec>] __x64_sys_ioctl+0xfc/0x140 fs/ioctl.c:860
[<ffffffff843fa745>] do_syscall_x64 arch/x86/entry/common.c:50 [inline]
[<ffffffff843fa745>] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
[<ffffffff84600068>] entry_SYSCALL_64_after_hwframe+0x44/0xae
Once blk_throtl_init() queue init failed, blkcg_iolatency_exit() will
not be invoked for cleanup. That leads a memory leak. Swap the
blk_throtl_init() and blk_iolatency_init() calls can solve this.
Reported-by: syzbot+01321b15cc98e6bf96d6@syzkaller.appspotmail.com
Fixes: 19688d7f95 (block/blk-cgroup: Swap the blk_throtl_init() and blk_iolatency_init() calls)
Signed-off-by: Yanfei Xu <yanfei.xu@windriver.com>
Acked-by: Tejun Heo <tj@kernel.org>
Link: https://lore.kernel.org/r/20210915072426.4022924-1-yanfei.xu@windriver.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-09-15 11:57:44 -06:00
..
2021-08-30 18:52:11 -07:00
2020-08-23 17:36:59 -05:00
2021-09-07 08:39:40 -06:00
2021-03-25 10:50:07 -06:00
2021-09-02 06:36:58 -06:00
2021-08-25 06:45:33 -06:00
2021-08-18 07:21:12 -06:00
2021-08-16 10:50:32 -06:00
2021-09-03 07:42:13 -06:00
2021-03-05 11:32:15 -07:00
2019-11-07 12:28:13 -07:00
2021-09-15 11:57:44 -06:00
2021-08-30 19:30:30 -07:00
2021-03-11 07:47:48 -07:00
2020-10-05 10:47:43 -06:00
2021-08-25 06:45:00 -06:00
2021-06-30 15:35:45 -06:00
2021-08-17 20:17:34 -06:00
2021-09-14 20:03:30 -06:00
2020-07-16 10:22:15 -06:00
2021-08-30 18:52:11 -07:00
2021-08-30 18:52:11 -07:00
2021-06-21 15:03:40 -06:00
2021-06-21 15:03:40 -06:00
2021-06-17 15:51:20 +02:00
2021-09-03 10:08:28 -07:00
2021-08-30 19:30:30 -07:00
2020-10-20 07:08:17 -06:00
2019-01-17 21:21:40 -07:00
2021-06-21 15:03:40 -06:00
2019-06-13 03:00:30 -06:00
2019-05-31 15:12:34 -06:00
2019-05-31 15:12:34 -06:00
2021-07-27 16:44:38 -06:00
2021-06-24 18:43:55 -06:00
2021-08-02 13:37:29 -06:00
2021-09-12 19:32:43 -06:00
2021-05-24 06:47:22 -06:00
2020-03-17 20:55:21 +01:00
2021-09-11 10:19:51 -07:00
2021-06-24 18:43:55 -06:00
2020-12-09 11:41:41 -05:00
2021-02-22 06:33:48 -07:00
2021-06-08 15:12:57 -06:00
2021-06-21 15:03:40 -06:00
2021-08-23 12:54:31 -06:00
2020-09-01 16:48:46 -06:00
2021-08-23 12:55:45 -06:00
2021-09-07 08:36:56 -06:00
2020-07-31 16:29:47 -06:00
2021-08-23 12:54:31 -06:00
2021-06-21 15:03:41 -06:00
2021-08-24 10:12:36 -06:00
2021-09-07 08:39:29 -06:00
2021-08-02 13:37:28 -06:00
2021-08-01 13:21:40 -04:00
2021-07-30 22:22:36 -04:00
2021-08-23 12:55:45 -06:00
2021-08-09 14:37:47 -06:00
2021-09-07 08:39:29 -06:00
2021-09-07 08:36:21 -06:00
2021-08-20 21:14:26 -06:00
2021-08-12 10:31:36 -06:00
2021-08-18 07:23:15 -06:00
2021-09-02 15:09:46 -07:00
2021-08-11 13:47:26 -06:00
2021-02-22 10:22:54 -08:00
2021-08-06 16:40:47 -06:00
2021-09-11 10:19:51 -07:00
2021-09-02 06:34:45 -06:00
2020-03-12 08:00:10 -06:00
2020-03-12 08:00:10 -06:00
2021-08-02 13:37:28 -06:00