]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
platform/x86: ISST: Check for unaligned mmio address
authorSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Fri, 4 Dec 2020 01:57:44 +0000 (17:57 -0800)
committerHans de Goede <hdegoede@redhat.com>
Mon, 7 Dec 2020 15:10:12 +0000 (16:10 +0100)
The address should be aligned to 4 byte boundary. So send an error for
unaligned address.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Link: https://lore.kernel.org/r/20201204015746.1168941-1-srinivas.pandruvada@linux.intel.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
drivers/platform/x86/intel_speed_select_if/isst_if_mmio.c

index aa17fd7817f8fdd4e075a15c7486d1d1bafbfc2f..e7e9808a1aed023ebdb5bf2c2cd2751129839b8c 100644 (file)
@@ -42,6 +42,9 @@ static long isst_if_mmio_rd_wr(u8 *cmd_ptr, int *write_only, int resume)
        if (io_reg->reg < 0x04 || io_reg->reg > 0xD0)
                return -EINVAL;
 
+       if (io_reg->reg % 4)
+               return -EINVAL;
+
        if (io_reg->read_write && !capable(CAP_SYS_ADMIN))
                return -EPERM;