From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 70D0E1F943B; Wed, 6 Nov 2024 13:05:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730898337; cv=none; b=PsTX6F0GUSMjdAfpr6eMhxMXjMlih9Y0Eru0r9FJfSYasYQXJA7K4L6unAIbFJ3YY6JChh7eeGZn6CUPysSL3QA1fTfhwV8mhzcKkkw7GyLSn1mvB+skESvqo6q4zBnrZhFxZS6uM5oGdiJzmN071vi+C+P4J65DQThXd3d8Nyo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730898337; c=relaxed/simple; bh=KnatVHw/SalzOKN+j0LL5Hwu2dzHujHI/B/IonSb98o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mq0vPc2bkJNskjQhaXocHBOfP/BkiPB2SbSFsecUu0qfAhdOlauas2b5H+eM4TEreDm+3Xxg0yyGwQJw9St+WAzBCFrl5gU1K6j3CQFB36UAI2XP1RUM6WmFgPR5YbQUPIyp/kCLfrSOiROTqIo/VO8aHPnDiMc/XYGIkLaxjGA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=pC57f0gT; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="pC57f0gT" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B244BC4CECD; Wed, 6 Nov 2024 13:05:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1730898337; bh=KnatVHw/SalzOKN+j0LL5Hwu2dzHujHI/B/IonSb98o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pC57f0gTyVA2y6eBf8bp6U82bGp1xxKa7Qm76GlV0kyDdNwdLvoAdV2skFCqQM+2H JYge18A1i3mVSBy7E4N32TyhjB+PWFLkQ2LjqkZNTzwrTbWJBz1pwktuv62u0hxnhZ BAVlPEqOJF3/unK/XD1pXcTqhNBU9vJMgz9rELKo= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Pei Xiao , "Rafael J. Wysocki" , Sasha Levin Subject: [PATCH 5.4 205/462] ACPICA: check null return of ACPI_ALLOCATE_ZEROED() in acpi_db_convert_to_package() Date: Wed, 6 Nov 2024 13:01:38 +0100 Message-ID: <20241106120336.581585355@linuxfoundation.org> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241106120331.497003148@linuxfoundation.org> References: <20241106120331.497003148@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Pei Xiao [ Upstream commit a5242874488eba2b9062985bf13743c029821330 ] ACPICA commit 4d4547cf13cca820ff7e0f859ba83e1a610b9fd0 ACPI_ALLOCATE_ZEROED() may fail, elements might be NULL and will cause NULL pointer dereference later. Link: https://github.com/acpica/acpica/commit/4d4547cf Signed-off-by: Pei Xiao Link: https://patch.msgid.link/tencent_4A21A2865B8B0A0D12CAEBEB84708EDDB505@qq.com [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin --- drivers/acpi/acpica/dbconvert.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/acpi/acpica/dbconvert.c b/drivers/acpi/acpica/dbconvert.c index 9fd9a98a9cbe8..5255a0837c82b 100644 --- a/drivers/acpi/acpica/dbconvert.c +++ b/drivers/acpi/acpica/dbconvert.c @@ -170,6 +170,8 @@ acpi_status acpi_db_convert_to_package(char *string, union acpi_object *object) elements = ACPI_ALLOCATE_ZEROED(DB_DEFAULT_PKG_ELEMENTS * sizeof(union acpi_object)); + if (!elements) + return (AE_NO_MEMORY); this = string; for (i = 0; i < (DB_DEFAULT_PKG_ELEMENTS - 1); i++) { -- 2.43.0