Files
linux-stable-mirror/include/linux
Mauro Carvalho ChehabandSasha Levin ca2aad8771 EFI/CPER: don't go past the ARM processor CPER record buffer
[ Upstream commit eae21beecb ]

There's a logic inside GHES/CPER to detect if the section_length
is too small, but it doesn't detect if it is too big.

Currently, if the firmware receives an ARM processor CPER record
stating that a section length is big, kernel will blindly trust
section_length, producing a very long dump. For instance, a 67
bytes record with ERR_INFO_NUM set 46198 and section length
set to 854918320 would dump a lot of data going a way past the
firmware memory-mapped area.

Fix it by adding a logic to prevent it to go past the buffer
if ERR_INFO_NUM is too big, making it report instead:

	[Hardware Error]: Hardware error from APEI Generic Hardware Error Source: 1
	[Hardware Error]: event severity: recoverable
	[Hardware Error]:  Error 0, type: recoverable
	[Hardware Error]:   section_type: ARM processor error
	[Hardware Error]:   MIDR: 0xff304b2f8476870a
	[Hardware Error]:   section length: 854918320, CPER size: 67
	[Hardware Error]:   section length is too big
	[Hardware Error]:   firmware-generated error record is incorrect
	[Hardware Error]:   ERR_INFO_NUM is 46198

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Hanjun Guo <guohanjun@huawei.com>
[ rjw: Subject and changelog tweaks ]
Link: https://patch.msgid.link/41cd9f6b3ace3cdff7a5e864890849e4b1c58b63.1767871950.git.mchehab+huawei@kernel.org
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2026-03-04 07:19:58 -05:00
..
2026-03-04 07:19:26 -05:00
2024-07-05 09:14:50 +02:00
2025-09-11 17:17:17 +02:00
2024-12-14 19:51:34 +01:00
2024-04-10 16:19:07 +02:00
2025-12-07 06:09:29 +09:00
2026-01-19 13:09:57 +01:00
2025-07-10 15:57:42 +02:00
2024-04-10 16:18:55 +02:00
2025-06-04 14:38:07 +02:00
2025-08-28 16:24:06 +02:00
2024-06-16 13:39:27 +02:00
2025-04-10 14:31:55 +02:00
2025-02-01 18:23:59 +01:00
2026-01-19 13:10:06 +01:00
2025-08-28 16:24:13 +02:00