Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp4903061rwb; Tue, 6 Sep 2022 14:55:15 -0700 (PDT) X-Google-Smtp-Source: AA6agR6n4Aiiow4sZxgWec5f16UsJbL+oELIFUEUNOSbOO8Bh9fu/ovNZQLd7fDXcViW+cJ8wKND X-Received: by 2002:a17:906:fe09:b0:73d:90ae:f801 with SMTP id wy9-20020a170906fe0900b0073d90aef801mr308346ejb.699.1662501315689; Tue, 06 Sep 2022 14:55:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662501315; cv=none; d=google.com; s=arc-20160816; b=PP69N5czl9oVw1VHuJx41PsBKmlA6F/tjFzgMvSFl2kCmjEH8ZHc6YIgPgqIdw80tP NyyFWtNxFDWw9gdJerZZIceZMdf/rgTwEdppU67ovfvV+mdVR70iy/vm+FJxw6z9xgHn Hx2AptSjzVB34P6nSXfM/sAalYTGf0I2ScZGNYa0coBwuz+4reY20TIutryOBt65aeEO kHiwK3ONwo9nC75tvfC3jhO/l99GTSUg2A8i3k/IwRsf2ra3FYr5rXpf3mH84PNzy3O/ dkQdTtbCPdDSaVc89ehNYsX1C2uhTpw1rCfOmQzKUOYceBea+Gur9upNdfhndeLF1rsE iT2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date:dkim-signature; bh=ZGYMVwiUEuLgtCDiQ8JfQCJPv9C+qcRU1c030cWDM0I=; b=s+suW+/C9GePkvzMLQ677n/CJn7dEL/YeuVf4N2sbtxZwMGsEWTiuDJ/4hHDysKYk1 5lZbuM05YMAO2vpPFkjtgyIZmm1NdnjE6jRBgGnpYBGkOZH3J/esOI/hSxZNBep/f6Rg dOTqreWJ8HKQRejJPx2vxkasebYvshNUfMcIlPZ8tKIoKodUsDMQPOkS1EsdBiis1zII S1/GNATOAcQ56ZytjLHy6VmDzaMqojM4wU0MtVgQQ1GkjIcCKWmTlpAAbOOa9ClmQDiR 5ZnmSedEhyKzY/ZMGKPxbwZaYFEsQAF1lhOVWFrUzjc6eO8457pxe6+QZKw0Uvp6utq1 /fng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=aK9f85kN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id la26-20020a170907781a00b007707df32febsi250200ejc.953.2022.09.06.14.54.50; Tue, 06 Sep 2022 14:55:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=aK9f85kN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229636AbiIFVdh (ORCPT + 99 others); Tue, 6 Sep 2022 17:33:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229627AbiIFVdf (ORCPT ); Tue, 6 Sep 2022 17:33:35 -0400 Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD720B8F23 for ; Tue, 6 Sep 2022 14:33:34 -0700 (PDT) Received: by mail-pf1-x434.google.com with SMTP id 65so2438379pfx.0 for ; Tue, 06 Sep 2022 14:33:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:from:to:cc:subject:date; bh=ZGYMVwiUEuLgtCDiQ8JfQCJPv9C+qcRU1c030cWDM0I=; b=aK9f85kNRa+1y5yKwv2P5ffGl1MdLdYym3bJvNDQqFvl1BAGrABmVa4NGeLFAKyI4I LolMhPS6SJFzYs8R687/VEtDa6xfuNehAJkSlbiTM5KOq355WspKihLK3QY8Kq5zTHGX S9+xb3hU1ETK+YenJ3YLR36Uc4o/2LF4kfTqnVNwSFyR1iLQuPlhmXRqeZ00obBwGvmu kAYEpwpe39C2RyYWCnZxNx/5HgMWjpRnbgOr6l+SAGCBJI2wfmrp529QqzuqyD3BJPj0 Xo+YU3nLQnH41+CaN5h+9GzwQq4uZgo3fajv1p004iqsKnDIXnu7lNmfVgfAgMQlf7PM m1nA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:x-gm-message-state:from:to:cc:subject:date; bh=ZGYMVwiUEuLgtCDiQ8JfQCJPv9C+qcRU1c030cWDM0I=; b=WhXR2mlp58JDIN8Au2dMNY+ntfWpW2xcnzXkSkU/O9JY62Q+qaUC1I7PsDIbZn6BKd 5ry6q+Rml6dAQmLGoliyYTUq+rU8QA/wutBjBt7nWtT2lv8bf461wSF7xL4ZZv9I3SRU RA4d2zmmnutGBJmsnsTGMvMJjE+1glOpTyRkWD85ueTRn5q9BTtiTEFHltXpHmZNC0Yl 2AnRHnGmIqMKsbcFofSSLJwQvQ463ooCI55lcO0Rk/h0IXcj4EHBsdcx1E2eBvyi3ykH yoHao+H3tdTDyN4Tp5W/HHRn8IMLj0av6GY7KQhAfCYGdSJobkmpRXGZKKfQ8aoCbSNH VyMg== X-Gm-Message-State: ACgBeo1B3qbiSVA9arUK74su4+RaBtO12Gc7a80IlGfnWL1/AeGP7W4l AWTIevytQYqwmUBB4YID/O3kKh1Cp1rRaQ== X-Received: by 2002:a62:be0e:0:b0:536:76fe:ee96 with SMTP id l14-20020a62be0e000000b0053676feee96mr389440pff.44.1662500014172; Tue, 06 Sep 2022 14:33:34 -0700 (PDT) Received: from [2620:15c:29:203:9177:d472:6043:99cf] ([2620:15c:29:203:9177:d472:6043:99cf]) by smtp.gmail.com with ESMTPSA id a25-20020a62d419000000b005366696b735sm10587853pfh.77.2022.09.06.14.33.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Sep 2022 14:33:33 -0700 (PDT) Date: Tue, 6 Sep 2022 14:33:32 -0700 (PDT) From: David Rientjes To: Chao Yu cc: linux-mm@kvack.org, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, jaegeuk@kernel.org, Chao Yu , stable@kernel.org, syzbot+81684812ea68216e08c5@syzkaller.appspotmail.com Subject: Re: [PATCH] mm/slub: fix to return errno if kmalloc() fails In-Reply-To: <20220830141009.150075-1-chao@kernel.org> Message-ID: References: <20220830141009.150075-1-chao@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 30 Aug 2022, Chao Yu wrote: > From: Chao Yu > > 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: > Reported-by: syzbot+81684812ea68216e08c5@syzkaller.appspotmail.com > Signed-off-by: Chao Yu Acked-by: David Rientjes