Chao Yu
e9219fa63c
mm/slub: fix to return errno if kmalloc() fails
...
commit 7e9c323c52b379d261a72dc7bd38120a761a93cd upstream.
In create_unique_id(), kmalloc(, GFP_KERNEL) can fail due to
out-of-memory, if it fails, return errno correctly rather than
triggering panic via BUG_ON();
kernel BUG at mm/slub.c:5893!
Internal error: Oops - BUG: 0 [#1 ] PREEMPT SMP
Call trace:
sysfs_slab_add+0x258/0x260 mm/slub.c:5973
__kmem_cache_create+0x60/0x118 mm/slub.c:4899
create_cache mm/slab_common.c:229 [inline]
kmem_cache_create_usercopy+0x19c/0x31c mm/slab_common.c:335
kmem_cache_create+0x1c/0x28 mm/slab_common.c:390
f2fs_kmem_cache_create fs/f2fs/f2fs.h:2766 [inline]
f2fs_init_xattr_caches+0x78/0xb4 fs/f2fs/xattr.c:808
f2fs_fill_super+0x1050/0x1e0c fs/f2fs/super.c:4149
mount_bdev+0x1b8/0x210 fs/super.c:1400
f2fs_mount+0x44/0x58 fs/f2fs/super.c:4512
legacy_get_tree+0x30/0x74 fs/fs_context.c:610
vfs_get_tree+0x40/0x140 fs/super.c:1530
do_new_mount+0x1dc/0x4e4 fs/namespace.c:3040
path_mount+0x358/0x914 fs/namespace.c:3370
do_mount fs/namespace.c:3383 [inline]
__do_sys_mount fs/namespace.c:3591 [inline]
__se_sys_mount fs/namespace.c:3568 [inline]
__arm64_sys_mount+0x2f8/0x408 fs/namespace.c:3568
Cc: <stable@kernel.org>
Fixes: 81819f0fc8285 ("SLUB core")
Reported-by: syzbot+81684812ea68216e08c5@syzkaller.appspotmail.com
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com>
Signed-off-by: Chao Yu <chao.yu@oppo.com>
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-09-28 10:55:45 +02:00
..
2019-05-08 07:19:07 +02:00
2021-12-14 10:04:47 +01:00
2016-07-26 16:19:19 -07:00
2016-10-11 15:06:33 -07:00
2016-01-27 09:09:57 -05:00
2019-06-22 08:17:12 +02:00
2019-08-06 18:29:37 +02:00
2017-01-12 11:39:32 +01:00
2016-03-17 15:09:34 -07:00
2018-09-19 22:47:17 +02:00
2016-03-17 15:09:34 -07:00
2018-02-25 11:05:49 +01:00
2018-09-15 09:42:57 +02:00
2016-03-15 16:55:16 -07:00
2020-10-01 20:40:11 +02:00
2018-11-10 07:42:52 -08:00
2016-07-26 16:19:19 -07:00
2022-01-27 08:47:42 +01:00
2016-05-19 19:12:14 -07:00
2022-01-27 08:47:42 +01:00
2019-11-25 09:51:58 +01:00
2022-06-14 16:52:36 +02:00
2017-01-06 10:40:13 +01:00
2019-12-05 15:35:02 +01:00
2018-05-22 16:57:57 +02:00
2016-09-13 02:35:27 +02:00
2021-05-22 10:40:31 +02:00
2016-03-17 15:09:34 -07:00
2016-03-17 15:09:34 -07:00
2022-09-15 12:39:45 +02:00
2021-05-22 10:40:31 +02:00
2019-06-22 08:17:18 +02:00
2020-09-12 11:47:35 +02:00
2018-10-10 08:53:20 +02:00
2016-10-12 10:23:41 -07:00
2022-03-02 11:32:06 +01:00
2022-04-20 09:06:41 +02:00
2020-08-21 11:02:11 +02:00
2021-06-30 08:49:13 -04:00
2022-07-21 20:40:33 +02:00
2022-07-29 17:05:46 +02:00
2016-07-28 16:07:41 -07:00
2019-03-13 14:04:54 -07:00
2019-05-21 18:48:58 +02:00
2019-07-10 09:55:43 +02:00
2016-03-17 15:09:34 -07:00
2022-09-20 11:50:16 +02:00
2016-04-28 11:44:19 +02:00
2019-08-04 09:33:42 +02:00
2016-05-19 19:12:14 -07:00
2018-08-15 18:14:45 +02:00
2022-04-20 09:06:44 +02:00
2017-08-24 17:12:19 -07:00
2020-04-02 17:20:26 +02:00
2021-11-26 11:48:40 +01:00
2022-04-27 13:14:10 +02:00
2019-04-05 22:29:06 +02:00
2019-07-10 09:55:38 +02:00
2021-03-07 11:25:59 +01:00
2016-10-07 18:46:29 -07:00
2016-10-07 18:46:27 -07:00
2016-06-03 15:06:22 -07:00
2021-02-23 13:59:14 +01:00
2020-10-01 20:40:06 +02:00
2016-03-17 15:09:34 -07:00
2019-04-27 09:34:47 +02:00
2016-03-17 15:09:34 -07:00
2016-10-18 14:13:37 -07:00
2016-03-17 15:09:34 -07:00
2016-08-26 17:39:35 -07:00
2022-09-05 10:23:58 +02:00
2022-03-08 19:00:59 +01:00
2020-06-30 15:38:44 -04:00
2019-06-22 08:17:13 +02:00
2021-11-26 11:48:42 +01:00
2017-03-22 12:43:38 +01:00
2022-09-28 10:55:45 +02:00
2016-08-02 17:31:41 -04:00
2017-10-21 17:21:36 +02:00
2017-07-05 14:40:17 +02:00
2020-07-09 09:35:54 +02:00
2016-10-07 18:46:28 -07:00
2021-03-07 11:25:59 +01:00
2018-12-08 13:05:09 +01:00
2019-10-17 13:42:06 -07:00
2022-05-15 19:39:17 +02:00
2022-06-25 11:45:15 +02:00
2018-09-19 22:47:17 +02:00
2020-06-03 08:16:47 +02:00
2017-03-12 06:41:43 +01:00
2018-09-19 22:47:12 +02:00
2021-06-03 08:23:27 +02:00
2017-04-08 09:30:36 +02:00
2016-06-03 16:02:55 -07:00
2016-01-15 11:40:52 -08:00
2021-11-26 11:48:39 +01:00
2018-09-05 09:20:02 +02:00