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 9A93C1E764B; Tue, 15 Oct 2024 11:59:41 +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=1728993581; cv=none; b=JJUlpLuc/npcn0uGsp5bfMXFpjaGIAc0yXClN+hUYuODfXwTgBsmLwFdqBLpUZKa8zeg/mSnVtFw4r9jnYIcP0OdkzefmQ/PHqMHAU6zWJGDERjVPEtdlExbjKJLQHahZnTSoYfTBItVTKYihZ4AY9A8bib2VOdkB9lpROWmUAM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728993581; c=relaxed/simple; bh=0rxiGhCqze81dqv+Bc71vv0HniVUrZk/kowlFrLeuKg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=M9/adRUeMIwiLLw0AnFimEvtOT/W2jJ00lrOf2Pu9z02WMM42PBuiUtHSFNTF2RHCTbbJvYf4kywTDi/cVlD8aQhEhzXu5Ss73luZM4AM5dXn4MjVUS4if/zA64CrFcxDm0AgjlonXOH+ghbKInNVSyKnDnyUQmN5KI8p4KmjdQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=dtd41ucx; 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="dtd41ucx" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E1F87C4CECE; Tue, 15 Oct 2024 11:59:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1728993581; bh=0rxiGhCqze81dqv+Bc71vv0HniVUrZk/kowlFrLeuKg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dtd41ucx5zQoim11porDZZXmHbmW8dlXE+cyaPyTwF8xbCm76HzDhnv9rOiDaGLSs dkhM5Tv7Qg5YppUo/7i/slmzVSWtjNody5NC8xCD3yxINi88p0rj0PrtF9kLDWh3Ke aOSLn2o0dxhvEkZ6tWckMK5TwtNBfnvwQ500/wIg= 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.15 423/691] ACPICA: check null return of ACPI_ALLOCATE_ZEROED() in acpi_db_convert_to_package() Date: Tue, 15 Oct 2024 13:26:11 +0200 Message-ID: <20241015112457.133699832@linuxfoundation.org> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241015112440.309539031@linuxfoundation.org> References: <20241015112440.309539031@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.15-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 2b84ac093698a..8dbab69320499 100644 --- a/drivers/acpi/acpica/dbconvert.c +++ b/drivers/acpi/acpica/dbconvert.c @@ -174,6 +174,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