From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 60D9FECAAA1 for ; Wed, 31 Aug 2022 03:09:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C36186B0071; Tue, 30 Aug 2022 23:09:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BBEEF6B0072; Tue, 30 Aug 2022 23:09:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A601F8D0001; Tue, 30 Aug 2022 23:09:20 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 956F66B0071 for ; Tue, 30 Aug 2022 23:09:20 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 601B81A069D for ; Wed, 31 Aug 2022 03:09:20 +0000 (UTC) X-FDA: 79858406880.09.ED026BD Received: from out1.migadu.com (out1.migadu.com [91.121.223.63]) by imf22.hostedemail.com (Postfix) with ESMTP id D882DC004A for ; Wed, 31 Aug 2022 03:09:19 +0000 (UTC) Content-Type: text/plain; charset=utf-8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1661915357; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Q+3ORk9w0/P8hMy0Rd0PJ5O8aOfIB0XvybrmSgQilEU=; b=cPM+ReclE4FItUUB6STpSHjWCfinlVZbVvQKPf3AUXF422+uFW6nMaYvbE6JT9sFVYB5zd 2X5Q2JZM0pWA2Z2gG+pIM/E5yf9JFgF1pvXeRvPQ8sjkhONl7LbjIXrihB7zuTFmzvxFc2 kmKRyWLrmUziPibEyosNe2TTwi4WHqo= MIME-Version: 1.0 Subject: Re: [PATCH] mm/slub: fix to return errno if kmalloc() fails X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Muchun Song In-Reply-To: <20220830141009.150075-1-chao@kernel.org> Date: Wed, 31 Aug 2022 11:09:09 +0800 Cc: Linux MM , Andrew Morton , linux-kernel@vger.kernel.org, jaegeuk@kernel.org, Chao Yu , stable@kernel.org, syzbot+81684812ea68216e08c5@syzkaller.appspotmail.com Content-Transfer-Encoding: quoted-printable Message-Id: References: <20220830141009.150075-1-chao@kernel.org> To: Chao Yu X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1661915360; a=rsa-sha256; cv=none; b=o0d+ddC1Wyj9DmFXR8/PO0kd2Fiqw+2d0CgEJlMr34sY3iKiQr7juLLuq6LT98/FADJ2QF GlxtqkD+xXbMtiH8sX7c5CbfOCcAXOkGsGoMH7sJwxP0DCY52+CO+rFmsRm7OTOvZBC/sc qnyajXMNGyI4Iz+tjKFrPiwqR+AxrmI= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=cPM+Recl; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf22.hostedemail.com: domain of muchun.song@linux.dev designates 91.121.223.63 as permitted sender) smtp.mailfrom=muchun.song@linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1661915360; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Q+3ORk9w0/P8hMy0Rd0PJ5O8aOfIB0XvybrmSgQilEU=; b=VUvKaU2VK4ee3KND88ED3mDVYNe2G9pAGqBRYyhIHU4qRimXKhSPxgTcIEwza5AWVOLBjg OF87AUYldor4lZGoGdzYgMWzI7E0Z2n/YHeA4xO1WFvwT1X6cCszxalGgC1bRqGq6xxAYM HobBkfO6EDFNdI+q7hsAmPVv+AuNslQ= Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=cPM+Recl; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf22.hostedemail.com: domain of muchun.song@linux.dev designates 91.121.223.63 as permitted sender) smtp.mailfrom=muchun.song@linux.dev X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: D882DC004A X-Stat-Signature: dnyapzskoqfh8xunaffhu99shn15ebxy X-Rspam-User: X-HE-Tag: 1661915359-820518 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: > On Aug 30, 2022, at 22:10, Chao Yu wrote: >=20 > From: Chao Yu >=20 > 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(); I tend to agree with you. A mount operation shouldn=E2=80=99t panic the kernel. >=20 > kernel BUG at mm/slub.c:5893! > Internal error: Oops - BUG: 0 [#1] PREEMPT SMP >=20 > 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 >=20 > Cc: > Reported-by: syzbot+81684812ea68216e08c5@syzkaller.appspotmail.com > Signed-off-by: Chao Yu Reviewed-by: Muchun Song Thanks.