Skip to content

Commit

Permalink
ACPI: APEI: EINJ: Limit error type to 32-bit width
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Shuai Xue authored and Rafael J. Wysocki committed Jan 30, 2023
1 parent 6d796c5 commit 53fc7e8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/acpi/apei/einj.c
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,10 @@ static int error_type_set(void *data, u64 val)
u32 available_error_type = 0;
u32 tval, vendor;

/* Only low 32 bits for error type are valid */
if (val & GENMASK_ULL(63, 32))
return -EINVAL;

/*
* Vendor defined types have 0x80000000 bit set, and
* are not enumerated by ACPI_EINJ_GET_ERROR_TYPE
Expand Down

0 comments on commit 53fc7e8

Please sign in to comment.