aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorBalbir Singh <bsingharora@gmail.com>2016-08-10 12:07:50 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2016-08-17 13:27:55 +1000
commit5c4bfc63a0e6ae9d3bb6f6e1bfaa9443c847998a (patch)
treeb4c8bf2094f65733d57ad0c2e104a0b5441dab37 /hw
parent683c50e27319d432176931bebb5aa172606783ac (diff)
downloadskiboot-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 'hw')
-rw-r--r--hw/cec.c3
-rw-r--r--hw/xscom.c3
2 files changed, 6 insertions, 0 deletions
diff --git a/hw/cec.c b/hw/cec.c
index 1743f4d..2f56e81 100644
--- a/hw/cec.c
+++ b/hw/cec.c
@@ -72,6 +72,9 @@ static int64_t opal_pci_get_hub_diag_data(uint64_t hub_id,
{
struct io_hub *hub = cec_get_hub_by_id(hub_id);
+ if (!opal_addr_valid(diag_buffer))
+ return OPAL_PARAMETER;
+
if (!hub)
return OPAL_PARAMETER;
diff --git a/hw/xscom.c b/hw/xscom.c
index 9e9dcee..95fdb97 100644
--- a/hw/xscom.c
+++ b/hw/xscom.c
@@ -400,6 +400,9 @@ int xscom_read(uint32_t partid, uint64_t pcb_addr, uint64_t *val)
uint32_t gcid;
int rc;
+ if (!opal_addr_valid(val))
+ return OPAL_PARAMETER;
+
/* Handle part ID decoding */
switch(partid >> 28) {
case 0: /* Normal processor chip */