]> Git Repo - linux.git/commitdiff
ACPI: APEI: EINJ: Limit error type to 32-bit width
authorShuai Xue <[email protected]>
Wed, 18 Jan 2023 06:35:04 +0000 (14:35 +0800)
committerRafael J. Wysocki <[email protected]>
Mon, 30 Jan 2023 15:40:05 +0000 (16:40 +0100)
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 <[email protected]>
Reviewed-by: Tony Luck <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
drivers/acpi/apei/einj.c

index ab86b2f4e719f5fd409709ca1e7d12ae1c12b94a..b4373e5756605184a677ce77012a775a490fe37e 100644 (file)
@@ -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
This page took 0.055747 seconds and 4 git commands to generate.