Miaohe Lin
4f5d1c29cf
mm, slub: fix potential memoryleak in kmem_cache_open()
...
commit 9037c57681d25e4dcc442d940d6dbe24dd31f461 upstream.
In error path, the random_seq of slub cache might be leaked. Fix this
by using __kmem_cache_release() to release all the relevant resources.
Link: https://lkml.kernel.org/r/20210916123920.48704-4-linmiaohe@huawei.com
Fixes: 210e7a43fa90 ("mm: SLUB freelist randomization")
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Reviewed-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Andrey Konovalov <andreyknvl@gmail.com>
Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Cc: Bharata B Rao <bharata@linux.ibm.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Faiyaz Mohammed <faiyazm@codeaurora.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Roman Gushchin <guro@fb.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-10-27 09:54:28 +02:00
..
2021-01-27 11:47:53 +01:00
2020-05-14 07:58:30 +02:00
2019-09-04 07:42:01 -04:00
2019-07-12 12:24:03 -07:00
2019-05-14 09:47:45 -07:00
2020-09-03 11:26:51 +02:00
2021-03-04 10:26:39 +01:00
2020-03-05 16:43:51 +01:00
2019-07-12 11:05:46 -07:00
2019-08-30 22:43:58 -07:00
2019-07-12 11:05:43 -07:00
2021-06-10 13:37:15 +02:00
2019-09-25 17:51:41 -07:00
2019-06-19 17:09:52 +02:00
2020-01-09 10:20:00 +01:00
2020-10-01 13:18:24 +02:00
2018-12-28 12:11:47 -08:00
2019-09-07 04:28:04 -03:00
2021-07-14 16:53:47 +02:00
2019-11-15 18:34:00 -08:00
2021-06-30 08:47:55 -04:00
2019-06-03 15:39:40 +02:00
2019-10-19 06:32:32 -04:00
2021-06-30 08:47:52 -04:00
2019-06-19 17:09:08 +02:00
2020-12-16 10:56:59 +01:00
2019-09-24 15:54:08 -07:00
2021-05-19 10:08:27 +02:00
2019-06-05 17:37:06 +02:00
2020-10-01 13:17:53 +02:00
2021-05-19 10:08:27 +02:00
2020-12-11 13:23:31 +01:00
2020-01-17 19:48:40 +01:00
2020-10-01 13:18:21 +02:00
2019-09-24 15:54:10 -07:00
2021-02-10 09:25:28 +01:00
2021-08-26 08:36:22 -04:00
2019-09-24 15:54:08 -07:00
2021-09-22 12:26:43 +02:00
2021-06-23 14:41:23 +02:00
2021-06-30 08:47:53 -04:00
2020-11-10 12:37:27 +01:00
2019-03-05 21:07:20 -08:00
2020-01-09 10:19:56 +01:00
2021-06-30 08:47:52 -04:00
2019-09-25 17:51:41 -07:00
2019-09-25 17:51:41 -07:00
2019-05-21 10:50:45 +02:00
2020-10-01 13:17:54 +02:00
2020-09-03 11:26:51 +02:00
2020-02-11 04:35:42 -08:00
2019-11-06 08:47:50 -08:00
2020-03-12 13:00:19 +01:00
2020-06-07 13:18:46 +02:00
2019-09-25 17:51:41 -07:00
2020-03-25 08:25:58 +01:00
2021-09-03 10:08:12 +02:00
2021-09-12 08:56:41 +02:00
2020-08-21 13:05:27 +02:00
2019-10-14 15:04:00 -07:00
2019-06-29 16:43:45 +08:00
2021-03-07 12:20:49 +01:00
2020-09-23 12:40:47 +02:00
2020-10-29 09:57:52 +01:00
2019-09-24 15:54:08 -07:00
2021-06-30 08:47:55 -04:00
2020-01-23 08:22:41 +01:00
2020-10-01 13:17:30 +02:00
2019-03-13 12:25:31 -07:00
2019-06-05 17:37:16 +02:00
2019-06-05 17:37:16 +02:00
2019-06-05 17:37:16 +02:00
2020-09-23 12:40:45 +02:00
2021-06-30 08:47:52 -04:00
2019-05-30 11:26:32 -07:00
2019-05-21 10:50:45 +02:00
2021-06-30 08:47:53 -04:00
2019-06-05 17:37:17 +02:00
2021-05-19 10:08:29 +02:00
2020-09-03 11:26:51 +02:00
2019-05-14 19:52:48 -07:00
2021-07-25 14:35:14 +02:00
2020-01-23 08:22:40 +01:00
2019-11-06 08:47:50 -08:00
2019-10-07 15:47:20 -07:00
2021-10-27 09:54:28 +02:00
2019-07-18 17:08:07 -07:00
2021-05-14 09:44:32 +02:00
2018-08-22 10:52:44 -07:00
2020-10-01 13:18:08 +02:00
2019-09-25 17:51:41 -07:00
2021-03-07 12:20:49 +01:00
2021-06-30 08:47:53 -04:00
2019-09-17 15:20:17 -07:00
2021-03-30 14:35:19 +02:00
2020-06-17 16:40:23 +02:00
2018-09-13 15:18:04 -10:00
2020-09-03 11:26:52 +02:00
2019-10-07 15:47:19 -07:00
2021-09-22 12:26:37 +02:00
2019-11-06 08:47:50 -08:00
2019-08-13 16:06:52 -07:00
2021-07-14 16:53:47 +02:00
2019-05-21 10:50:45 +02:00
2019-09-24 15:54:12 -07:00
2021-03-07 12:20:49 +01:00
2019-09-24 15:54:12 -07:00