提交 7a311d1c 编写于 作者: S Srinivas Pandruvada 提交者: yingbao jia

platform/x86: ISST: Check for unaligned mmio address

mainline inclusion
from mainline-5.11
commit a552f204
category: bugfix
bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I6FY06
CVE: NA
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a552f204b050b213b1e41a5134a0d2726c9a2ec1

Intel-SIG: commit a552f204 platform/x86: ISST: Check for unaligned
mmio address.
Backport SST missed patch for 5.10.

-------------------------------------------------

The address should be aligned to 4 byte boundary. So send an error for
unaligned address.
Signed-off-by: NSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Link: https://lore.kernel.org/r/20201204015746.1168941-1-srinivas.pandruvada@linux.intel.comSigned-off-by: NHans de Goede <hdegoede@redhat.com>
Signed-off-by: Nyingbao jia <yingbao.jia@intel.com>
上级 67c7095c
...@@ -42,6 +42,9 @@ static long isst_if_mmio_rd_wr(u8 *cmd_ptr, int *write_only, int resume) ...@@ -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) if (io_reg->reg < 0x04 || io_reg->reg > 0xD0)
return -EINVAL; return -EINVAL;
if (io_reg->reg % 4)
return -EINVAL;
if (io_reg->read_write && !capable(CAP_SYS_ADMIN)) if (io_reg->read_write && !capable(CAP_SYS_ADMIN))
return -EPERM; return -EPERM;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册