Wang Hai
757fed1d08
Revert "mm/slub: fix a memory leak in sysfs_slab_add()"
...
This reverts commit dde3c6b72a16c2db826f54b2d49bdea26c3534a2.
syzbot report a double-free bug. The following case can cause this bug.
- mm/slab_common.c: create_cache(): if the __kmem_cache_create() fails,
it does:
out_free_cache:
kmem_cache_free(kmem_cache, s);
- but __kmem_cache_create() - at least for slub() - will have done
sysfs_slab_add(s)
-> sysfs_create_group() .. fails ..
-> kobject_del(&s->kobj); .. which frees s ...
We can't remove the kmem_cache_free() in create_cache(), because other
error cases of __kmem_cache_create() do not free this.
So, revert the commit dde3c6b72a16 ("mm/slub: fix a memory leak in
sysfs_slab_add()") to fix this.
Reported-by: syzbot+d0bd96b4696c1ef67991@syzkaller.appspotmail.com
Fixes: dde3c6b72a16 ("mm/slub: fix a memory leak in sysfs_slab_add()")
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Wang Hai <wanghai38@huawei.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2021-01-28 09:05:44 -08:00
..
2021-01-24 10:34:52 -08:00
2020-12-15 12:13:47 -08:00
2019-09-04 07:42:01 -04:00
2019-07-12 12:24:03 -07:00
2020-07-10 13:54:00 -07:00
2020-12-15 12:13:46 -08:00
2020-09-01 09:19:43 +02:00
2020-12-15 14:48:04 -08:00
2017-11-02 11:10:55 +01:00
2020-10-16 11:11:14 -07:00
2020-12-02 18:28:05 -08:00
2020-10-13 18:38:32 -07:00
2020-01-31 10:30:38 -08:00
2020-10-13 18:38:29 -07:00
2019-07-12 11:05:43 -07:00
2020-12-18 13:37:04 -08:00
2020-06-09 09:39:14 -07:00
2020-08-14 19:56:56 -07:00
2020-12-15 12:13:38 -08:00
2020-12-15 12:13:38 -08:00
2020-12-15 12:53:37 -08:00
2021-01-24 10:34:52 -08:00
2020-08-12 10:58:02 -07:00
2020-12-15 22:46:19 -08:00
2020-12-06 10:19:07 -08:00
2021-01-12 18:12:54 -08:00
2020-10-16 11:11:16 -07:00
2020-12-15 12:13:39 -08:00
2020-12-15 12:13:43 -08:00
2019-06-19 17:09:08 +02:00
2020-08-07 11:33:26 -07:00
2020-12-19 11:25:41 -08:00
2020-12-15 12:13:46 -08:00
2020-12-15 22:46:19 -08:00
2020-10-13 18:38:27 -07:00
2020-12-15 12:13:47 -08:00
2020-12-06 10:19:07 -08:00
2020-08-12 10:57:59 -07:00
2020-12-15 12:13:44 -08:00
2020-12-15 12:13:41 -08:00
2020-12-15 12:13:41 -08:00
2021-01-21 10:29:37 +02:00
2021-01-24 09:20:52 -08:00
2019-09-24 15:54:08 -07:00
2020-12-29 15:36:49 -08:00
2021-01-24 10:34:52 -08:00
2020-12-29 15:36:49 -08:00
2021-01-12 18:12:54 -08:00
2020-12-22 12:55:09 -08:00
2020-11-02 12:14:18 -08:00
2017-11-02 11:10:55 +01:00
2021-01-24 09:20:52 -08:00
2020-10-13 18:38:29 -07:00
2020-12-15 14:48:04 -08:00
2020-12-15 12:13:47 -08:00
2020-12-15 12:13:41 -08:00
2020-12-18 12:38:28 -08:00
2020-06-09 09:39:14 -07:00
2020-12-15 12:13:41 -08:00
2020-12-15 14:48:04 -08:00
2020-11-17 14:36:14 +01:00
2020-12-29 15:36:49 -08:00
2020-06-09 09:39:14 -07:00
2020-12-15 12:13:40 -08:00
2020-12-15 12:13:45 -08:00
2021-01-26 10:39:46 -08:00
2020-12-15 12:13:40 -08:00
2020-12-15 22:46:19 -08:00
2020-12-15 14:48:03 -08:00
2020-12-02 18:28:05 -08:00
2020-12-15 12:13:45 -08:00
2020-12-15 12:13:38 -08:00
2020-12-22 12:55:08 -08:00
2020-10-16 11:11:19 -07:00
2020-06-09 09:39:13 -07:00
2020-12-15 12:13:41 -08:00
2021-01-05 11:33:00 -08:00
2020-06-09 09:39:14 -07:00
2020-08-12 10:57:55 -07:00
2020-08-12 10:57:55 -07:00
2020-08-12 10:57:55 -07:00
2020-08-12 10:57:55 -07:00
2020-10-30 23:02:28 +00:00
2020-08-07 11:33:26 -07:00
2020-06-09 09:39:13 -07:00
2021-01-12 18:12:54 -08:00
2020-12-22 12:55:08 -08:00
2020-10-17 13:49:08 -06:00
2020-12-15 14:48:04 -08:00
2020-08-21 09:52:53 -07:00
2020-12-15 12:13:47 -08:00
2020-10-16 11:11:19 -07:00
2020-08-07 11:33:29 -07:00
2020-12-22 12:55:09 -08:00
2020-12-15 12:13:43 -08:00
2020-12-15 13:22:29 -08:00
2020-12-15 12:13:41 -08:00
2021-01-28 09:05:44 -08:00
2020-08-07 11:33:27 -07:00
2020-10-16 11:11:18 -07:00
2020-06-03 20:09:48 -07:00
2020-10-13 18:38:30 -07:00
2020-12-15 12:13:47 -08:00
2020-12-15 14:48:04 -08:00
2020-12-15 22:46:15 -08:00
2020-12-15 12:13:47 -08:00
2020-08-12 10:57:58 -07:00
2020-08-12 10:57:55 -07:00
2020-11-19 10:36:36 +01:00
2020-06-10 19:14:18 -07:00
2021-01-12 18:12:54 -08:00
2020-04-02 09:35:31 -07:00
2021-01-17 12:08:04 -08:00
2020-12-15 12:13:42 -08:00
2020-12-15 14:55:10 -08:00
2020-12-15 12:13:45 -08:00
2020-10-13 18:38:34 -07:00
2020-08-12 10:57:58 -07:00
2020-12-15 12:13:46 -08:00
2020-12-15 12:13:46 -08:00