From 5c4bfc63a0e6ae9d3bb6f6e1bfaa9443c847998a Mon Sep 17 00:00:00 2001 From: Balbir Singh Date: Wed, 10 Aug 2016 12:07:50 +1000 Subject: 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 Signed-off-by: Stewart Smith --- core/i2c.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'core/i2c.c') diff --git a/core/i2c.c b/core/i2c.c index cf9dd67..de74681 100644 --- a/core/i2c.c +++ b/core/i2c.c @@ -59,6 +59,9 @@ static int opal_i2c_request(uint64_t async_token, uint32_t bus_id, struct i2c_request *req; int rc; + if (!opal_addr_valid(oreq)) + return OPAL_PARAMETER; + if (oreq->flags & OPAL_I2C_ADDR_10) return OPAL_UNSUPPORTED; -- cgit v1.1