mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 12:44:03 +02:00
ACPI: APEI: GHES: fix ARM section length accounting after header
In ghes_handle_arm_hw_error(), after skipping the cper_sec_proc_arm
header with (err + 1), the remaining length was reduced by sizeof(err)
(pointer size) instead of sizeof(*err) (structure size).
That overestimates the bytes left for cper_arm_err_info records and can
let the parser read past the CPER section when err_info_num is large
enough relative to error_data_length.
Use sizeof(*err) so the length accounting matches the pointer advance
and the earlier sizeof(*err) size check.
Fixes: 87880af2d2 ("APEI/GHES: ARM processor Error: don't go past allocated memory")
Cc: stable@vger.kernel.org
Signed-off-by: TanZheng <tanzheng@kylinos.cn>
Reviewed-by: Shuai Xue <xueshuai@linux.alibaba.com>
Link: https://patch.msgid.link/20260806010944.32384-1-kensanya@163.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
7bfd21e828
commit
903308ea40
|
|
@ -576,7 +576,7 @@ static bool ghes_handle_arm_hw_error(struct acpi_hest_generic_data *gdata,
|
|||
return false;
|
||||
|
||||
p = (char *)(err + 1);
|
||||
length -= sizeof(err);
|
||||
length -= sizeof(*err);
|
||||
|
||||
for (i = 0; i < err->err_info_num; i++) {
|
||||
struct cper_arm_err_info *err_info;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user