Skip to content

Commit 53fc7e8

Browse files
axiqiarafaeljw
authored andcommitted
ACPI: APEI: EINJ: Limit error type to 32-bit width
The bit map of error types to inject is 32-bit width [1]. Add parameter check to reflect the fact. [1] ACPI Specification 6.4, Section 18.6.4. Error Types Signed-off-by: Shuai Xue <xueshuai@linux.alibaba.com> Reviewed-by: Tony Luck <tony.luck@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 6d796c5 commit 53fc7e8

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

drivers/acpi/apei/einj.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,10 @@ static int error_type_set(void *data, u64 val)
616616
u32 available_error_type = 0;
617617
u32 tval, vendor;
618618

619+
/* Only low 32 bits for error type are valid */
620+
if (val & GENMASK_ULL(63, 32))
621+
return -EINVAL;
622+
619623
/*
620624
* Vendor defined types have 0x80000000 bit set, and
621625
* are not enumerated by ACPI_EINJ_GET_ERROR_TYPE

0 commit comments

Comments
 (0)