diff options
author | Matthew R. Ochs <mrochs@linux.vnet.ibm.com> | 2015-10-21 20:14:01 (GMT) |
---|---|---|
committer | James Bottomley <JBottomley@Odin.com> | 2015-10-30 08:14:41 (GMT) |
commit | e5ce067b7b6e123a88929a18a8a58811ffcec279 (patch) | |
tree | 605d97ad36ed048531a6326bf85644c8f3f50670 /drivers/scsi/cxlflash/sislite.h | |
parent | 964497b3bf3fed0a1db9dabe9fe080853230e5a7 (diff) | |
download | linux-e5ce067b7b6e123a88929a18a8a58811ffcec279.tar.xz |
cxlflash: Fix AFU version access/storage and add check
The AFU version is stored as a non-terminated string of bytes within
a 64-bit little-endian register. Presently the value is read directly
(no MMIO accessor) and is stored in a buffer that is not big enough
to contain a NULL terminator. Additionally the version obtained is not
evaluated against a known value to prevent usage with unsupported AFUs.
All of these deficiencies can lead to a variety of problems.
To remedy, use the correct MMIO accessor to read the version value into
a null-terminated buffer and add a check to prevent an incompatible AFU
from being used with this driver.
Signed-off-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>
Signed-off-by: Manoj N. Kumar <manoj@linux.vnet.ibm.com>
Reviewed-by: Brian King <brking@linux.vnet.ibm.com>
Reviewed-by: Daniel Axtens <dja@axtens.net>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
Diffstat (limited to 'drivers/scsi/cxlflash/sislite.h')
-rw-r--r-- | drivers/scsi/cxlflash/sislite.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/cxlflash/sislite.h b/drivers/scsi/cxlflash/sislite.h index 63bf394..8425d1a 100644 --- a/drivers/scsi/cxlflash/sislite.h +++ b/drivers/scsi/cxlflash/sislite.h @@ -340,7 +340,7 @@ struct sisl_global_regs { #define SISL_AFUCONF_MBOX_CLR_READ 0x0010ULL __be64 afu_config; __be64 rsvd[0xf8]; - __be64 afu_version; + __le64 afu_version; __be64 interface_version; }; |