Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3556606pxb; Mon, 1 Mar 2021 13:15:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJxIPCfbw+F3gghrMuHW7n9zIefGNdj0kSA2uo+sLom8cTiuHP/GZkN4QwvTPAH/rSpjOyrY X-Received: by 2002:a17:907:a06b:: with SMTP id ia11mr6800308ejc.294.1614633315751; Mon, 01 Mar 2021 13:15:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614633315; cv=none; d=google.com; s=arc-20160816; b=TQdmKBZmSh1KOKxhz7Y/mqWA5XpdNyHwgIEQkGu8TTd6qr+3x4C9VfaWPJrTBlcDME 0FXmYqmjt1E0eo4Mziiv12uKO8imqRJMETFbGxhCb1KS81D0oSgGrDQOoDaty2G+ptd8 7TBq9ZGobe2tWYBuhZ0jqiBdouZ9t5gHC1L0Dn9GlWTf/72x3LrXs7IQisN1UANfJ/hu iQ5PO3UuVJKSjCaLP5qco00vrUiGgCz1g06nqKJm1BZndK28msJ6nrKexNxr+G/RT6CO APNzkWxgOOuK/pRamVLEyPbsILPF4nNAM4iAj/Ur/zdV2YlACXqqI/apBAVfFJjbAjwO +oUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=rcudgvKtUo9rpE2YjPfKBKm4f8wsnLz2opcfzFPw4Ic=; b=lt+EM3Sfjv4obxH2GJzeIE9RM8F5b10MDZdebKRPEHLHpDTbcYVW/WINaRieeLa0wi maKX/lbE3+SeEud6uK0ctZjh6xDlzjzBgi+M+XjyhMZMQWLXGFQaxDWCyAzlSXG7U2Tf rFF5PZurFViviThVOpoAOctQLFsCnOjX7FNYVU+1ckjHd9gRQ1dnLYm35mwQBoQQGEbW gNOwHTPVXzjMTBFi1F/FbD8OdvL2a2M5Z1z7vhM/ZATAZ0Zv7U1wMI86qL8SJwnxPKEg nDYhMLvdIWvZEJeXQZFiRk94LIkyGT56nwUgtIajngIHjORpcNVdCVaOFqzzt4BDiAL5 ka4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ckkgNVLs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g20si9062237edq.32.2021.03.01.13.14.53; Mon, 01 Mar 2021 13:15:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ckkgNVLs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232396AbhCAVKJ (ORCPT + 99 others); Mon, 1 Mar 2021 16:10:09 -0500 Received: from mail.kernel.org ([198.145.29.99]:52652 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237854AbhCARNg (ORCPT ); Mon, 1 Mar 2021 12:13:36 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 22F3464E31; Mon, 1 Mar 2021 16:43:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614617037; bh=1j8tOCw2di61nDs3fihxkIALOMwjcbJSzl/ScivA/LI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ckkgNVLsiu4/CrQGwp025JOK0MH6OZ+iMKMLhXggDGPi8Trv7uF/HJ+BM4fH/JOBe t3LsFvJQCu+ygjDEZjbOXO3zKuFeltACxDOO9CmfnvSeVbn6SXNFx/OCEIon6iIUG+ V4iwspYxp0thTgObVZ6MZeUz6pvwl4beyMvjN8js= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Hanjun Guo , Qinglang Miao , "Rafael J. Wysocki" Subject: [PATCH 4.19 180/247] ACPI: configfs: add missing check after configfs_register_default_group() Date: Mon, 1 Mar 2021 17:13:20 +0100 Message-Id: <20210301161040.469539582@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210301161031.684018251@linuxfoundation.org> References: <20210301161031.684018251@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Qinglang Miao commit 67e40054de86aae520ddc2a072d7f6951812a14f upstream. A list_add corruption is reported by Hulk Robot like this: ============== list_add corruption. Call Trace: link_obj+0xc0/0x1c0 link_group+0x21/0x140 configfs_register_subsystem+0xdb/0x380 acpi_configfs_init+0x25/0x1000 [acpi_configfs] do_one_initcall+0x149/0x820 do_init_module+0x1ef/0x720 load_module+0x35c8/0x4380 __do_sys_finit_module+0x10d/0x1a0 do_syscall_64+0x34/0x80 It's because of the missing check after configfs_register_default_group, where configfs_unregister_subsystem should be called once failure. Fixes: 612bd01fc6e0 ("ACPI: add support for loading SSDTs via configfs") Reported-by: Hulk Robot Suggested-by: Hanjun Guo Signed-off-by: Qinglang Miao Cc: 4.10+ # 4.10+ Signed-off-by: Rafael J. Wysocki Signed-off-by: Greg Kroah-Hartman --- drivers/acpi/acpi_configfs.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) --- a/drivers/acpi/acpi_configfs.c +++ b/drivers/acpi/acpi_configfs.c @@ -269,7 +269,12 @@ static int __init acpi_configfs_init(voi acpi_table_group = configfs_register_default_group(root, "table", &acpi_tables_type); - return PTR_ERR_OR_ZERO(acpi_table_group); + if (IS_ERR(acpi_table_group)) { + configfs_unregister_subsystem(&acpi_configfs); + return PTR_ERR(acpi_table_group); + } + + return 0; } module_init(acpi_configfs_init);