Pavel Skripkin
9436cdffaf
nilfs2: fix memory leak in nilfs_sysfs_delete_device_group
...
[ Upstream commit 8fd0c1b0647a6bda4067ee0cd61e8395954b6f28 ]
My local syzbot instance hit memory leak in nilfs2. The problem was in
missing kobject_put() in nilfs_sysfs_delete_device_group().
kobject_del() does not call kobject_cleanup() for passed kobject and it
leads to leaking duped kobject name if kobject_put() was not called.
Fail log:
BUG: memory leak
unreferenced object 0xffff8880596171e0 (size 8):
comm "syz-executor379", pid 8381, jiffies 4294980258 (age 21.100s)
hex dump (first 8 bytes):
6c 6f 6f 70 30 00 00 00 loop0...
backtrace:
kstrdup+0x36/0x70 mm/util.c:60
kstrdup_const+0x53/0x80 mm/util.c:83
kvasprintf_const+0x108/0x190 lib/kasprintf.c:48
kobject_set_name_vargs+0x56/0x150 lib/kobject.c:289
kobject_add_varg lib/kobject.c:384 [inline]
kobject_init_and_add+0xc9/0x160 lib/kobject.c:473
nilfs_sysfs_create_device_group+0x150/0x800 fs/nilfs2/sysfs.c:999
init_nilfs+0xe26/0x12b0 fs/nilfs2/the_nilfs.c:637
Link: https://lkml.kernel.org/r/20210612140559.20022-1-paskripkin@gmail.com
Fixes: da7141fb78db ("nilfs2: add /sys/fs/nilfs2/<device> group")
Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
Acked-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Cc: Michael L. Semon <mlsemon35@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-06-30 08:48:34 -04:00
..
2020-11-05 11:08:53 +01:00
2019-08-06 19:06:49 +02:00
2021-03-04 09:39:55 +01:00
2021-06-30 08:48:14 -04:00
2019-12-13 08:51:01 +01:00
2018-12-01 09:37:27 +01:00
2021-06-16 11:54:59 +02:00
2020-11-05 11:08:54 +01:00
2021-05-22 10:59:49 +02:00
2021-06-03 08:38:10 +02:00
2019-08-06 19:06:51 +02:00
2021-03-17 16:43:51 +01:00
2018-11-13 11:08:55 -08:00
2021-01-06 14:44:58 +01:00
2019-05-08 07:21:48 +02:00
2019-03-23 20:09:59 +01:00
2021-05-22 10:59:39 +02:00
2021-05-26 11:48:34 +02:00
2020-12-02 08:48:12 +01:00
2019-12-05 09:20:32 +01:00
2020-01-27 14:50:02 +01:00
2020-09-09 19:04:28 +02:00
2021-06-10 13:24:06 +02:00
2021-05-22 10:59:42 +02:00
2020-06-22 09:05:08 +02:00
2018-12-17 09:24:40 +01:00
2021-05-22 10:59:41 +02:00
2021-06-30 08:48:11 -04:00
2019-12-01 09:17:10 +01:00
2021-05-22 10:59:45 +02:00
2018-08-17 16:20:28 -07:00
2018-08-25 12:42:33 -07:00
2021-06-03 08:38:12 +02:00
2021-03-04 09:39:45 +01:00
2020-09-03 11:24:24 +02:00
2021-05-22 10:59:21 +02:00
2021-03-07 12:18:54 +01:00
2019-12-13 08:52:43 +01:00
2020-12-30 11:25:59 +01:00
2020-08-21 11:05:38 +02:00
2021-06-16 11:55:02 +02:00
2020-12-30 11:26:02 +01:00
2021-01-23 15:49:55 +01:00
2021-06-30 08:48:34 -04:00
2020-06-30 23:17:00 -04:00
2021-03-04 09:39:29 +01:00
2021-06-10 13:24:06 +02:00
2020-02-24 08:34:53 +01:00
2021-05-22 10:59:26 +02:00
2021-06-16 11:55:02 +02:00
2021-03-04 09:39:54 +01:00
2021-03-04 09:39:42 +01:00
2020-10-30 10:38:21 +01:00
2021-04-07 12:48:50 +02:00
2020-08-26 10:30:59 +02:00
2021-05-22 10:59:45 +02:00
2021-03-07 12:19:01 +01:00
2018-12-17 09:24:30 +01:00
2021-05-22 10:59:19 +02:00
2021-03-17 16:43:45 +01:00
2020-08-21 11:05:38 +02:00
2021-03-07 12:18:55 +01:00
2020-06-22 09:05:01 +02:00
2020-06-03 08:19:41 +02:00
2019-07-03 13:14:44 +02:00
2021-03-17 16:43:51 +01:00
2019-11-06 13:05:37 +01:00
2021-05-22 10:59:49 +02:00
2020-11-05 11:08:46 +01:00
2020-01-14 20:06:57 +01:00
2020-01-09 10:19:07 +01:00
2020-05-14 07:57:21 +02:00
2020-03-05 16:42:12 +01:00
2020-11-05 11:08:35 +01:00
2021-04-14 08:22:32 +02:00
2020-01-12 12:17:20 +01:00
2020-02-11 04:34:08 -08:00
2020-10-07 08:00:09 +02:00
2021-01-30 13:32:11 +01:00
2021-01-06 14:45:00 +01:00
2018-08-21 18:19:09 -07:00
2020-05-27 17:37:29 +02:00
2020-04-17 10:48:51 +02:00
2021-02-13 13:51:15 +01:00
2020-03-25 08:06:14 +01:00
2019-05-31 06:46:05 -07:00
2018-11-21 09:19:14 +01:00
2021-05-22 10:59:50 +02:00
2020-11-24 13:27:23 +01:00
2020-01-09 10:19:00 +01:00
2018-08-17 16:20:29 -07:00
2020-03-05 16:42:20 +01:00
2020-04-29 16:31:26 +02:00
2019-05-25 18:23:26 +02:00
2020-03-18 07:14:21 +01:00
2019-05-04 09:20:11 +02:00
2020-05-02 17:26:01 +02:00
2019-12-01 09:17:04 +01:00
2021-04-28 13:16:50 +02:00
2021-03-24 11:07:37 +01:00
2019-08-25 10:47:43 +02:00
2020-08-26 10:31:02 +02:00
2019-12-17 20:35:43 +01:00
2019-10-11 18:21:39 +02:00
2020-11-24 13:27:20 +01:00
2018-08-13 20:56:23 -07:00
2020-01-04 19:13:18 +01:00
2020-08-11 15:32:34 +02:00