diff options
author | Balbir Singh <bsingharora@gmail.com> | 2016-08-10 12:07:50 +1000 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2016-08-17 13:27:55 +1000 |
commit | 5c4bfc63a0e6ae9d3bb6f6e1bfaa9443c847998a (patch) | |
tree | b4c8bf2094f65733d57ad0c2e104a0b5441dab37 /core/flash.c | |
parent | 683c50e27319d432176931bebb5aa172606783ac (diff) | |
download | skiboot-5c4bfc63a0e6ae9d3bb6f6e1bfaa9443c847998a.zip skiboot-5c4bfc63a0e6ae9d3bb6f6e1bfaa9443c847998a.tar.gz skiboot-5c4bfc63a0e6ae9d3bb6f6e1bfaa9443c847998a.tar.bz2 |
Use additional checks in skiboot for pointers
The checks validate pointers sent in using
opal_addr_valid() in opal_call API's provided
via the console, cpu, fdt, flash, i2c, interrupts,
nvram, opal-msg, opal, opal-pci, xscom and
cec modules
Signed-off-by: Balbir Singh <bsingharora@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'core/flash.c')
-rw-r--r-- | core/flash.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/core/flash.c b/core/flash.c index da435a0..6d384d4 100644 --- a/core/flash.c +++ b/core/flash.c @@ -387,12 +387,18 @@ err: static int64_t opal_flash_read(uint64_t id, uint64_t offset, uint64_t buf, uint64_t size, uint64_t token) { + if (!opal_addr_valid((void *)buf)) + return OPAL_PARAMETER; + return opal_flash_op(FLASH_OP_READ, id, offset, buf, size, token); } static int64_t opal_flash_write(uint64_t id, uint64_t offset, uint64_t buf, uint64_t size, uint64_t token) { + if (!opal_addr_valid((void *)buf)) + return OPAL_PARAMETER; + return opal_flash_op(FLASH_OP_WRITE, id, offset, buf, size, token); } |