diff options
author | Shuai Xue <xueshuai@linux.alibaba.com> | 2023-01-18 14:35:04 +0800 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2023-01-30 16:40:05 +0100 |
commit | 53fc7e80f3aa9c34d396bcfbcc03a4c0d2eaac96 (patch) | |
tree | 0be02a46fe518e2e719db8f28966f05a08483b8a /drivers/acpi | |
parent | 6d796c50f84ca79f1722bb131799e5a5710c4700 (diff) |
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>
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/apei/einj.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/acpi/apei/einj.c b/drivers/acpi/apei/einj.c index ab86b2f4e719..b4373e575660 100644 --- a/drivers/acpi/apei/einj.c +++ b/drivers/acpi/apei/einj.c @@ -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 |