[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251222113630.00002826@huawei.com>
Date: Mon, 22 Dec 2025 11:36:30 +0000
From: Jonathan Cameron <jonathan.cameron@...wei.com>
To: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
CC: "Rafael J. Wysocki" <rafael@...nel.org>, Ard Biesheuvel <ardb@...nel.org>,
Borislav Petkov <bp@...en8.de>, Dave Jiang <dave.jiang@...el.com>, Fan Ni
<fan.ni@...sung.com>, Shuai Xue <xueshuai@...ux.alibaba.com>, Smita
Koralahalli <Smita.KoralahalliChannabasappa@....com>,
<linux-efi@...r.kernel.org>, <linux-acpi@...r.kernel.org>,
<linux-edac@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3 2/2] efi/cper: don't go past the ARM processor CPER
record buffer
On Fri, 19 Dec 2025 11:50:00 +0100
Mauro Carvalho Chehab <mchehab+huawei@...nel.org> wrote:
> 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@...nel.org>
Reviewed-by: Jonathan Cameron <jonathan.cameron@...wei.com>
Powered by blists - more mailing lists